minecraft-renderer 0.1.46 → 0.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/mesher.js +17 -17
- package/dist/mesher.js.map +4 -4
- package/dist/mesherWasm.js +18 -18
- package/dist/minecraft-renderer.js +54 -54
- package/dist/minecraft-renderer.js.meta.json +1 -1
- package/dist/threeWorker.js +384 -384
- package/package.json +1 -1
- package/src/graphicsBackend/appViewer.ts +10 -0
- package/src/graphicsBackend/config.ts +0 -1
- package/src/graphicsBackend/index.ts +1 -0
- package/src/graphicsBackend/rendererOptionsSync.ts +243 -0
- package/src/graphicsBackend/types.ts +6 -1
- package/src/mesher-shared/blockPropertiesForMeshing.ts +79 -0
- package/src/mesher-shared/exportedGeometryTypes.ts +26 -0
- package/src/mesher-shared/models.ts +3 -79
- package/src/three/documentRenderer.ts +5 -9
- package/src/three/graphicsBackendBase.ts +1 -2
- package/src/three/menuBackground/defaultOptions.ts +188 -30
- package/src/three/menuBackground/index.ts +10 -2
- package/src/three/worldGeometryExport.ts +3 -24
- package/src/wasm-mesher/bridge/render-from-wasm.ts +5 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var v6=Object.create;var Ye=Object.defineProperty;var l6=Object.getOwnPropertyDescriptor;var c6=Object.getOwnPropertyNames;var d6=Object.getPrototypeOf,u6=Object.prototype.hasOwnProperty;var f6=(n,t,e)=>t in n?Ye(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var h6=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var mt=(n,t)=>()=>(n&&(t=n(n=0)),t);var et=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),U5=(n,t)=>{for(var e in t)Ye(n,e,{get:t[e],enumerable:!0})},Yr=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of c6(t))!u6.call(n,r)&&r!==e&&Ye(n,r,{get:()=>t[r],enumerable:!(i=l6(t,r))||i.enumerable});return n};var Qe=(n,t,e)=>(e=n!=null?v6(d6(n)):{},Yr(t||!n||!n.__esModule?Ye(e,"default",{value:n,enumerable:!0}):e,n)),m6=n=>Yr(Ye({},"__esModule",{value:!0}),n);var u=(n,t,e)=>(f6(n,typeof t!="symbol"?t+"":t,e),e);var x=mt(()=>{});var R=mt(()=>{});var D={};U5(D,{_debugEnd:()=>zn,_debugProcess:()=>On,_events:()=>Xn,_eventsCount:()=>$n,_exiting:()=>pn,_fatalExceptions:()=>Pn,_getActiveHandles:()=>_n,_getActiveRequests:()=>yn,_kill:()=>An,_linkedBinding:()=>hn,_maxListeners:()=>Zn,_preload_modules:()=>Kn,_rawDebug:()=>un,_startProfilerIdleNotifier:()=>Dn,_stopProfilerIdleNotifier:()=>Fn,_tickCallback:()=>Hn,abort:()=>Nn,addListener:()=>t2,allowedNodeEnvironmentFlags:()=>Mn,arch:()=>Zr,argv:()=>tn,argv0:()=>Qn,assert:()=>Sn,binding:()=>on,browser:()=>dn,chdir:()=>ln,config:()=>gn,cpuUsage:()=>W5,cwd:()=>vn,debugPort:()=>Yn,default:()=>l2,dlopen:()=>bn,domain:()=>mn,emit:()=>s2,emitWarning:()=>sn,env:()=>$r,execArgv:()=>en,execPath:()=>jn,exit:()=>kn,features:()=>Cn,hasUncaughtExceptionCaptureCallback:()=>In,hrtime:()=>N5,kill:()=>Rn,listeners:()=>v2,memoryUsage:()=>xn,moduleLoadList:()=>fn,nextTick:()=>Kr,off:()=>i2,on:()=>gt,once:()=>e2,openStdin:()=>Tn,pid:()=>Wn,platform:()=>Xr,ppid:()=>Vn,prependListener:()=>o2,prependOnceListener:()=>a2,reallyExit:()=>wn,release:()=>cn,removeAllListeners:()=>n2,removeListener:()=>r2,resourceUsage:()=>En,setSourceMapsEnabled:()=>Jn,setUncaughtExceptionCaptureCallback:()=>Bn,stderr:()=>Un,stdin:()=>Gn,stdout:()=>Ln,title:()=>qr,umask:()=>an,uptime:()=>qn,version:()=>rn,versions:()=>nn});function oi(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function p6(){!he||!Wt||(he=!1,Wt.length?pt=Wt.concat(pt):G5=-1,pt.length&&Qr())}function Qr(){if(!he){var n=setTimeout(p6,0);he=!0;for(var t=pt.length;t;){for(Wt=pt,pt=[];++G5<t;)Wt&&Wt[G5].run();G5=-1,t=pt.length}Wt=null,he=!1,clearTimeout(n)}}function Kr(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];pt.push(new Jr(n,t)),pt.length===1&&!he&&setTimeout(Qr,0)}function Jr(n,t){this.fun=n,this.array=t}function N0(){}function hn(n){oi("_linkedBinding")}function bn(n){oi("dlopen")}function yn(){return[]}function _n(){return[]}function Sn(n,t){if(!n)throw new Error(t||"assertion error")}function In(){return!1}function qn(){return kt.now()/1e3}function N5(n){var t=Math.floor((Date.now()-kt.now())*.001),e=kt.now()*.001,i=Math.floor(e)+t,r=Math.floor(e%1*1e9);return n&&(i=i-n[0],r=r-n[1],r<0&&(i--,r+=si)),[i,r]}function gt(){return l2}function v2(n){return[]}var pt,he,Wt,G5,qr,Zr,Xr,$r,tn,en,rn,nn,sn,on,an,vn,ln,cn,dn,un,fn,mn,pn,gn,wn,An,W5,En,xn,Rn,kn,Tn,Mn,Cn,Pn,Bn,Hn,On,zn,Dn,Fn,Ln,Un,Gn,Nn,Wn,Vn,jn,Yn,Qn,Kn,Jn,kt,ni,si,Zn,Xn,$n,t2,e2,i2,r2,n2,s2,o2,a2,l2,c2=mt(()=>{x();R();T();k();pt=[],he=!1,G5=-1;Jr.prototype.run=function(){this.fun.apply(null,this.array)};qr="browser",Zr="x64",Xr="browser",$r={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},tn=["/usr/bin/node"],en=[],rn="v16.8.0",nn={},sn=function(n,t){},on=function(n){oi("binding")},an=function(n){return 0},vn=function(){return"/"},ln=function(n){},cn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};dn=!0,un=N0,fn=[];mn={},pn=!1,gn={};wn=N0,An=N0,W5=function(){return{}},En=W5,xn=W5,Rn=N0,kn=N0,Tn=N0,Mn={};Cn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Pn=N0,Bn=N0;Hn=N0,On=N0,zn=N0,Dn=N0,Fn=N0,Ln=void 0,Un=void 0,Gn=void 0,Nn=N0,Wn=2,Vn=1,jn="/bin/usr/node",Yn=9229,Qn="node",Kn=[],Jn=N0,kt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};kt.now===void 0&&(ni=Date.now(),kt.timing&&kt.timing.navigationStart&&(ni=kt.timing.navigationStart),kt.now=()=>Date.now()-ni);si=1e9;N5.bigint=function(n){var t=N5(n);return typeof BigInt>"u"?t[0]*si+t[1]:BigInt(t[0]*si)+BigInt(t[1])};Zn=10,Xn={},$n=0;t2=gt,e2=gt,i2=gt,r2=gt,n2=gt,s2=N0,o2=gt,a2=gt;l2={version:rn,versions:nn,arch:Zr,platform:Xr,browser:dn,release:cn,_rawDebug:un,moduleLoadList:fn,binding:on,_linkedBinding:hn,_events:Xn,_eventsCount:$n,_maxListeners:Zn,on:gt,addListener:t2,once:e2,off:i2,removeListener:r2,removeAllListeners:n2,emit:s2,prependListener:o2,prependOnceListener:a2,listeners:v2,domain:mn,_exiting:pn,config:gn,dlopen:bn,uptime:qn,_getActiveRequests:yn,_getActiveHandles:_n,reallyExit:wn,_kill:An,cpuUsage:W5,resourceUsage:En,memoryUsage:xn,kill:Rn,exit:kn,openStdin:Tn,allowedNodeEnvironmentFlags:Mn,assert:Sn,features:Cn,_fatalExceptions:Pn,setUncaughtExceptionCaptureCallback:Bn,hasUncaughtExceptionCaptureCallback:In,emitWarning:sn,nextTick:Kr,_tickCallback:Hn,_debugProcess:On,_debugEnd:zn,_startProfilerIdleNotifier:Dn,_stopProfilerIdleNotifier:Fn,stdout:Ln,stdin:Gn,stderr:Un,abort:Nn,umask:an,chdir:ln,cwd:vn,env:$r,title:qr,argv:tn,execArgv:en,pid:Wn,ppid:Vn,execPath:jn,debugPort:Yn,hrtime:N5,argv0:Qn,_preload_modules:Kn,setSourceMapsEnabled:Jn}});var k=mt(()=>{c2()});function g6(){if(d2)return Ke;d2=!0,Ke.byteLength=a,Ke.toByteArray=l,Ke.fromByteArray=f;for(var n=[],t=[],e=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,s=i.length;r<s;++r)n[r]=i[r],t[i.charCodeAt(r)]=r;t[45]=62,t[95]=63;function o(m){var g=m.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=m.indexOf("=");b===-1&&(b=g);var A=b===g?0:4-b%4;return[b,A]}function a(m){var g=o(m),b=g[0],A=g[1];return(b+A)*3/4-A}function v(m,g,b){return(g+b)*3/4-b}function l(m){var g,b=o(m),A=b[0],_=b[1],w=new e(v(m,A,_)),M=0,S=_>0?A-4:A,C;for(C=0;C<S;C+=4)g=t[m.charCodeAt(C)]<<18|t[m.charCodeAt(C+1)]<<12|t[m.charCodeAt(C+2)]<<6|t[m.charCodeAt(C+3)],w[M++]=g>>16&255,w[M++]=g>>8&255,w[M++]=g&255;return _===2&&(g=t[m.charCodeAt(C)]<<2|t[m.charCodeAt(C+1)]>>4,w[M++]=g&255),_===1&&(g=t[m.charCodeAt(C)]<<10|t[m.charCodeAt(C+1)]<<4|t[m.charCodeAt(C+2)]>>2,w[M++]=g>>8&255,w[M++]=g&255),w}function c(m){return n[m>>18&63]+n[m>>12&63]+n[m>>6&63]+n[m&63]}function d(m,g,b){for(var A,_=[],w=g;w<b;w+=3)A=(m[w]<<16&16711680)+(m[w+1]<<8&65280)+(m[w+2]&255),_.push(c(A));return _.join("")}function f(m){for(var g,b=m.length,A=b%3,_=[],w=16383,M=0,S=b-A;M<S;M+=w)_.push(d(m,M,M+w>S?S:M+w));return A===1?(g=m[b-1],_.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(m[b-2]<<8)+m[b-1],_.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),_.join("")}return Ke}function b6(){if(u2)return V5;u2=!0;return V5.read=function(n,t,e,i,r){var s,o,a=r*8-i-1,v=(1<<a)-1,l=v>>1,c=-7,d=e?r-1:0,f=e?-1:1,m=n[t+d];for(d+=f,s=m&(1<<-c)-1,m>>=-c,c+=a;c>0;s=s*256+n[t+d],d+=f,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=i;c>0;o=o*256+n[t+d],d+=f,c-=8);if(s===0)s=1-l;else{if(s===v)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-l}return(m?-1:1)*o*Math.pow(2,s-i)},V5.write=function(n,t,e,i,r,s){var o,a,v,l=s*8-r-1,c=(1<<l)-1,d=c>>1,f=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:s-1,g=i?1:-1,b=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(v=Math.pow(2,-o))<1&&(o--,v*=2),o+d>=1?t+=f/v:t+=f*Math.pow(2,1-d),t*v>=2&&(o++,v/=2),o+d>=c?(a=0,o=c):o+d>=1?(a=(t*v-1)*Math.pow(2,r),o=o+d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;n[e+m]=a&255,m+=g,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;n[e+m]=o&255,m+=g,o/=256,l-=8);n[e+m-g]|=b*128},V5}function h2(){if(f2)return Vt;f2=!0;let n=g6(),t=b6(),e=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Vt.Buffer=o,Vt.SlowBuffer=_,Vt.INSPECT_MAX_BYTES=50;let i=2147483647;Vt.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=r(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u";function r(){try{let y=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(y,h),y.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(y){if(y>i)throw new RangeError('The value "'+y+'" is invalid for option "size"');let h=new Uint8Array(y);return Object.setPrototypeOf(h,o.prototype),h}function o(y,h,p){if(typeof y=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(y)}return a(y,h,p)}o.poolSize=8192;function a(y,h,p){if(typeof y=="string")return d(y,h);if(ArrayBuffer.isView(y))return m(y);if(y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y);if(M0(y,ArrayBuffer)||y&&M0(y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(M0(y,SharedArrayBuffer)||y&&M0(y.buffer,SharedArrayBuffer)))return g(y,h,p);if(typeof y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let E=y.valueOf&&y.valueOf();if(E!=null&&E!==y)return o.from(E,h,p);let P=b(y);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof y[Symbol.toPrimitive]=="function")return o.from(y[Symbol.toPrimitive]("string"),h,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y)}o.from=function(y,h,p){return a(y,h,p)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function v(y){if(typeof y!="number")throw new TypeError('"size" argument must be of type number');if(y<0)throw new RangeError('The value "'+y+'" is invalid for option "size"')}function l(y,h,p){return v(y),y<=0?s(y):h!==void 0?typeof p=="string"?s(y).fill(h,p):s(y).fill(h):s(y)}o.alloc=function(y,h,p){return l(y,h,p)};function c(y){return v(y),s(y<0?0:A(y)|0)}o.allocUnsafe=function(y){return c(y)},o.allocUnsafeSlow=function(y){return c(y)};function d(y,h){if((typeof h!="string"||h==="")&&(h="utf8"),!o.isEncoding(h))throw new TypeError("Unknown encoding: "+h);let p=w(y,h)|0,E=s(p),P=E.write(y,h);return P!==p&&(E=E.slice(0,P)),E}function f(y){let h=y.length<0?0:A(y.length)|0,p=s(h);for(let E=0;E<h;E+=1)p[E]=y[E]&255;return p}function m(y){if(M0(y,Uint8Array)){let h=new Uint8Array(y);return g(h.buffer,h.byteOffset,h.byteLength)}return f(y)}function g(y,h,p){if(h<0||y.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(y.byteLength<h+(p||0))throw new RangeError('"length" is outside of buffer bounds');let E;return h===void 0&&p===void 0?E=new Uint8Array(y):p===void 0?E=new Uint8Array(y,h):E=new Uint8Array(y,h,p),Object.setPrototypeOf(E,o.prototype),E}function b(y){if(o.isBuffer(y)){let h=A(y.length)|0,p=s(h);return p.length===0||y.copy(p,0,0,h),p}if(y.length!==void 0)return typeof y.length!="number"||ue(y.length)?s(0):f(y);if(y.type==="Buffer"&&Array.isArray(y.data))return f(y.data)}function A(y){if(y>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return y|0}function _(y){return+y!=y&&(y=0),o.alloc(+y)}o.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==o.prototype},o.compare=function(h,p){if(M0(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),M0(p,Uint8Array)&&(p=o.from(p,p.offset,p.byteLength)),!o.isBuffer(h)||!o.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===p)return 0;let E=h.length,P=p.length;for(let z=0,G=Math.min(E,P);z<G;++z)if(h[z]!==p[z]){E=h[z],P=p[z];break}return E<P?-1:P<E?1:0},o.isEncoding=function(h){switch(String(h).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(h,p){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return o.alloc(0);let E;if(p===void 0)for(p=0,E=0;E<h.length;++E)p+=h[E].length;let P=o.allocUnsafe(p),z=0;for(E=0;E<h.length;++E){let G=h[E];if(M0(G,Uint8Array))z+G.length>P.length?(o.isBuffer(G)||(G=o.from(G)),G.copy(P,z)):Uint8Array.prototype.set.call(P,G,z);else if(o.isBuffer(G))G.copy(P,z);else throw new TypeError('"list" argument must be an Array of Buffers');z+=G.length}return P};function w(y,h){if(o.isBuffer(y))return y.length;if(ArrayBuffer.isView(y)||M0(y,ArrayBuffer))return y.byteLength;if(typeof y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof y);let p=y.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&p===0)return 0;let P=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return de(y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return ri(y).length;default:if(P)return E?-1:de(y).length;h=(""+h).toLowerCase(),P=!0}}o.byteLength=w;function M(y,h,p){let E=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,h>>>=0,p<=h))return"";for(y||(y="utf8");;)switch(y){case"hex":return p0(this,h,p);case"utf8":case"utf-8":return $(this,h,p);case"ascii":return l0(this,h,p);case"latin1":case"binary":return m0(this,h,p);case"base64":return q(this,h,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w0(this,h,p);default:if(E)throw new TypeError("Unknown encoding: "+y);y=(y+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function S(y,h,p){let E=y[h];y[h]=y[p],y[p]=E}o.prototype.swap16=function(){let h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<h;p+=2)S(this,p,p+1);return this},o.prototype.swap32=function(){let h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<h;p+=4)S(this,p,p+3),S(this,p+1,p+2);return this},o.prototype.swap64=function(){let h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<h;p+=8)S(this,p,p+7),S(this,p+1,p+6),S(this,p+2,p+5),S(this,p+3,p+4);return this},o.prototype.toString=function(){let h=this.length;return h===0?"":arguments.length===0?$(this,0,h):M.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(h){if(!o.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:o.compare(this,h)===0},o.prototype.inspect=function(){let h="",p=Vt.INSPECT_MAX_BYTES;return h=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(h+=" ... "),"<Buffer "+h+">"},e&&(o.prototype[e]=o.prototype.inspect),o.prototype.compare=function(h,p,E,P,z){if(M0(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),!o.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(p===void 0&&(p=0),E===void 0&&(E=h?h.length:0),P===void 0&&(P=0),z===void 0&&(z=this.length),p<0||E>h.length||P<0||z>this.length)throw new RangeError("out of range index");if(P>=z&&p>=E)return 0;if(P>=z)return-1;if(p>=E)return 1;if(p>>>=0,E>>>=0,P>>>=0,z>>>=0,this===h)return 0;let G=z-P,r0=E-p,b0=Math.min(G,r0),f0=this.slice(P,z),h0=h.slice(p,E);for(let c0=0;c0<b0;++c0)if(f0[c0]!==h0[c0]){G=f0[c0],r0=h0[c0];break}return G<r0?-1:r0<G?1:0};function C(y,h,p,E,P){if(y.length===0)return-1;if(typeof p=="string"?(E=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,ue(p)&&(p=P?0:y.length-1),p<0&&(p=y.length+p),p>=y.length){if(P)return-1;p=y.length-1}else if(p<0)if(P)p=0;else return-1;if(typeof h=="string"&&(h=o.from(h,E)),o.isBuffer(h))return h.length===0?-1:H(y,h,p,E,P);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(y,h,p):Uint8Array.prototype.lastIndexOf.call(y,h,p):H(y,[h],p,E,P);throw new TypeError("val must be string, number or Buffer")}function H(y,h,p,E,P){let z=1,G=y.length,r0=h.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(y.length<2||h.length<2)return-1;z=2,G/=2,r0/=2,p/=2}function b0(h0,c0){return z===1?h0[c0]:h0.readUInt16BE(c0*z)}let f0;if(P){let h0=-1;for(f0=p;f0<G;f0++)if(b0(y,f0)===b0(h,h0===-1?0:f0-h0)){if(h0===-1&&(h0=f0),f0-h0+1===r0)return h0*z}else h0!==-1&&(f0-=f0-h0),h0=-1}else for(p+r0>G&&(p=G-r0),f0=p;f0>=0;f0--){let h0=!0;for(let c0=0;c0<r0;c0++)if(b0(y,f0+c0)!==b0(h,c0)){h0=!1;break}if(h0)return f0}return-1}o.prototype.includes=function(h,p,E){return this.indexOf(h,p,E)!==-1},o.prototype.indexOf=function(h,p,E){return C(this,h,p,E,!0)},o.prototype.lastIndexOf=function(h,p,E){return C(this,h,p,E,!1)};function B(y,h,p,E){p=Number(p)||0;let P=y.length-p;E?(E=Number(E),E>P&&(E=P)):E=P;let z=h.length;E>z/2&&(E=z/2);let G;for(G=0;G<E;++G){let r0=parseInt(h.substr(G*2,2),16);if(ue(r0))return G;y[p+G]=r0}return G}function I(y,h,p,E){return q0(de(h,y.length-p),y,p,E)}function N(y,h,p,E){return q0(F5(h),y,p,E)}function O(y,h,p,E){return q0(ri(h),y,p,E)}function j(y,h,p,E){return q0(L5(h,y.length-p),y,p,E)}o.prototype.write=function(h,p,E,P){if(p===void 0)P="utf8",E=this.length,p=0;else if(E===void 0&&typeof p=="string")P=p,E=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(E)?(E=E>>>0,P===void 0&&(P="utf8")):(P=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let z=this.length-p;if((E===void 0||E>z)&&(E=z),h.length>0&&(E<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let G=!1;for(;;)switch(P){case"hex":return B(this,h,p,E);case"utf8":case"utf-8":return I(this,h,p,E);case"ascii":case"latin1":case"binary":return N(this,h,p,E);case"base64":return O(this,h,p,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,h,p,E);default:if(G)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),G=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(y,h,p){return h===0&&p===y.length?n.fromByteArray(y):n.fromByteArray(y.slice(h,p))}function $(y,h,p){p=Math.min(y.length,p);let E=[],P=h;for(;P<p;){let z=y[P],G=null,r0=z>239?4:z>223?3:z>191?2:1;if(P+r0<=p){let b0,f0,h0,c0;switch(r0){case 1:z<128&&(G=z);break;case 2:b0=y[P+1],(b0&192)===128&&(c0=(z&31)<<6|b0&63,c0>127&&(G=c0));break;case 3:b0=y[P+1],f0=y[P+2],(b0&192)===128&&(f0&192)===128&&(c0=(z&15)<<12|(b0&63)<<6|f0&63,c0>2047&&(c0<55296||c0>57343)&&(G=c0));break;case 4:b0=y[P+1],f0=y[P+2],h0=y[P+3],(b0&192)===128&&(f0&192)===128&&(h0&192)===128&&(c0=(z&15)<<18|(b0&63)<<12|(f0&63)<<6|h0&63,c0>65535&&c0<1114112&&(G=c0))}}G===null?(G=65533,r0=1):G>65535&&(G-=65536,E.push(G>>>10&1023|55296),G=56320|G&1023),E.push(G),P+=r0}return d0(E)}let e0=4096;function d0(y){let h=y.length;if(h<=e0)return String.fromCharCode.apply(String,y);let p="",E=0;for(;E<h;)p+=String.fromCharCode.apply(String,y.slice(E,E+=e0));return p}function l0(y,h,p){let E="";p=Math.min(y.length,p);for(let P=h;P<p;++P)E+=String.fromCharCode(y[P]&127);return E}function m0(y,h,p){let E="";p=Math.min(y.length,p);for(let P=h;P<p;++P)E+=String.fromCharCode(y[P]);return E}function p0(y,h,p){let E=y.length;(!h||h<0)&&(h=0),(!p||p<0||p>E)&&(p=E);let P="";for(let z=h;z<p;++z)P+=je[y[z]];return P}function w0(y,h,p){let E=y.slice(h,p),P="";for(let z=0;z<E.length-1;z+=2)P+=String.fromCharCode(E[z]+E[z+1]*256);return P}o.prototype.slice=function(h,p){let E=this.length;h=~~h,p=p===void 0?E:~~p,h<0?(h+=E,h<0&&(h=0)):h>E&&(h=E),p<0?(p+=E,p<0&&(p=0)):p>E&&(p=E),p<h&&(p=h);let P=this.subarray(h,p);return Object.setPrototypeOf(P,o.prototype),P};function n0(y,h,p){if(y%1!==0||y<0)throw new RangeError("offset is not uint");if(y+h>p)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(h,p,E){h=h>>>0,p=p>>>0,E||n0(h,p,this.length);let P=this[h],z=1,G=0;for(;++G<p&&(z*=256);)P+=this[h+G]*z;return P},o.prototype.readUintBE=o.prototype.readUIntBE=function(h,p,E){h=h>>>0,p=p>>>0,E||n0(h,p,this.length);let P=this[h+--p],z=1;for(;p>0&&(z*=256);)P+=this[h+--p]*z;return P},o.prototype.readUint8=o.prototype.readUInt8=function(h,p){return h=h>>>0,p||n0(h,1,this.length),this[h]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(h,p){return h=h>>>0,p||n0(h,2,this.length),this[h]|this[h+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(h,p){return h=h>>>0,p||n0(h,2,this.length),this[h]<<8|this[h+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},o.prototype.readBigUInt64LE=rt(function(h){h=h>>>0,Rt(h,"offset");let p=this[h],E=this[h+7];(p===void 0||E===void 0)&&Gt(h,this.length-8);let P=p+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,z=this[++h]+this[++h]*2**8+this[++h]*2**16+E*2**24;return BigInt(P)+(BigInt(z)<<BigInt(32))}),o.prototype.readBigUInt64BE=rt(function(h){h=h>>>0,Rt(h,"offset");let p=this[h],E=this[h+7];(p===void 0||E===void 0)&&Gt(h,this.length-8);let P=p*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],z=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+E;return(BigInt(P)<<BigInt(32))+BigInt(z)}),o.prototype.readIntLE=function(h,p,E){h=h>>>0,p=p>>>0,E||n0(h,p,this.length);let P=this[h],z=1,G=0;for(;++G<p&&(z*=256);)P+=this[h+G]*z;return z*=128,P>=z&&(P-=Math.pow(2,8*p)),P},o.prototype.readIntBE=function(h,p,E){h=h>>>0,p=p>>>0,E||n0(h,p,this.length);let P=p,z=1,G=this[h+--P];for(;P>0&&(z*=256);)G+=this[h+--P]*z;return z*=128,G>=z&&(G-=Math.pow(2,8*p)),G},o.prototype.readInt8=function(h,p){return h=h>>>0,p||n0(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},o.prototype.readInt16LE=function(h,p){h=h>>>0,p||n0(h,2,this.length);let E=this[h]|this[h+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(h,p){h=h>>>0,p||n0(h,2,this.length);let E=this[h+1]|this[h]<<8;return E&32768?E|4294901760:E},o.prototype.readInt32LE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},o.prototype.readInt32BE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},o.prototype.readBigInt64LE=rt(function(h){h=h>>>0,Rt(h,"offset");let p=this[h],E=this[h+7];(p===void 0||E===void 0)&&Gt(h,this.length-8);let P=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(E<<24);return(BigInt(P)<<BigInt(32))+BigInt(p+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),o.prototype.readBigInt64BE=rt(function(h){h=h>>>0,Rt(h,"offset");let p=this[h],E=this[h+7];(p===void 0||E===void 0)&&Gt(h,this.length-8);let P=(p<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(P)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+E)}),o.prototype.readFloatLE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),t.read(this,h,!0,23,4)},o.prototype.readFloatBE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),t.read(this,h,!1,23,4)},o.prototype.readDoubleLE=function(h,p){return h=h>>>0,p||n0(h,8,this.length),t.read(this,h,!0,52,8)},o.prototype.readDoubleBE=function(h,p){return h=h>>>0,p||n0(h,8,this.length),t.read(this,h,!1,52,8)};function Y(y,h,p,E,P,z){if(!o.isBuffer(y))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>P||h<z)throw new RangeError('"value" argument is out of bounds');if(p+E>y.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(h,p,E,P){if(h=+h,p=p>>>0,E=E>>>0,!P){let r0=Math.pow(2,8*E)-1;Y(this,h,p,E,r0,0)}let z=1,G=0;for(this[p]=h&255;++G<E&&(z*=256);)this[p+G]=h/z&255;return p+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(h,p,E,P){if(h=+h,p=p>>>0,E=E>>>0,!P){let r0=Math.pow(2,8*E)-1;Y(this,h,p,E,r0,0)}let z=E-1,G=1;for(this[p+z]=h&255;--z>=0&&(G*=256);)this[p+z]=h/G&255;return p+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,1,255,0),this[p]=h&255,p+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,2,65535,0),this[p]=h&255,this[p+1]=h>>>8,p+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,2,65535,0),this[p]=h>>>8,this[p+1]=h&255,p+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,4,4294967295,0),this[p+3]=h>>>24,this[p+2]=h>>>16,this[p+1]=h>>>8,this[p]=h&255,p+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,4,4294967295,0),this[p]=h>>>24,this[p+1]=h>>>16,this[p+2]=h>>>8,this[p+3]=h&255,p+4};function o0(y,h,p,E,P){Ut(h,E,P,y,p,7);let z=Number(h&BigInt(4294967295));y[p++]=z,z=z>>8,y[p++]=z,z=z>>8,y[p++]=z,z=z>>8,y[p++]=z;let G=Number(h>>BigInt(32)&BigInt(4294967295));return y[p++]=G,G=G>>8,y[p++]=G,G=G>>8,y[p++]=G,G=G>>8,y[p++]=G,p}function g0(y,h,p,E,P){Ut(h,E,P,y,p,7);let z=Number(h&BigInt(4294967295));y[p+7]=z,z=z>>8,y[p+6]=z,z=z>>8,y[p+5]=z,z=z>>8,y[p+4]=z;let G=Number(h>>BigInt(32)&BigInt(4294967295));return y[p+3]=G,G=G>>8,y[p+2]=G,G=G>>8,y[p+1]=G,G=G>>8,y[p]=G,p+8}o.prototype.writeBigUInt64LE=rt(function(h,p=0){return o0(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=rt(function(h,p=0){return g0(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(h,p,E,P){if(h=+h,p=p>>>0,!P){let b0=Math.pow(2,8*E-1);Y(this,h,p,E,b0-1,-b0)}let z=0,G=1,r0=0;for(this[p]=h&255;++z<E&&(G*=256);)h<0&&r0===0&&this[p+z-1]!==0&&(r0=1),this[p+z]=(h/G>>0)-r0&255;return p+E},o.prototype.writeIntBE=function(h,p,E,P){if(h=+h,p=p>>>0,!P){let b0=Math.pow(2,8*E-1);Y(this,h,p,E,b0-1,-b0)}let z=E-1,G=1,r0=0;for(this[p+z]=h&255;--z>=0&&(G*=256);)h<0&&r0===0&&this[p+z+1]!==0&&(r0=1),this[p+z]=(h/G>>0)-r0&255;return p+E},o.prototype.writeInt8=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,1,127,-128),h<0&&(h=255+h+1),this[p]=h&255,p+1},o.prototype.writeInt16LE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,2,32767,-32768),this[p]=h&255,this[p+1]=h>>>8,p+2},o.prototype.writeInt16BE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,2,32767,-32768),this[p]=h>>>8,this[p+1]=h&255,p+2},o.prototype.writeInt32LE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,4,2147483647,-2147483648),this[p]=h&255,this[p+1]=h>>>8,this[p+2]=h>>>16,this[p+3]=h>>>24,p+4},o.prototype.writeInt32BE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[p]=h>>>24,this[p+1]=h>>>16,this[p+2]=h>>>8,this[p+3]=h&255,p+4},o.prototype.writeBigInt64LE=rt(function(h,p=0){return o0(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=rt(function(h,p=0){return g0(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function L0(y,h,p,E,P,z){if(p+E>y.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function H0(y,h,p,E,P){return h=+h,p=p>>>0,P||L0(y,h,p,4),t.write(y,h,p,E,23,4),p+4}o.prototype.writeFloatLE=function(h,p,E){return H0(this,h,p,!0,E)},o.prototype.writeFloatBE=function(h,p,E){return H0(this,h,p,!1,E)};function X0(y,h,p,E,P){return h=+h,p=p>>>0,P||L0(y,h,p,8),t.write(y,h,p,E,52,8),p+8}o.prototype.writeDoubleLE=function(h,p,E){return X0(this,h,p,!0,E)},o.prototype.writeDoubleBE=function(h,p,E){return X0(this,h,p,!1,E)},o.prototype.copy=function(h,p,E,P){if(!o.isBuffer(h))throw new TypeError("argument should be a Buffer");if(E||(E=0),!P&&P!==0&&(P=this.length),p>=h.length&&(p=h.length),p||(p=0),P>0&&P<E&&(P=E),P===E||h.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),h.length-p<P-E&&(P=h.length-p+E);let z=P-E;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,E,P):Uint8Array.prototype.set.call(h,this.subarray(E,P),p),z},o.prototype.fill=function(h,p,E,P){if(typeof h=="string"){if(typeof p=="string"?(P=p,p=0,E=this.length):typeof E=="string"&&(P=E,E=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!o.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(h.length===1){let G=h.charCodeAt(0);(P==="utf8"&&G<128||P==="latin1")&&(h=G)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(p<0||this.length<p||this.length<E)throw new RangeError("Out of range index");if(E<=p)return this;p=p>>>0,E=E===void 0?this.length:E>>>0,h||(h=0);let z;if(typeof h=="number")for(z=p;z<E;++z)this[z]=h;else{let G=o.isBuffer(h)?h:o.from(h,P),r0=G.length;if(r0===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(z=0;z<E-p;++z)this[z+p]=G[z%r0]}return this};let u0={};function vt(y,h,p){u0[y]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${y}]`,this.stack,delete this.name}get code(){return y}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${y}]: ${this.message}`}}}vt("ERR_BUFFER_OUT_OF_BOUNDS",function(y){return y?`${y} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),vt("ERR_INVALID_ARG_TYPE",function(y,h){return`The "${y}" argument must be of type number. Received type ${typeof h}`},TypeError),vt("ERR_OUT_OF_RANGE",function(y,h,p){let E=`The value of "${y}" is out of range.`,P=p;return Number.isInteger(p)&&Math.abs(p)>2**32?P=We(String(p)):typeof p=="bigint"&&(P=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(P=We(P)),P+="n"),E+=` It must be ${h}. Received ${P}`,E},RangeError);function We(y){let h="",p=y.length,E=y[0]==="-"?1:0;for(;p>=E+4;p-=3)h=`_${y.slice(p-3,p)}${h}`;return`${y.slice(0,p)}${h}`}function Ve(y,h,p){Rt(h,"offset"),(y[h]===void 0||y[h+p]===void 0)&&Gt(h,y.length-(p+1))}function Ut(y,h,p,E,P,z){if(y>p||y<h){let G=typeof h=="bigint"?"n":"",r0;throw h===0||h===BigInt(0)?r0=`>= 0${G} and < 2${G} ** ${(z+1)*8}${G}`:r0=`>= -(2${G} ** ${(z+1)*8-1}${G}) and < 2 ** ${(z+1)*8-1}${G}`,new u0.ERR_OUT_OF_RANGE("value",r0,y)}Ve(E,P,z)}function Rt(y,h){if(typeof y!="number")throw new u0.ERR_INVALID_ARG_TYPE(h,"number",y)}function Gt(y,h,p){throw Math.floor(y)!==y?(Rt(y,p),new u0.ERR_OUT_OF_RANGE("offset","an integer",y)):h<0?new u0.ERR_BUFFER_OUT_OF_BOUNDS:new u0.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${h}`,y)}let D5=/[^+/0-9A-Za-z-_]/g;function Nt(y){if(y=y.split("=")[0],y=y.trim().replace(D5,""),y.length<2)return"";for(;y.length%4!==0;)y=y+"=";return y}function de(y,h){h=h||1/0;let p,E=y.length,P=null,z=[];for(let G=0;G<E;++G){if(p=y.charCodeAt(G),p>55295&&p<57344){if(!P){if(p>56319){(h-=3)>-1&&z.push(239,191,189);continue}else if(G+1===E){(h-=3)>-1&&z.push(239,191,189);continue}P=p;continue}if(p<56320){(h-=3)>-1&&z.push(239,191,189),P=p;continue}p=(P-55296<<10|p-56320)+65536}else P&&(h-=3)>-1&&z.push(239,191,189);if(P=null,p<128){if((h-=1)<0)break;z.push(p)}else if(p<2048){if((h-=2)<0)break;z.push(p>>6|192,p&63|128)}else if(p<65536){if((h-=3)<0)break;z.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((h-=4)<0)break;z.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return z}function F5(y){let h=[];for(let p=0;p<y.length;++p)h.push(y.charCodeAt(p)&255);return h}function L5(y,h){let p,E,P,z=[];for(let G=0;G<y.length&&!((h-=2)<0);++G)p=y.charCodeAt(G),E=p>>8,P=p%256,z.push(P),z.push(E);return z}function ri(y){return n.toByteArray(Nt(y))}function q0(y,h,p,E){let P;for(P=0;P<E&&!(P+p>=h.length||P>=y.length);++P)h[P+p]=y[P];return P}function M0(y,h){return y instanceof h||y!=null&&y.constructor!=null&&y.constructor.name!=null&&y.constructor.name===h.name}function ue(y){return y!==y}let je=function(){let y="0123456789abcdef",h=new Array(256);for(let p=0;p<16;++p){let E=p*16;for(let P=0;P<16;++P)h[E+P]=y[p]+y[P]}return h}();function rt(y){return typeof BigInt>"u"?fe:y}function fe(){throw new Error("BigInt not supported")}return Vt}var Ke,d2,V5,u2,Vt,f2,m2=mt(()=>{x();R();T();k();Ke={},d2=!1;V5={},u2=!1;Vt={},f2=!1});var jt,F,U9,G9,p2=mt(()=>{x();R();T();k();m2();jt=h2();jt.Buffer;jt.SlowBuffer;jt.INSPECT_MAX_BYTES;jt.kMaxLength;F=jt.Buffer,U9=jt.INSPECT_MAX_BYTES,G9=jt.kMaxLength});var T=mt(()=>{p2()});var U2=et((mi,pi)=>{x();R();T();k();(function(n,t){typeof mi=="object"&&typeof pi<"u"?pi.exports=t():typeof define=="function"&&define.amd?define(t):n.Stats=t()})(mi,function(){var n=function(){function t(d){return r.appendChild(d.dom),d}function e(d){for(var f=0;f<r.children.length;f++)r.children[f].style.display=f===d?"block":"none";i=d}var i=0,r=document.createElement("div");r.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",r.addEventListener("click",function(d){d.preventDefault(),e(++i%r.children.length)},!1);var s=(performance||Date).now(),o=s,a=0,v=t(new n.Panel("FPS","#0ff","#002")),l=t(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new n.Panel("MB","#f08","#201"));return e(0),{REVISION:16,dom:r,addPanel:t,showPanel:e,begin:function(){s=(performance||Date).now()},end:function(){a++;var d=(performance||Date).now();if(l.update(d-s,200),d>o+1e3&&(v.update(1e3*a/(d-o),100),o=d,a=0,c)){var f=performance.memory;c.update(f.usedJSHeapSize/1048576,f.jsHeapSizeLimit/1048576)}return d},update:function(){s=this.end()},domElement:r,setMode:e}};return n.Panel=function(t,e,i){var r=1/0,s=0,o=Math.round,a=o(window.devicePixelRatio||1),v=80*a,l=48*a,c=3*a,d=2*a,f=3*a,m=15*a,g=74*a,b=30*a,A=document.createElement("canvas");A.width=v,A.height=l,A.style.cssText="width:80px;height:48px";var _=A.getContext("2d");return _.font="bold "+9*a+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=i,_.fillRect(0,0,v,l),_.fillStyle=e,_.fillText(t,c,d),_.fillRect(f,m,g,b),_.fillStyle=i,_.globalAlpha=.9,_.fillRect(f,m,g,b),{dom:A,update:function(w,M){r=Math.min(r,w),s=Math.max(s,w),_.fillStyle=i,_.globalAlpha=1,_.fillRect(0,0,v,m),_.fillStyle=e,_.fillText(o(w)+" "+t+" ("+o(r)+"-"+o(s)+")",c,d),_.drawImage(A,f+a,m,g-a,b,f,m,g-a,b),_.fillRect(f+g-a,m,a,b),_.fillStyle=i,_.globalAlpha=.9,_.fillRect(f+g-a,m,a,o((1-w/M)*b))}}},n})});var i3=et((e3,d1)=>{x();R();T();k();(function(n,t){typeof d1=="object"&&d1.exports?d1.exports=t():n.nearley=t()})(e3,function(){function n(v,l,c){return this.id=++n.highestId,this.name=v,this.symbols=l,this.postprocess=c,this}n.highestId=0,n.prototype.toString=function(v){var l=typeof v>"u"?this.symbols.map(a).join(" "):this.symbols.slice(0,v).map(a).join(" ")+" \u25CF "+this.symbols.slice(v).map(a).join(" ");return this.name+" \u2192 "+l};function t(v,l,c,d){this.rule=v,this.dot=l,this.reference=c,this.data=[],this.wantedBy=d,this.isComplete=this.dot===v.symbols.length}t.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},t.prototype.nextState=function(v){var l=new t(this.rule,this.dot+1,this.reference,this.wantedBy);return l.left=this,l.right=v,l.isComplete&&(l.data=l.build(),l.right=void 0),l},t.prototype.build=function(){var v=[],l=this;do v.push(l.right.data),l=l.left;while(l.left);return v.reverse(),v},t.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function e(v,l){this.grammar=v,this.index=l,this.states=[],this.wants={},this.scannable=[],this.completed={}}e.prototype.process=function(v){for(var l=this.states,c=this.wants,d=this.completed,f=0;f<l.length;f++){var m=l[f];if(m.isComplete){if(m.finish(),m.data!==s.fail){for(var g=m.wantedBy,b=g.length;b--;){var A=g[b];this.complete(A,m)}if(m.reference===this.index){var _=m.rule.name;(this.completed[_]=this.completed[_]||[]).push(m)}}}else{var _=m.rule.symbols[m.dot];if(typeof _!="string"){this.scannable.push(m);continue}if(c[_]){if(c[_].push(m),d.hasOwnProperty(_))for(var w=d[_],b=0;b<w.length;b++){var M=w[b];this.complete(m,M)}}else c[_]=[m],this.predict(_)}}},e.prototype.predict=function(v){for(var l=this.grammar.byName[v]||[],c=0;c<l.length;c++){var d=l[c],f=this.wants[v],m=new t(d,0,this.index,f);this.states.push(m)}},e.prototype.complete=function(v,l){var c=v.nextState(l);this.states.push(c)};function i(v,l){this.rules=v,this.start=l||this.rules[0].name;var c=this.byName={};this.rules.forEach(function(d){c.hasOwnProperty(d.name)||(c[d.name]=[]),c[d.name].push(d)})}i.fromCompiled=function(d,l){var c=d.Lexer;d.ParserStart&&(l=d.ParserStart,d=d.ParserRules);var d=d.map(function(m){return new n(m.name,m.symbols,m.postprocess)}),f=new i(d,l);return f.lexer=c,f};function r(){this.reset("")}r.prototype.reset=function(v,l){this.buffer=v,this.index=0,this.line=l?l.line:1,this.lastLineBreak=l?-l.col:0},r.prototype.next=function(){if(this.index<this.buffer.length){var v=this.buffer[this.index++];return v===`
|
|
1
|
+
var l6=Object.create;var Qe=Object.defineProperty;var c6=Object.getOwnPropertyDescriptor;var d6=Object.getOwnPropertyNames;var u6=Object.getPrototypeOf,f6=Object.prototype.hasOwnProperty;var h6=(n,t,e)=>t in n?Qe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var m6=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var mt=(n,t)=>()=>(n&&(t=n(n=0)),t);var et=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),G5=(n,t)=>{for(var e in t)Qe(n,e,{get:t[e],enumerable:!0})},Kr=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of d6(t))!f6.call(n,r)&&r!==e&&Qe(n,r,{get:()=>t[r],enumerable:!(i=c6(t,r))||i.enumerable});return n};var Ke=(n,t,e)=>(e=n!=null?l6(u6(n)):{},Kr(t||!n||!n.__esModule?Qe(e,"default",{value:n,enumerable:!0}):e,n)),p6=n=>Kr(Qe({},"__esModule",{value:!0}),n);var u=(n,t,e)=>(h6(n,typeof t!="symbol"?t+"":t,e),e);var x=mt(()=>{});var R=mt(()=>{});var D={};G5(D,{_debugEnd:()=>Fn,_debugProcess:()=>Dn,_events:()=>t2,_eventsCount:()=>e2,_exiting:()=>bn,_fatalExceptions:()=>In,_getActiveHandles:()=>An,_getActiveRequests:()=>wn,_kill:()=>xn,_linkedBinding:()=>pn,_maxListeners:()=>$n,_preload_modules:()=>qn,_rawDebug:()=>hn,_startProfilerIdleNotifier:()=>Ln,_stopProfilerIdleNotifier:()=>Un,_tickCallback:()=>zn,abort:()=>Vn,addListener:()=>i2,allowedNodeEnvironmentFlags:()=>Cn,arch:()=>$r,argv:()=>rn,argv0:()=>Jn,assert:()=>Bn,binding:()=>vn,browser:()=>fn,chdir:()=>dn,config:()=>yn,cpuUsage:()=>V5,cwd:()=>cn,debugPort:()=>Kn,default:()=>d2,dlopen:()=>_n,domain:()=>gn,emit:()=>a2,emitWarning:()=>an,env:()=>en,execArgv:()=>nn,execPath:()=>Qn,exit:()=>Tn,features:()=>Pn,hasUncaughtExceptionCaptureCallback:()=>On,hrtime:()=>W5,kill:()=>Mn,listeners:()=>c2,memoryUsage:()=>kn,moduleLoadList:()=>mn,nextTick:()=>qr,off:()=>n2,on:()=>gt,once:()=>r2,openStdin:()=>Sn,pid:()=>jn,platform:()=>tn,ppid:()=>Yn,prependListener:()=>v2,prependOnceListener:()=>l2,reallyExit:()=>En,release:()=>un,removeAllListeners:()=>o2,removeListener:()=>s2,resourceUsage:()=>Rn,setSourceMapsEnabled:()=>Zn,setUncaughtExceptionCaptureCallback:()=>Hn,stderr:()=>Nn,stdin:()=>Wn,stdout:()=>Gn,title:()=>Xr,umask:()=>ln,uptime:()=>Xn,version:()=>sn,versions:()=>on});function ai(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function g6(){!me||!Vt||(me=!1,Vt.length?pt=Vt.concat(pt):N5=-1,pt.length&&Jr())}function Jr(){if(!me){var n=setTimeout(g6,0);me=!0;for(var t=pt.length;t;){for(Vt=pt,pt=[];++N5<t;)Vt&&Vt[N5].run();N5=-1,t=pt.length}Vt=null,me=!1,clearTimeout(n)}}function qr(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];pt.push(new Zr(n,t)),pt.length===1&&!me&&setTimeout(Jr,0)}function Zr(n,t){this.fun=n,this.array=t}function N0(){}function pn(n){ai("_linkedBinding")}function _n(n){ai("dlopen")}function wn(){return[]}function An(){return[]}function Bn(n,t){if(!n)throw new Error(t||"assertion error")}function On(){return!1}function Xn(){return Mt.now()/1e3}function W5(n){var t=Math.floor((Date.now()-Mt.now())*.001),e=Mt.now()*.001,i=Math.floor(e)+t,r=Math.floor(e%1*1e9);return n&&(i=i-n[0],r=r-n[1],r<0&&(i--,r+=oi)),[i,r]}function gt(){return d2}function c2(n){return[]}var pt,me,Vt,N5,Xr,$r,tn,en,rn,nn,sn,on,an,vn,ln,cn,dn,un,fn,hn,mn,gn,bn,yn,En,xn,V5,Rn,kn,Mn,Tn,Sn,Cn,Pn,In,Hn,zn,Dn,Fn,Ln,Un,Gn,Nn,Wn,Vn,jn,Yn,Qn,Kn,Jn,qn,Zn,Mt,si,oi,$n,t2,e2,i2,r2,n2,s2,o2,a2,v2,l2,d2,u2=mt(()=>{x();R();M();k();pt=[],me=!1,N5=-1;Zr.prototype.run=function(){this.fun.apply(null,this.array)};Xr="browser",$r="x64",tn="browser",en={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},rn=["/usr/bin/node"],nn=[],sn="v16.8.0",on={},an=function(n,t){},vn=function(n){ai("binding")},ln=function(n){return 0},cn=function(){return"/"},dn=function(n){},un={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};fn=!0,hn=N0,mn=[];gn={},bn=!1,yn={};En=N0,xn=N0,V5=function(){return{}},Rn=V5,kn=V5,Mn=N0,Tn=N0,Sn=N0,Cn={};Pn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},In=N0,Hn=N0;zn=N0,Dn=N0,Fn=N0,Ln=N0,Un=N0,Gn=void 0,Nn=void 0,Wn=void 0,Vn=N0,jn=2,Yn=1,Qn="/bin/usr/node",Kn=9229,Jn="node",qn=[],Zn=N0,Mt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Mt.now===void 0&&(si=Date.now(),Mt.timing&&Mt.timing.navigationStart&&(si=Mt.timing.navigationStart),Mt.now=()=>Date.now()-si);oi=1e9;W5.bigint=function(n){var t=W5(n);return typeof BigInt>"u"?t[0]*oi+t[1]:BigInt(t[0]*oi)+BigInt(t[1])};$n=10,t2={},e2=0;i2=gt,r2=gt,n2=gt,s2=gt,o2=gt,a2=N0,v2=gt,l2=gt;d2={version:sn,versions:on,arch:$r,platform:tn,browser:fn,release:un,_rawDebug:hn,moduleLoadList:mn,binding:vn,_linkedBinding:pn,_events:t2,_eventsCount:e2,_maxListeners:$n,on:gt,addListener:i2,once:r2,off:n2,removeListener:s2,removeAllListeners:o2,emit:a2,prependListener:v2,prependOnceListener:l2,listeners:c2,domain:gn,_exiting:bn,config:yn,dlopen:_n,uptime:Xn,_getActiveRequests:wn,_getActiveHandles:An,reallyExit:En,_kill:xn,cpuUsage:V5,resourceUsage:Rn,memoryUsage:kn,kill:Mn,exit:Tn,openStdin:Sn,allowedNodeEnvironmentFlags:Cn,assert:Bn,features:Pn,_fatalExceptions:In,setUncaughtExceptionCaptureCallback:Hn,hasUncaughtExceptionCaptureCallback:On,emitWarning:an,nextTick:qr,_tickCallback:zn,_debugProcess:Dn,_debugEnd:Fn,_startProfilerIdleNotifier:Ln,_stopProfilerIdleNotifier:Un,stdout:Gn,stdin:Wn,stderr:Nn,abort:Vn,umask:ln,chdir:dn,cwd:cn,env:en,title:Xr,argv:rn,execArgv:nn,pid:jn,ppid:Yn,execPath:Qn,debugPort:Kn,hrtime:W5,argv0:Jn,_preload_modules:qn,setSourceMapsEnabled:Zn}});var k=mt(()=>{u2()});function b6(){if(f2)return Je;f2=!0,Je.byteLength=a,Je.toByteArray=l,Je.fromByteArray=f;for(var n=[],t=[],e=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,s=i.length;r<s;++r)n[r]=i[r],t[i.charCodeAt(r)]=r;t[45]=62,t[95]=63;function o(m){var g=m.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=m.indexOf("=");b===-1&&(b=g);var A=b===g?0:4-b%4;return[b,A]}function a(m){var g=o(m),b=g[0],A=g[1];return(b+A)*3/4-A}function v(m,g,b){return(g+b)*3/4-b}function l(m){var g,b=o(m),A=b[0],_=b[1],w=new e(v(m,A,_)),T=0,S=_>0?A-4:A,C;for(C=0;C<S;C+=4)g=t[m.charCodeAt(C)]<<18|t[m.charCodeAt(C+1)]<<12|t[m.charCodeAt(C+2)]<<6|t[m.charCodeAt(C+3)],w[T++]=g>>16&255,w[T++]=g>>8&255,w[T++]=g&255;return _===2&&(g=t[m.charCodeAt(C)]<<2|t[m.charCodeAt(C+1)]>>4,w[T++]=g&255),_===1&&(g=t[m.charCodeAt(C)]<<10|t[m.charCodeAt(C+1)]<<4|t[m.charCodeAt(C+2)]>>2,w[T++]=g>>8&255,w[T++]=g&255),w}function c(m){return n[m>>18&63]+n[m>>12&63]+n[m>>6&63]+n[m&63]}function d(m,g,b){for(var A,_=[],w=g;w<b;w+=3)A=(m[w]<<16&16711680)+(m[w+1]<<8&65280)+(m[w+2]&255),_.push(c(A));return _.join("")}function f(m){for(var g,b=m.length,A=b%3,_=[],w=16383,T=0,S=b-A;T<S;T+=w)_.push(d(m,T,T+w>S?S:T+w));return A===1?(g=m[b-1],_.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(m[b-2]<<8)+m[b-1],_.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),_.join("")}return Je}function y6(){if(h2)return j5;h2=!0;return j5.read=function(n,t,e,i,r){var s,o,a=r*8-i-1,v=(1<<a)-1,l=v>>1,c=-7,d=e?r-1:0,f=e?-1:1,m=n[t+d];for(d+=f,s=m&(1<<-c)-1,m>>=-c,c+=a;c>0;s=s*256+n[t+d],d+=f,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=i;c>0;o=o*256+n[t+d],d+=f,c-=8);if(s===0)s=1-l;else{if(s===v)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-l}return(m?-1:1)*o*Math.pow(2,s-i)},j5.write=function(n,t,e,i,r,s){var o,a,v,l=s*8-r-1,c=(1<<l)-1,d=c>>1,f=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:s-1,g=i?1:-1,b=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(v=Math.pow(2,-o))<1&&(o--,v*=2),o+d>=1?t+=f/v:t+=f*Math.pow(2,1-d),t*v>=2&&(o++,v/=2),o+d>=c?(a=0,o=c):o+d>=1?(a=(t*v-1)*Math.pow(2,r),o=o+d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;n[e+m]=a&255,m+=g,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;n[e+m]=o&255,m+=g,o/=256,l-=8);n[e+m-g]|=b*128},j5}function p2(){if(m2)return jt;m2=!0;let n=b6(),t=y6(),e=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;jt.Buffer=o,jt.SlowBuffer=_,jt.INSPECT_MAX_BYTES=50;let i=2147483647;jt.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=r(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u";function r(){try{let y=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(y,h),y.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(y){if(y>i)throw new RangeError('The value "'+y+'" is invalid for option "size"');let h=new Uint8Array(y);return Object.setPrototypeOf(h,o.prototype),h}function o(y,h,p){if(typeof y=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(y)}return a(y,h,p)}o.poolSize=8192;function a(y,h,p){if(typeof y=="string")return d(y,h);if(ArrayBuffer.isView(y))return m(y);if(y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y);if(T0(y,ArrayBuffer)||y&&T0(y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(T0(y,SharedArrayBuffer)||y&&T0(y.buffer,SharedArrayBuffer)))return g(y,h,p);if(typeof y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let E=y.valueOf&&y.valueOf();if(E!=null&&E!==y)return o.from(E,h,p);let B=b(y);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof y[Symbol.toPrimitive]=="function")return o.from(y[Symbol.toPrimitive]("string"),h,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y)}o.from=function(y,h,p){return a(y,h,p)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function v(y){if(typeof y!="number")throw new TypeError('"size" argument must be of type number');if(y<0)throw new RangeError('The value "'+y+'" is invalid for option "size"')}function l(y,h,p){return v(y),y<=0?s(y):h!==void 0?typeof p=="string"?s(y).fill(h,p):s(y).fill(h):s(y)}o.alloc=function(y,h,p){return l(y,h,p)};function c(y){return v(y),s(y<0?0:A(y)|0)}o.allocUnsafe=function(y){return c(y)},o.allocUnsafeSlow=function(y){return c(y)};function d(y,h){if((typeof h!="string"||h==="")&&(h="utf8"),!o.isEncoding(h))throw new TypeError("Unknown encoding: "+h);let p=w(y,h)|0,E=s(p),B=E.write(y,h);return B!==p&&(E=E.slice(0,B)),E}function f(y){let h=y.length<0?0:A(y.length)|0,p=s(h);for(let E=0;E<h;E+=1)p[E]=y[E]&255;return p}function m(y){if(T0(y,Uint8Array)){let h=new Uint8Array(y);return g(h.buffer,h.byteOffset,h.byteLength)}return f(y)}function g(y,h,p){if(h<0||y.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(y.byteLength<h+(p||0))throw new RangeError('"length" is outside of buffer bounds');let E;return h===void 0&&p===void 0?E=new Uint8Array(y):p===void 0?E=new Uint8Array(y,h):E=new Uint8Array(y,h,p),Object.setPrototypeOf(E,o.prototype),E}function b(y){if(o.isBuffer(y)){let h=A(y.length)|0,p=s(h);return p.length===0||y.copy(p,0,0,h),p}if(y.length!==void 0)return typeof y.length!="number"||fe(y.length)?s(0):f(y);if(y.type==="Buffer"&&Array.isArray(y.data))return f(y.data)}function A(y){if(y>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return y|0}function _(y){return+y!=y&&(y=0),o.alloc(+y)}o.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==o.prototype},o.compare=function(h,p){if(T0(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),T0(p,Uint8Array)&&(p=o.from(p,p.offset,p.byteLength)),!o.isBuffer(h)||!o.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===p)return 0;let E=h.length,B=p.length;for(let z=0,G=Math.min(E,B);z<G;++z)if(h[z]!==p[z]){E=h[z],B=p[z];break}return E<B?-1:B<E?1:0},o.isEncoding=function(h){switch(String(h).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(h,p){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return o.alloc(0);let E;if(p===void 0)for(p=0,E=0;E<h.length;++E)p+=h[E].length;let B=o.allocUnsafe(p),z=0;for(E=0;E<h.length;++E){let G=h[E];if(T0(G,Uint8Array))z+G.length>B.length?(o.isBuffer(G)||(G=o.from(G)),G.copy(B,z)):Uint8Array.prototype.set.call(B,G,z);else if(o.isBuffer(G))G.copy(B,z);else throw new TypeError('"list" argument must be an Array of Buffers');z+=G.length}return B};function w(y,h){if(o.isBuffer(y))return y.length;if(ArrayBuffer.isView(y)||T0(y,ArrayBuffer))return y.byteLength;if(typeof y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof y);let p=y.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&p===0)return 0;let B=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return ue(y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return ni(y).length;default:if(B)return E?-1:ue(y).length;h=(""+h).toLowerCase(),B=!0}}o.byteLength=w;function T(y,h,p){let E=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,h>>>=0,p<=h))return"";for(y||(y="utf8");;)switch(y){case"hex":return p0(this,h,p);case"utf8":case"utf-8":return $(this,h,p);case"ascii":return l0(this,h,p);case"latin1":case"binary":return m0(this,h,p);case"base64":return q(this,h,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w0(this,h,p);default:if(E)throw new TypeError("Unknown encoding: "+y);y=(y+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function S(y,h,p){let E=y[h];y[h]=y[p],y[p]=E}o.prototype.swap16=function(){let h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<h;p+=2)S(this,p,p+1);return this},o.prototype.swap32=function(){let h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<h;p+=4)S(this,p,p+3),S(this,p+1,p+2);return this},o.prototype.swap64=function(){let h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<h;p+=8)S(this,p,p+7),S(this,p+1,p+6),S(this,p+2,p+5),S(this,p+3,p+4);return this},o.prototype.toString=function(){let h=this.length;return h===0?"":arguments.length===0?$(this,0,h):T.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(h){if(!o.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:o.compare(this,h)===0},o.prototype.inspect=function(){let h="",p=jt.INSPECT_MAX_BYTES;return h=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(h+=" ... "),"<Buffer "+h+">"},e&&(o.prototype[e]=o.prototype.inspect),o.prototype.compare=function(h,p,E,B,z){if(T0(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),!o.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(p===void 0&&(p=0),E===void 0&&(E=h?h.length:0),B===void 0&&(B=0),z===void 0&&(z=this.length),p<0||E>h.length||B<0||z>this.length)throw new RangeError("out of range index");if(B>=z&&p>=E)return 0;if(B>=z)return-1;if(p>=E)return 1;if(p>>>=0,E>>>=0,B>>>=0,z>>>=0,this===h)return 0;let G=z-B,r0=E-p,b0=Math.min(G,r0),f0=this.slice(B,z),h0=h.slice(p,E);for(let c0=0;c0<b0;++c0)if(f0[c0]!==h0[c0]){G=f0[c0],r0=h0[c0];break}return G<r0?-1:r0<G?1:0};function C(y,h,p,E,B){if(y.length===0)return-1;if(typeof p=="string"?(E=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,fe(p)&&(p=B?0:y.length-1),p<0&&(p=y.length+p),p>=y.length){if(B)return-1;p=y.length-1}else if(p<0)if(B)p=0;else return-1;if(typeof h=="string"&&(h=o.from(h,E)),o.isBuffer(h))return h.length===0?-1:H(y,h,p,E,B);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(y,h,p):Uint8Array.prototype.lastIndexOf.call(y,h,p):H(y,[h],p,E,B);throw new TypeError("val must be string, number or Buffer")}function H(y,h,p,E,B){let z=1,G=y.length,r0=h.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(y.length<2||h.length<2)return-1;z=2,G/=2,r0/=2,p/=2}function b0(h0,c0){return z===1?h0[c0]:h0.readUInt16BE(c0*z)}let f0;if(B){let h0=-1;for(f0=p;f0<G;f0++)if(b0(y,f0)===b0(h,h0===-1?0:f0-h0)){if(h0===-1&&(h0=f0),f0-h0+1===r0)return h0*z}else h0!==-1&&(f0-=f0-h0),h0=-1}else for(p+r0>G&&(p=G-r0),f0=p;f0>=0;f0--){let h0=!0;for(let c0=0;c0<r0;c0++)if(b0(y,f0+c0)!==b0(h,c0)){h0=!1;break}if(h0)return f0}return-1}o.prototype.includes=function(h,p,E){return this.indexOf(h,p,E)!==-1},o.prototype.indexOf=function(h,p,E){return C(this,h,p,E,!0)},o.prototype.lastIndexOf=function(h,p,E){return C(this,h,p,E,!1)};function P(y,h,p,E){p=Number(p)||0;let B=y.length-p;E?(E=Number(E),E>B&&(E=B)):E=B;let z=h.length;E>z/2&&(E=z/2);let G;for(G=0;G<E;++G){let r0=parseInt(h.substr(G*2,2),16);if(fe(r0))return G;y[p+G]=r0}return G}function I(y,h,p,E){return q0(ue(h,y.length-p),y,p,E)}function N(y,h,p,E){return q0(L5(h),y,p,E)}function O(y,h,p,E){return q0(ni(h),y,p,E)}function j(y,h,p,E){return q0(U5(h,y.length-p),y,p,E)}o.prototype.write=function(h,p,E,B){if(p===void 0)B="utf8",E=this.length,p=0;else if(E===void 0&&typeof p=="string")B=p,E=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(E)?(E=E>>>0,B===void 0&&(B="utf8")):(B=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let z=this.length-p;if((E===void 0||E>z)&&(E=z),h.length>0&&(E<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let G=!1;for(;;)switch(B){case"hex":return P(this,h,p,E);case"utf8":case"utf-8":return I(this,h,p,E);case"ascii":case"latin1":case"binary":return N(this,h,p,E);case"base64":return O(this,h,p,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,h,p,E);default:if(G)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),G=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(y,h,p){return h===0&&p===y.length?n.fromByteArray(y):n.fromByteArray(y.slice(h,p))}function $(y,h,p){p=Math.min(y.length,p);let E=[],B=h;for(;B<p;){let z=y[B],G=null,r0=z>239?4:z>223?3:z>191?2:1;if(B+r0<=p){let b0,f0,h0,c0;switch(r0){case 1:z<128&&(G=z);break;case 2:b0=y[B+1],(b0&192)===128&&(c0=(z&31)<<6|b0&63,c0>127&&(G=c0));break;case 3:b0=y[B+1],f0=y[B+2],(b0&192)===128&&(f0&192)===128&&(c0=(z&15)<<12|(b0&63)<<6|f0&63,c0>2047&&(c0<55296||c0>57343)&&(G=c0));break;case 4:b0=y[B+1],f0=y[B+2],h0=y[B+3],(b0&192)===128&&(f0&192)===128&&(h0&192)===128&&(c0=(z&15)<<18|(b0&63)<<12|(f0&63)<<6|h0&63,c0>65535&&c0<1114112&&(G=c0))}}G===null?(G=65533,r0=1):G>65535&&(G-=65536,E.push(G>>>10&1023|55296),G=56320|G&1023),E.push(G),B+=r0}return d0(E)}let e0=4096;function d0(y){let h=y.length;if(h<=e0)return String.fromCharCode.apply(String,y);let p="",E=0;for(;E<h;)p+=String.fromCharCode.apply(String,y.slice(E,E+=e0));return p}function l0(y,h,p){let E="";p=Math.min(y.length,p);for(let B=h;B<p;++B)E+=String.fromCharCode(y[B]&127);return E}function m0(y,h,p){let E="";p=Math.min(y.length,p);for(let B=h;B<p;++B)E+=String.fromCharCode(y[B]);return E}function p0(y,h,p){let E=y.length;(!h||h<0)&&(h=0),(!p||p<0||p>E)&&(p=E);let B="";for(let z=h;z<p;++z)B+=Ye[y[z]];return B}function w0(y,h,p){let E=y.slice(h,p),B="";for(let z=0;z<E.length-1;z+=2)B+=String.fromCharCode(E[z]+E[z+1]*256);return B}o.prototype.slice=function(h,p){let E=this.length;h=~~h,p=p===void 0?E:~~p,h<0?(h+=E,h<0&&(h=0)):h>E&&(h=E),p<0?(p+=E,p<0&&(p=0)):p>E&&(p=E),p<h&&(p=h);let B=this.subarray(h,p);return Object.setPrototypeOf(B,o.prototype),B};function n0(y,h,p){if(y%1!==0||y<0)throw new RangeError("offset is not uint");if(y+h>p)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(h,p,E){h=h>>>0,p=p>>>0,E||n0(h,p,this.length);let B=this[h],z=1,G=0;for(;++G<p&&(z*=256);)B+=this[h+G]*z;return B},o.prototype.readUintBE=o.prototype.readUIntBE=function(h,p,E){h=h>>>0,p=p>>>0,E||n0(h,p,this.length);let B=this[h+--p],z=1;for(;p>0&&(z*=256);)B+=this[h+--p]*z;return B},o.prototype.readUint8=o.prototype.readUInt8=function(h,p){return h=h>>>0,p||n0(h,1,this.length),this[h]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(h,p){return h=h>>>0,p||n0(h,2,this.length),this[h]|this[h+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(h,p){return h=h>>>0,p||n0(h,2,this.length),this[h]<<8|this[h+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},o.prototype.readBigUInt64LE=rt(function(h){h=h>>>0,kt(h,"offset");let p=this[h],E=this[h+7];(p===void 0||E===void 0)&&Nt(h,this.length-8);let B=p+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,z=this[++h]+this[++h]*2**8+this[++h]*2**16+E*2**24;return BigInt(B)+(BigInt(z)<<BigInt(32))}),o.prototype.readBigUInt64BE=rt(function(h){h=h>>>0,kt(h,"offset");let p=this[h],E=this[h+7];(p===void 0||E===void 0)&&Nt(h,this.length-8);let B=p*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],z=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+E;return(BigInt(B)<<BigInt(32))+BigInt(z)}),o.prototype.readIntLE=function(h,p,E){h=h>>>0,p=p>>>0,E||n0(h,p,this.length);let B=this[h],z=1,G=0;for(;++G<p&&(z*=256);)B+=this[h+G]*z;return z*=128,B>=z&&(B-=Math.pow(2,8*p)),B},o.prototype.readIntBE=function(h,p,E){h=h>>>0,p=p>>>0,E||n0(h,p,this.length);let B=p,z=1,G=this[h+--B];for(;B>0&&(z*=256);)G+=this[h+--B]*z;return z*=128,G>=z&&(G-=Math.pow(2,8*p)),G},o.prototype.readInt8=function(h,p){return h=h>>>0,p||n0(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},o.prototype.readInt16LE=function(h,p){h=h>>>0,p||n0(h,2,this.length);let E=this[h]|this[h+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(h,p){h=h>>>0,p||n0(h,2,this.length);let E=this[h+1]|this[h]<<8;return E&32768?E|4294901760:E},o.prototype.readInt32LE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},o.prototype.readInt32BE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},o.prototype.readBigInt64LE=rt(function(h){h=h>>>0,kt(h,"offset");let p=this[h],E=this[h+7];(p===void 0||E===void 0)&&Nt(h,this.length-8);let B=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(E<<24);return(BigInt(B)<<BigInt(32))+BigInt(p+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),o.prototype.readBigInt64BE=rt(function(h){h=h>>>0,kt(h,"offset");let p=this[h],E=this[h+7];(p===void 0||E===void 0)&&Nt(h,this.length-8);let B=(p<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(B)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+E)}),o.prototype.readFloatLE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),t.read(this,h,!0,23,4)},o.prototype.readFloatBE=function(h,p){return h=h>>>0,p||n0(h,4,this.length),t.read(this,h,!1,23,4)},o.prototype.readDoubleLE=function(h,p){return h=h>>>0,p||n0(h,8,this.length),t.read(this,h,!0,52,8)},o.prototype.readDoubleBE=function(h,p){return h=h>>>0,p||n0(h,8,this.length),t.read(this,h,!1,52,8)};function Y(y,h,p,E,B,z){if(!o.isBuffer(y))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>B||h<z)throw new RangeError('"value" argument is out of bounds');if(p+E>y.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(h,p,E,B){if(h=+h,p=p>>>0,E=E>>>0,!B){let r0=Math.pow(2,8*E)-1;Y(this,h,p,E,r0,0)}let z=1,G=0;for(this[p]=h&255;++G<E&&(z*=256);)this[p+G]=h/z&255;return p+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(h,p,E,B){if(h=+h,p=p>>>0,E=E>>>0,!B){let r0=Math.pow(2,8*E)-1;Y(this,h,p,E,r0,0)}let z=E-1,G=1;for(this[p+z]=h&255;--z>=0&&(G*=256);)this[p+z]=h/G&255;return p+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,1,255,0),this[p]=h&255,p+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,2,65535,0),this[p]=h&255,this[p+1]=h>>>8,p+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,2,65535,0),this[p]=h>>>8,this[p+1]=h&255,p+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,4,4294967295,0),this[p+3]=h>>>24,this[p+2]=h>>>16,this[p+1]=h>>>8,this[p]=h&255,p+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,4,4294967295,0),this[p]=h>>>24,this[p+1]=h>>>16,this[p+2]=h>>>8,this[p+3]=h&255,p+4};function o0(y,h,p,E,B){Gt(h,E,B,y,p,7);let z=Number(h&BigInt(4294967295));y[p++]=z,z=z>>8,y[p++]=z,z=z>>8,y[p++]=z,z=z>>8,y[p++]=z;let G=Number(h>>BigInt(32)&BigInt(4294967295));return y[p++]=G,G=G>>8,y[p++]=G,G=G>>8,y[p++]=G,G=G>>8,y[p++]=G,p}function g0(y,h,p,E,B){Gt(h,E,B,y,p,7);let z=Number(h&BigInt(4294967295));y[p+7]=z,z=z>>8,y[p+6]=z,z=z>>8,y[p+5]=z,z=z>>8,y[p+4]=z;let G=Number(h>>BigInt(32)&BigInt(4294967295));return y[p+3]=G,G=G>>8,y[p+2]=G,G=G>>8,y[p+1]=G,G=G>>8,y[p]=G,p+8}o.prototype.writeBigUInt64LE=rt(function(h,p=0){return o0(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=rt(function(h,p=0){return g0(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(h,p,E,B){if(h=+h,p=p>>>0,!B){let b0=Math.pow(2,8*E-1);Y(this,h,p,E,b0-1,-b0)}let z=0,G=1,r0=0;for(this[p]=h&255;++z<E&&(G*=256);)h<0&&r0===0&&this[p+z-1]!==0&&(r0=1),this[p+z]=(h/G>>0)-r0&255;return p+E},o.prototype.writeIntBE=function(h,p,E,B){if(h=+h,p=p>>>0,!B){let b0=Math.pow(2,8*E-1);Y(this,h,p,E,b0-1,-b0)}let z=E-1,G=1,r0=0;for(this[p+z]=h&255;--z>=0&&(G*=256);)h<0&&r0===0&&this[p+z+1]!==0&&(r0=1),this[p+z]=(h/G>>0)-r0&255;return p+E},o.prototype.writeInt8=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,1,127,-128),h<0&&(h=255+h+1),this[p]=h&255,p+1},o.prototype.writeInt16LE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,2,32767,-32768),this[p]=h&255,this[p+1]=h>>>8,p+2},o.prototype.writeInt16BE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,2,32767,-32768),this[p]=h>>>8,this[p+1]=h&255,p+2},o.prototype.writeInt32LE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,4,2147483647,-2147483648),this[p]=h&255,this[p+1]=h>>>8,this[p+2]=h>>>16,this[p+3]=h>>>24,p+4},o.prototype.writeInt32BE=function(h,p,E){return h=+h,p=p>>>0,E||Y(this,h,p,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[p]=h>>>24,this[p+1]=h>>>16,this[p+2]=h>>>8,this[p+3]=h&255,p+4},o.prototype.writeBigInt64LE=rt(function(h,p=0){return o0(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=rt(function(h,p=0){return g0(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function L0(y,h,p,E,B,z){if(p+E>y.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function H0(y,h,p,E,B){return h=+h,p=p>>>0,B||L0(y,h,p,4),t.write(y,h,p,E,23,4),p+4}o.prototype.writeFloatLE=function(h,p,E){return H0(this,h,p,!0,E)},o.prototype.writeFloatBE=function(h,p,E){return H0(this,h,p,!1,E)};function X0(y,h,p,E,B){return h=+h,p=p>>>0,B||L0(y,h,p,8),t.write(y,h,p,E,52,8),p+8}o.prototype.writeDoubleLE=function(h,p,E){return X0(this,h,p,!0,E)},o.prototype.writeDoubleBE=function(h,p,E){return X0(this,h,p,!1,E)},o.prototype.copy=function(h,p,E,B){if(!o.isBuffer(h))throw new TypeError("argument should be a Buffer");if(E||(E=0),!B&&B!==0&&(B=this.length),p>=h.length&&(p=h.length),p||(p=0),B>0&&B<E&&(B=E),B===E||h.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),h.length-p<B-E&&(B=h.length-p+E);let z=B-E;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,E,B):Uint8Array.prototype.set.call(h,this.subarray(E,B),p),z},o.prototype.fill=function(h,p,E,B){if(typeof h=="string"){if(typeof p=="string"?(B=p,p=0,E=this.length):typeof E=="string"&&(B=E,E=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!o.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(h.length===1){let G=h.charCodeAt(0);(B==="utf8"&&G<128||B==="latin1")&&(h=G)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(p<0||this.length<p||this.length<E)throw new RangeError("Out of range index");if(E<=p)return this;p=p>>>0,E=E===void 0?this.length:E>>>0,h||(h=0);let z;if(typeof h=="number")for(z=p;z<E;++z)this[z]=h;else{let G=o.isBuffer(h)?h:o.from(h,B),r0=G.length;if(r0===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(z=0;z<E-p;++z)this[z+p]=G[z%r0]}return this};let u0={};function vt(y,h,p){u0[y]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${y}]`,this.stack,delete this.name}get code(){return y}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${y}]: ${this.message}`}}}vt("ERR_BUFFER_OUT_OF_BOUNDS",function(y){return y?`${y} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),vt("ERR_INVALID_ARG_TYPE",function(y,h){return`The "${y}" argument must be of type number. Received type ${typeof h}`},TypeError),vt("ERR_OUT_OF_RANGE",function(y,h,p){let E=`The value of "${y}" is out of range.`,B=p;return Number.isInteger(p)&&Math.abs(p)>2**32?B=Ve(String(p)):typeof p=="bigint"&&(B=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(B=Ve(B)),B+="n"),E+=` It must be ${h}. Received ${B}`,E},RangeError);function Ve(y){let h="",p=y.length,E=y[0]==="-"?1:0;for(;p>=E+4;p-=3)h=`_${y.slice(p-3,p)}${h}`;return`${y.slice(0,p)}${h}`}function je(y,h,p){kt(h,"offset"),(y[h]===void 0||y[h+p]===void 0)&&Nt(h,y.length-(p+1))}function Gt(y,h,p,E,B,z){if(y>p||y<h){let G=typeof h=="bigint"?"n":"",r0;throw h===0||h===BigInt(0)?r0=`>= 0${G} and < 2${G} ** ${(z+1)*8}${G}`:r0=`>= -(2${G} ** ${(z+1)*8-1}${G}) and < 2 ** ${(z+1)*8-1}${G}`,new u0.ERR_OUT_OF_RANGE("value",r0,y)}je(E,B,z)}function kt(y,h){if(typeof y!="number")throw new u0.ERR_INVALID_ARG_TYPE(h,"number",y)}function Nt(y,h,p){throw Math.floor(y)!==y?(kt(y,p),new u0.ERR_OUT_OF_RANGE("offset","an integer",y)):h<0?new u0.ERR_BUFFER_OUT_OF_BOUNDS:new u0.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${h}`,y)}let F5=/[^+/0-9A-Za-z-_]/g;function Wt(y){if(y=y.split("=")[0],y=y.trim().replace(F5,""),y.length<2)return"";for(;y.length%4!==0;)y=y+"=";return y}function ue(y,h){h=h||1/0;let p,E=y.length,B=null,z=[];for(let G=0;G<E;++G){if(p=y.charCodeAt(G),p>55295&&p<57344){if(!B){if(p>56319){(h-=3)>-1&&z.push(239,191,189);continue}else if(G+1===E){(h-=3)>-1&&z.push(239,191,189);continue}B=p;continue}if(p<56320){(h-=3)>-1&&z.push(239,191,189),B=p;continue}p=(B-55296<<10|p-56320)+65536}else B&&(h-=3)>-1&&z.push(239,191,189);if(B=null,p<128){if((h-=1)<0)break;z.push(p)}else if(p<2048){if((h-=2)<0)break;z.push(p>>6|192,p&63|128)}else if(p<65536){if((h-=3)<0)break;z.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((h-=4)<0)break;z.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return z}function L5(y){let h=[];for(let p=0;p<y.length;++p)h.push(y.charCodeAt(p)&255);return h}function U5(y,h){let p,E,B,z=[];for(let G=0;G<y.length&&!((h-=2)<0);++G)p=y.charCodeAt(G),E=p>>8,B=p%256,z.push(B),z.push(E);return z}function ni(y){return n.toByteArray(Wt(y))}function q0(y,h,p,E){let B;for(B=0;B<E&&!(B+p>=h.length||B>=y.length);++B)h[B+p]=y[B];return B}function T0(y,h){return y instanceof h||y!=null&&y.constructor!=null&&y.constructor.name!=null&&y.constructor.name===h.name}function fe(y){return y!==y}let Ye=function(){let y="0123456789abcdef",h=new Array(256);for(let p=0;p<16;++p){let E=p*16;for(let B=0;B<16;++B)h[E+B]=y[p]+y[B]}return h}();function rt(y){return typeof BigInt>"u"?he:y}function he(){throw new Error("BigInt not supported")}return jt}var Je,f2,j5,h2,jt,m2,g2=mt(()=>{x();R();M();k();Je={},f2=!1;j5={},h2=!1;jt={},m2=!1});var Yt,F,K9,J9,b2=mt(()=>{x();R();M();k();g2();Yt=p2();Yt.Buffer;Yt.SlowBuffer;Yt.INSPECT_MAX_BYTES;Yt.kMaxLength;F=Yt.Buffer,K9=Yt.INSPECT_MAX_BYTES,J9=Yt.kMaxLength});var M=mt(()=>{b2()});var j2=et((Ai,Ei)=>{x();R();M();k();(function(n,t){typeof Ai=="object"&&typeof Ei<"u"?Ei.exports=t():typeof define=="function"&&define.amd?define(t):n.Stats=t()})(Ai,function(){var n=function(){function t(d){return r.appendChild(d.dom),d}function e(d){for(var f=0;f<r.children.length;f++)r.children[f].style.display=f===d?"block":"none";i=d}var i=0,r=document.createElement("div");r.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",r.addEventListener("click",function(d){d.preventDefault(),e(++i%r.children.length)},!1);var s=(performance||Date).now(),o=s,a=0,v=t(new n.Panel("FPS","#0ff","#002")),l=t(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new n.Panel("MB","#f08","#201"));return e(0),{REVISION:16,dom:r,addPanel:t,showPanel:e,begin:function(){s=(performance||Date).now()},end:function(){a++;var d=(performance||Date).now();if(l.update(d-s,200),d>o+1e3&&(v.update(1e3*a/(d-o),100),o=d,a=0,c)){var f=performance.memory;c.update(f.usedJSHeapSize/1048576,f.jsHeapSizeLimit/1048576)}return d},update:function(){s=this.end()},domElement:r,setMode:e}};return n.Panel=function(t,e,i){var r=1/0,s=0,o=Math.round,a=o(window.devicePixelRatio||1),v=80*a,l=48*a,c=3*a,d=2*a,f=3*a,m=15*a,g=74*a,b=30*a,A=document.createElement("canvas");A.width=v,A.height=l,A.style.cssText="width:80px;height:48px";var _=A.getContext("2d");return _.font="bold "+9*a+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=i,_.fillRect(0,0,v,l),_.fillStyle=e,_.fillText(t,c,d),_.fillRect(f,m,g,b),_.fillStyle=i,_.globalAlpha=.9,_.fillRect(f,m,g,b),{dom:A,update:function(w,T){r=Math.min(r,w),s=Math.max(s,w),_.fillStyle=i,_.globalAlpha=1,_.fillRect(0,0,v,m),_.fillStyle=e,_.fillText(o(w)+" "+t+" ("+o(r)+"-"+o(s)+")",c,d),_.drawImage(A,f+a,m,g-a,b,f,m,g-a,b),_.fillRect(f+g-a,m,a,b),_.fillStyle=i,_.globalAlpha=.9,_.fillRect(f+g-a,m,a,o((1-w/T)*b))}}},n})});var l3=et((v3,b1)=>{x();R();M();k();(function(n,t){typeof b1=="object"&&b1.exports?b1.exports=t():n.nearley=t()})(v3,function(){function n(v,l,c){return this.id=++n.highestId,this.name=v,this.symbols=l,this.postprocess=c,this}n.highestId=0,n.prototype.toString=function(v){var l=typeof v>"u"?this.symbols.map(a).join(" "):this.symbols.slice(0,v).map(a).join(" ")+" \u25CF "+this.symbols.slice(v).map(a).join(" ");return this.name+" \u2192 "+l};function t(v,l,c,d){this.rule=v,this.dot=l,this.reference=c,this.data=[],this.wantedBy=d,this.isComplete=this.dot===v.symbols.length}t.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},t.prototype.nextState=function(v){var l=new t(this.rule,this.dot+1,this.reference,this.wantedBy);return l.left=this,l.right=v,l.isComplete&&(l.data=l.build(),l.right=void 0),l},t.prototype.build=function(){var v=[],l=this;do v.push(l.right.data),l=l.left;while(l.left);return v.reverse(),v},t.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function e(v,l){this.grammar=v,this.index=l,this.states=[],this.wants={},this.scannable=[],this.completed={}}e.prototype.process=function(v){for(var l=this.states,c=this.wants,d=this.completed,f=0;f<l.length;f++){var m=l[f];if(m.isComplete){if(m.finish(),m.data!==s.fail){for(var g=m.wantedBy,b=g.length;b--;){var A=g[b];this.complete(A,m)}if(m.reference===this.index){var _=m.rule.name;(this.completed[_]=this.completed[_]||[]).push(m)}}}else{var _=m.rule.symbols[m.dot];if(typeof _!="string"){this.scannable.push(m);continue}if(c[_]){if(c[_].push(m),d.hasOwnProperty(_))for(var w=d[_],b=0;b<w.length;b++){var T=w[b];this.complete(m,T)}}else c[_]=[m],this.predict(_)}}},e.prototype.predict=function(v){for(var l=this.grammar.byName[v]||[],c=0;c<l.length;c++){var d=l[c],f=this.wants[v],m=new t(d,0,this.index,f);this.states.push(m)}},e.prototype.complete=function(v,l){var c=v.nextState(l);this.states.push(c)};function i(v,l){this.rules=v,this.start=l||this.rules[0].name;var c=this.byName={};this.rules.forEach(function(d){c.hasOwnProperty(d.name)||(c[d.name]=[]),c[d.name].push(d)})}i.fromCompiled=function(d,l){var c=d.Lexer;d.ParserStart&&(l=d.ParserStart,d=d.ParserRules);var d=d.map(function(m){return new n(m.name,m.symbols,m.postprocess)}),f=new i(d,l);return f.lexer=c,f};function r(){this.reset("")}r.prototype.reset=function(v,l){this.buffer=v,this.index=0,this.line=l?l.line:1,this.lastLineBreak=l?-l.col:0},r.prototype.next=function(){if(this.index<this.buffer.length){var v=this.buffer[this.index++];return v===`
|
|
2
2
|
`&&(this.line+=1,this.lastLineBreak=this.index),{value:v}}},r.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},r.prototype.formatError=function(v,l){var c=this.buffer;if(typeof c=="string"){var d=c.split(`
|
|
3
3
|
`).slice(Math.max(0,this.line-5),this.line),f=c.indexOf(`
|
|
4
4
|
`,this.index);f===-1&&(f=c.length);var m=this.index-this.lastLineBreak,g=String(this.line).length;return l+=" at line "+this.line+" col "+m+`:
|
|
@@ -6,14 +6,14 @@ var v6=Object.create;var Ye=Object.defineProperty;var l6=Object.getOwnPropertyDe
|
|
|
6
6
|
`,l+=d.map(function(A,_){return b(this.line-d.length+_+1,g)+" "+A},this).join(`
|
|
7
7
|
`),l+=`
|
|
8
8
|
`+b("",g+m)+`^
|
|
9
|
-
`,l}else return l+" at index "+(this.index-1);function b(A,_){var w=String(A);return Array(_-w.length+1).join(" ")+w}};function s(v,l,c){if(v instanceof i)var d=v,c=l;else var d=i.fromCompiled(v,l);this.grammar=d,this.options={keepHistory:!1,lexer:d.lexer||new r};for(var f in c||{})this.options[f]=c[f];this.lexer=this.options.lexer,this.lexerState=void 0;var m=new e(d,0),g=this.table=[m];m.wants[d.start]=[],m.predict(d.start),m.process(),this.current=0}s.fail={},s.prototype.feed=function(v){var l=this.lexer;l.reset(v,this.lexerState);for(var c;;){try{if(c=l.next(),!c)break}catch(H){var g=new e(this.grammar,this.current+1);this.table.push(g);var d=new Error(this.reportLexerError(H));throw d.offset=this.current,d.token=H.token,d}var f=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var m=this.current+1,g=new e(this.grammar,m);this.table.push(g);for(var b=c.text!==void 0?c.text:c.value,A=l.constructor===r?c.value:c,_=f.scannable,w=_.length;w--;){var
|
|
9
|
+
`,l}else return l+" at index "+(this.index-1);function b(A,_){var w=String(A);return Array(_-w.length+1).join(" ")+w}};function s(v,l,c){if(v instanceof i)var d=v,c=l;else var d=i.fromCompiled(v,l);this.grammar=d,this.options={keepHistory:!1,lexer:d.lexer||new r};for(var f in c||{})this.options[f]=c[f];this.lexer=this.options.lexer,this.lexerState=void 0;var m=new e(d,0),g=this.table=[m];m.wants[d.start]=[],m.predict(d.start),m.process(),this.current=0}s.fail={},s.prototype.feed=function(v){var l=this.lexer;l.reset(v,this.lexerState);for(var c;;){try{if(c=l.next(),!c)break}catch(H){var g=new e(this.grammar,this.current+1);this.table.push(g);var d=new Error(this.reportLexerError(H));throw d.offset=this.current,d.token=H.token,d}var f=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var m=this.current+1,g=new e(this.grammar,m);this.table.push(g);for(var b=c.text!==void 0?c.text:c.value,A=l.constructor===r?c.value:c,_=f.scannable,w=_.length;w--;){var T=_[w],S=T.rule.symbols[T.dot];if(S.test?S.test(A):S.type?S.type===c.type:S.literal===b){var C=T.nextState({data:A,token:c,isToken:!0,reference:m-1});g.states.push(C)}}if(g.process(),g.states.length===0){var d=new Error(this.reportError(c));throw d.offset=this.current,d.token=c,d}this.options.keepHistory&&(f.lexerState=l.save()),this.current++}return f&&(this.lexerState=l.save()),this.results=this.finish(),this},s.prototype.reportLexerError=function(v){var l,c,d=v.token;return d?(l="input "+JSON.stringify(d.text[0])+" (lexer error)",c=this.lexer.formatError(d,"Syntax error")):(l="input (lexer error)",c=v.message),this.reportErrorCommon(c,l)},s.prototype.reportError=function(v){var l=(v.type?v.type+" token: ":"")+JSON.stringify(v.value!==void 0?v.value:v),c=this.lexer.formatError(v,"Syntax error");return this.reportErrorCommon(c,l)},s.prototype.reportErrorCommon=function(v,l){var c=[];c.push(v);var d=this.table.length-2,f=this.table[d],m=f.states.filter(function(b){var A=b.rule.symbols[b.dot];return A&&typeof A!="string"});if(m.length===0)c.push("Unexpected "+l+`. I did not expect any more input. Here is the state of my parse table:
|
|
10
10
|
`),this.displayStateStack(f.states,c);else{c.push("Unexpected "+l+`. Instead, I was expecting to see one of the following:
|
|
11
11
|
`);var g=m.map(function(b){return this.buildFirstStateStack(b,[])||[b]},this);g.forEach(function(b){var A=b[0],_=A.rule.symbols[A.dot],w=this.getSymbolDisplay(_);c.push("A "+w+" based on:"),this.displayStateStack(b,c)},this)}return c.push(""),c.join(`
|
|
12
|
-
`)},s.prototype.displayStateStack=function(v,l){for(var c,d=0,f=0;f<v.length;f++){var m=v[f],g=m.rule.toString(m.dot);g===c?d++:(d>0&&l.push(" ^ "+d+" more lines identical to this"),d=0,l.push(" "+g)),c=g}},s.prototype.getSymbolDisplay=function(v){return o(v)},s.prototype.buildFirstStateStack=function(v,l){if(l.indexOf(v)!==-1)return null;if(v.wantedBy.length===0)return[v];var c=v.wantedBy[0],d=[v].concat(l),f=this.buildFirstStateStack(c,d);return f===null?null:[v].concat(f)},s.prototype.save=function(){var v=this.table[this.current];return v.lexerState=this.lexerState,v},s.prototype.restore=function(v){var l=v.index;this.current=l,this.table[l]=v,this.table.splice(l+1),this.lexerState=v.lexerState,this.results=this.finish()},s.prototype.rewind=function(v){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[v])},s.prototype.finish=function(){var v=[],l=this.grammar.start,c=this.table[this.table.length-1];return c.states.forEach(function(d){d.rule.name===l&&d.dot===d.rule.symbols.length&&d.reference===0&&d.data!==s.fail&&v.push(d)}),v.map(function(d){return d.data})};function o(v){var l=typeof v;if(l==="string")return v;if(l==="object"){if(v.literal)return JSON.stringify(v.literal);if(v instanceof RegExp)return"character matching "+v;if(v.type)return v.type+" token";if(v.test)return"token matching "+String(v.test);throw new Error("Unknown symbol type: "+v)}}function a(v){var l=typeof v;if(l==="string")return v;if(l==="object"){if(v.literal)return JSON.stringify(v.literal);if(v instanceof RegExp)return v.toString();if(v.type)return"%"+v.type;if(v.test)return"<"+String(v.test)+">";throw new Error("Unknown symbol type: "+v)}}return{Parser:s,Grammar:i,Rule:n}})});var
|
|
13
|
-
`,"\\n")).join("")))},{name:"STRING$ebnf$2",symbols:[/[^\"\'}\]:;,\s]/]},{name:"STRING$ebnf$2",symbols:["STRING$ebnf$2",/[^\"\'}\]:;,\s]/],postprocess:function(l){return l[0].concat([l[1]])}},{name:"STRING",symbols:["STRING$ebnf$2"],postprocess:v=>t(v[0].join(""))}],ParserStart:"MAIN"};typeof u1<"u"&&typeof u1.exports<"u"?u1.exports=a:window.grammar=a})()});var Wi=et((wp,l3)=>{x();R();T();k();var n3=i3(),_a=r3();function a3(n){function t(e,i){return i==="compound"?Object.keys(e).reduce(function(r,s){return r[s]=a3(e[s]),r},{}):i==="list"?Array.isArray(e.value)?e.value.map(function(r){return t(r,e.type)}):[]:e}return t(n.value,n.type)}function f1({value:n,type:t}){if(t==="compound"){let i=[],r=Object.entries(n);for(let s=0;s<r.length;s++){let o=r[s][0],a=f1(r[s][1]);o==="string"&&(a=s3(a)),i.push(`${o}:${a}`)}return`{${i.join(",")}}`}else{if(t==="list")return Array.isArray(n.value)?`[${o3(n)}]`:"[]";if(t==="byteArray"||t==="intArray"||t==="longArray"){let i=Aa(t),r=o3(n);return`[${i}${r}]`}}let e=n+Ea(n,t);return t==="string"&&(e=s3(e)),e}function s3(n){return n=n.replace(/"/g,'\\"'),(/'|{|}|\[|\]|:|;|,|\(|\)|§|=/g.test(n)||n==="")&&(n=`"${n}"`),n}function o3({value:n,type:t}){let e=wa(n),i=[];for(let r=0;r<n.length;r++){let s=n[r];s!==void 0&&(s=f1({value:s,type:t}),e?i.push(`${r}:${s}`):i.push(s))}return i.join(",")}function wa(n){for(let t=0;t<n.length;t++)if(n[t]===void 0)return!0;return!1}var Aa=n=>n.charAt(0).toUpperCase()+";";function Ea(n,t){return t==="double"?n>>0===n?"d":"":{int:"",byte:"b",short:"s",float:"f",long:"l",string:""}[t]}function xa(n){return f1(v3(n))}function v3(n){try{let t=new n3.Parser(n3.Grammar.fromCompiled(_a));return t.feed(n),t.results[0]}catch(t){throw t.message=`Error parsing text '${n}'`,t}}l3.exports={parse:v3,simplify:a3,stringify:f1,normalize:xa}});var h3={};U5(h3,{camelCase:()=>Sa,capitalCase:()=>ji,constantCase:()=>Ba,dotCase:()=>Ia,kebabCase:()=>Ha,noCase:()=>c5,pascalCase:()=>Ca,pascalSnakeCase:()=>Pa,pathCase:()=>Oa,sentenceCase:()=>za,snakeCase:()=>Yi,split:()=>Vi,splitSeparateNumbers:()=>u3,trainCase:()=>Da});function Vi(n){let t=n.trim();t=t.replace(Ra,c3).replace(ka,c3),t=t.replace(Ma,"\0");let e=0,i=t.length;for(;t.charAt(e)==="\0";)e++;if(e===i)return[];for(;t.charAt(i-1)==="\0";)i--;return t.slice(e,i).split(/\0/g)}function u3(n){let t=Vi(n);for(let e=0;e<t.length;e++){let i=t[e],r=Ta.exec(i);if(r){let s=r.index+(r[1]??r[2]).length;t.splice(e,1,i.slice(0,s),i.slice(s))}}return t}function c5(n,t){let[e,i,r]=Ae(n,t);return e+i.map(d5(t?.locale)).join(t?.delimiter??" ")+r}function Sa(n,t){let[e,i,r]=Ae(n,t),s=d5(t?.locale),o=u5(t?.locale),a=t?.mergeAmbiguousCharacters?h1(s,o):f3(s,o);return e+i.map((v,l)=>l===0?s(v):a(v,l)).join(t?.delimiter??"")+r}function Ca(n,t){let[e,i,r]=Ae(n,t),s=d5(t?.locale),o=u5(t?.locale),a=t?.mergeAmbiguousCharacters?h1(s,o):f3(s,o);return e+i.map(a).join(t?.delimiter??"")+r}function Pa(n,t){return ji(n,{delimiter:"_",...t})}function ji(n,t){let[e,i,r]=Ae(n,t),s=d5(t?.locale),o=u5(t?.locale);return e+i.map(h1(s,o)).join(t?.delimiter??" ")+r}function Ba(n,t){let[e,i,r]=Ae(n,t);return e+i.map(u5(t?.locale)).join(t?.delimiter??"_")+r}function Ia(n,t){return c5(n,{delimiter:".",...t})}function Ha(n,t){return c5(n,{delimiter:"-",...t})}function Oa(n,t){return c5(n,{delimiter:"/",...t})}function za(n,t){let[e,i,r]=Ae(n,t),s=d5(t?.locale),o=u5(t?.locale),a=h1(s,o);return e+i.map((v,l)=>l===0?a(v):s(v)).join(t?.delimiter??" ")+r}function Yi(n,t){return c5(n,{delimiter:"_",...t})}function Da(n,t){return ji(n,{delimiter:"-",...t})}function d5(n){return n===!1?t=>t.toLowerCase():t=>t.toLocaleLowerCase(n)}function u5(n){return n===!1?t=>t.toUpperCase():t=>t.toLocaleUpperCase(n)}function h1(n,t){return e=>`${t(e[0])}${n(e.slice(1))}`}function f3(n,t){return(e,i)=>{let r=e[0];return(i>0&&r>="0"&&r<="9"?"_"+r:t(r))+n(e.slice(1))}}function Ae(n,t={}){let e=t.split??(t.separateNumbers?u3:Vi),i=t.prefixCharacters??d3,r=t.suffixCharacters??d3,s=0,o=n.length;for(;s<n.length;){let a=n.charAt(s);if(!i.includes(a))break;s++}for(;o>s;){let a=o-1,v=n.charAt(a);if(!r.includes(v))break;o=a}return[n.slice(0,s),e(n.slice(s,o)),n.slice(o)]}var Ra,ka,Ta,Ma,c3,d3,Qi=mt(()=>{x();R();T();k();Ra=/([\p{Ll}\d])(\p{Lu})/gu,ka=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,Ta=/(\d)\p{Ll}|(\p{L})\d/u,Ma=/[^\p{L}\d]+/giu,c3="$1\0$2",d3=""});var m3=et((Cp,Fa)=>{Fa.exports={version:"1.21.4",attackable:["acacia_boat","acacia_chest_boat","allay","armadillo","armor_stand","axolotl","bamboo_chest_raft","bamboo_raft","bat","bee","birch_boat","birch_chest_boat","blaze","bogged","breeze","camel","cat","cave_spider","cherry_boat","cherry_chest_boat","chest_minecart","chicken","cod","command_block_minecart","cow","creaking","creeper","dark_oak_boat","dark_oak_chest_boat","dolphin","donkey","drowned","elder_guardian","end_crystal","ender_dragon","enderman","endermite","evoker","falling_block","fox","frog","furnace_minecart","ghast","giant","glow_item_frame","glow_squid","goat","guardian","hoglin","hopper_minecart","horse","husk","illusioner","iron_golem","item_frame","jungle_boat","jungle_chest_boat","leash_knot","llama","magma_cube","mangrove_boat","mangrove_chest_boat","minecart","mooshroom","mule","oak_boat","oak_chest_boat","ocelot","painting","pale_oak_boat","pale_oak_chest_boat","panda","parrot","phantom","pig","piglin","piglin_brute","pillager","player","polar_bear","pufferfish","rabbit","ravager","salmon","sheep","shulker","shulker_bullet","silverfish","skeleton","skeleton_horse","slime","sniffer","snow_golem","spawner_minecart","spider","spruce_boat","spruce_chest_boat","squid","stray","strider","tadpole","tnt","tnt_minecart","trader_llama","tropical_fish","turtle","vex","villager","vindicator","wandering_trader","warden","wind_charge","witch","wither","wither_skeleton","wolf","zoglin","zombie","zombie_horse","zombie_villager","zombified_piglin"],notAttackable:["area_effect_cloud","arrow","block_display","breeze_wind_charge","dragon_fireball","egg","ender_pearl","evoker_fangs","experience_bottle","experience_orb","eye_of_ender","fireball","firework_rocket","fishing_bobber","interaction","item","item_display","lightning_bolt","llama_spit","marker","ominous_item_spawner","potion","small_fireball","snowball","spectral_arrow","text_display","trident","wither_skull"],entityRenames:{Boat:"oak_boat",EnderCrystal:"end_crystal",EntityHorse:"horse",EyeOfEnderSignal:"eye_of_ender",FallingSand:"falling_block",FireworksRocketEntity:"firework_rocket","Fishing Float":"fishing_bobber","Fishing Hook":"fishing_bobber",LavaSlime:"magma_cube",MinecartRideable:"minecart",Mob:!1,Monster:!1,MushroomCow:"mooshroom",Ozelot:"ocelot",PigZombie:"zombified_piglin",PrimedTnt:"tnt",SnowMan:"snow_golem",ThrownEgg:"egg",ThrownEnderpearl:"ender_pearl",ThrownExpBottle:"experience_bottle",ThrownPotion:"potion",VillagerGolem:"iron_golem",WitherBoss:"wither",XPOrb:"experience_orb",activated_tnt:"tnt",armorstand:"armor_stand",boat:"oak_boat",chest_boat:"oak_chest_boat",commandblock_minecart:"command_block_minecart",creaking_transient:"creaking",ender_crystal:"end_crystal",endercrystal:"end_crystal",evocation_fangs:"evoker_fangs",evocation_illager:"evoker",eye_of_ender_signal:"eye_of_ender",falling_objects:"falling_block",firecharge:"fireball",fireworks_rocket:"firework_rocket",fishing_hook:"fishing_bobber",illusion_illager:"illusioner",item_frames:"item_frame",item_stack:"item",snowman:"snow_golem",thrown_enderpearl:"ender_pearl","thrown_exp bottle":"experience_bottle",thrown_exp_bottle:"experience_bottle",thrown_potion:"potion",tipped_arrow:"arrow",villager_golem:"iron_golem",vindication_illager:"vindicator",xp_bottle:"experience_bottle",xp_orb:"experience_orb",zombie_pigman:"zombified_piglin"}}});var g3=et((Pp,p3)=>{x();R();T();k();var Ee=1e3,xe=Ee*60,Re=xe*60,Xt=Re*24,La=Xt*7,Ua=Xt*365.25;p3.exports=function(n,t){t=t||{};var e=typeof n;if(e==="string"&&n.length>0)return Ga(n);if(e==="number"&&isFinite(n))return t.long?Wa(n):Na(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function Ga(n){if(n=String(n),!(n.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(t){var e=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return e*Ua;case"weeks":case"week":case"w":return e*La;case"days":case"day":case"d":return e*Xt;case"hours":case"hour":case"hrs":case"hr":case"h":return e*Re;case"minutes":case"minute":case"mins":case"min":case"m":return e*xe;case"seconds":case"second":case"secs":case"sec":case"s":return e*Ee;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function Na(n){var t=Math.abs(n);return t>=Xt?Math.round(n/Xt)+"d":t>=Re?Math.round(n/Re)+"h":t>=xe?Math.round(n/xe)+"m":t>=Ee?Math.round(n/Ee)+"s":n+"ms"}function Wa(n){var t=Math.abs(n);return t>=Xt?m1(n,t,Xt,"day"):t>=Re?m1(n,t,Re,"hour"):t>=xe?m1(n,t,xe,"minute"):t>=Ee?m1(n,t,Ee,"second"):n+" ms"}function m1(n,t,e,i){var r=t>=e*1.5;return Math.round(n/e)+" "+i+(r?"s":"")}});var y3=et((zp,b3)=>{x();R();T();k();function Va(n){e.debug=e,e.default=e,e.coerce=v,e.disable=o,e.enable=r,e.enabled=a,e.humanize=g3(),e.destroy=l,Object.keys(n).forEach(c=>{e[c]=n[c]}),e.names=[],e.skips=[],e.formatters={};function t(c){let d=0;for(let f=0;f<c.length;f++)d=(d<<5)-d+c.charCodeAt(f),d|=0;return e.colors[Math.abs(d)%e.colors.length]}e.selectColor=t;function e(c){let d,f=null,m,g;function b(...A){if(!b.enabled)return;let _=b,w=Number(new Date),M=w-(d||w);_.diff=M,_.prev=d,_.curr=w,d=w,A[0]=e.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let S=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(H,B)=>{if(H==="%%")return"%";S++;let I=e.formatters[B];if(typeof I=="function"){let N=A[S];H=I.call(_,N),A.splice(S,1),S--}return H}),e.formatArgs.call(_,A),(_.log||e.log).apply(_,A)}return b.namespace=c,b.useColors=e.useColors(),b.color=e.selectColor(c),b.extend=i,b.destroy=e.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(m!==e.namespaces&&(m=e.namespaces,g=e.enabled(c)),g),set:A=>{f=A}}),typeof e.init=="function"&&e.init(b),b}function i(c,d){let f=e(this.namespace+(typeof d>"u"?":":d)+c);return f.log=this.log,f}function r(c){e.save(c),e.namespaces=c,e.names=[],e.skips=[];let d=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of d)f[0]==="-"?e.skips.push(f.slice(1)):e.names.push(f)}function s(c,d){let f=0,m=0,g=-1,b=0;for(;f<c.length;)if(m<d.length&&(d[m]===c[f]||d[m]==="*"))d[m]==="*"?(g=m,b=f,m++):(f++,m++);else if(g!==-1)m=g+1,b++,f=b;else return!1;for(;m<d.length&&d[m]==="*";)m++;return m===d.length}function o(){let c=[...e.names,...e.skips.map(d=>"-"+d)].join(",");return e.enable(""),c}function a(c){for(let d of e.skips)if(s(c,d))return!1;for(let d of e.names)if(s(c,d))return!0;return!1}function v(c){return c instanceof Error?c.stack||c.message:c}function l(){}return e.enable(e.load()),e}b3.exports=Va});var _3=et(($0,p1)=>{x();R();T();k();$0.formatArgs=Ya;$0.save=Qa;$0.load=Ka;$0.useColors=ja;$0.storage=Ja();$0.destroy=(()=>{let n=!1;return()=>{n||(n=!0)}})();$0.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ja(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ya(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+p1.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;n.splice(1,0,t,"color: inherit");let e=0,i=0;n[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(e++,r==="%c"&&(i=e))}),n.splice(i,0,t)}$0.log=console.debug||console.log||(()=>{});function Qa(n){try{n?$0.storage.setItem("debug",n):$0.storage.removeItem("debug")}catch{}}function Ka(){let n;try{n=$0.storage.getItem("debug")||$0.storage.getItem("DEBUG")}catch{}return!n&&typeof D<"u"&&"env"in D&&(n=D.env.DEBUG),n}function Ja(){try{return localStorage}catch{}}p1.exports=y3()($0);var{formatters:qa}=p1.exports;qa.j=function(n){try{return JSON.stringify(n)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var w3=et(ke=>{"use strict";x();R();T();k();var Za=ke&&ke.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ke,"__esModule",{value:!0});ke.debug=void 0;var Xa=Za(_3());ke.debug=(0,Xa.default)("mineflayer-mouse")});var R3=et($t=>{"use strict";x();R();T();k();var $a=$t&&$t.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty($t,"__esModule",{value:!0});$t.isEntityAttackable=void 0;$t.isArmorStandAttackable=x3;var A3=(Qi(),m6(h3)),f5=$a(m3()),t7=w3(),E3=Object.fromEntries([...f5.default.attackable,...f5.default.notAttackable].map(n=>[n,!0])),e7=f5.default.attackable,i7=(n,t)=>{if(!t.name)throw new Error("Entity has no name");let e=n.entitiesByName[t.name],r=f5.default.entityRenames[t.name]||f5.default.entityRenames[(0,A3.snakeCase)(t.name)]||t.name;if(!E3[r]&&(r=(0,A3.snakeCase)(r),!E3[r]))return(0,t7.debug)(`Cannot find entity ${r} in entityData.json`),!1;let s=r7[r];return s?s(t,e):e7.includes(r)};$t.isEntityAttackable=i7;var r7={armor_stand:x3};function x3(n,t){let e=Number(n.metadata?.[t.metadataKeys?.indexOf("client_flags")??14]??0),i=(e&16)!==0,r=(e&8)!==0,s=(e&4)!==0,o=(e&1)!==0;return!i}});var vo=et((hE,A4)=>{A4.exports={version:"1.20.4","1.8":{blocks:[["wood_planks","planks"],["large_flowers","double_plant"]]},"1.12":{items:[["totem","totem_of_undying"]]},"1.13":{blocks:[["grass","grass_block"],["planks","oak_planks"],["planks","spruce_planks"],["planks","birch_planks"],["planks","jungle_planks"],["planks","acacia_planks"],["planks","dark_oak_planks"],["sapling","oak_sapling"],["sapling","spruce_sapling"],["sapling","birch_sapling"],["sapling","jungle_sapling"],["sapling","acacia_sapling"],["sapling","dark_oak_sapling"],["sand","red_sand"],["log","oak_log"],["log","spruce_log"],["log","birch_log"],["log","jungle_log"],["log","oak_wood"],["log","spruce_wood"],["log","birch_wood"],["log","jungle_wood"],["leaves","oak_leaves"],["leaves","spruce_leaves"],["leaves","birch_leaves"],["leaves","jungle_leaves"],["sponge","wet_sponge"],["sandstone","chiseled_sandstone"],["sandstone","cut_sandstone"],["noteblock","note_block"],["bed","red_bed"],["golden_rail","powered_rail"],["web","cobweb"],["tallgrass","dead_bush"],["tallgrass","grass"],["tallgrass","fern"],["deadbush","dead_bush"],["wool","white_wool"],["wool","orange_wool"],["wool","magenta_wool"],["wool","light_blue_wool"],["wool","yellow_wool"],["wool","lime_wool"],["wool","pink_wool"],["wool","gray_wool"],["wool","light_gray_wool"],["wool","cyan_wool"],["wool","purple_wool"],["wool","blue_wool"],["wool","brown_wool"],["wool","green_wool"],["wool","red_wool"],["wool","black_wool"],["piston_extension","moving_piston"],["yellow_flower","dandelion"],["red_flower","poppy"],["red_flower","blue_orchid"],["red_flower","allium"],["red_flower","azure_bluet"],["red_flower","red_tulip"],["red_flower","orange_tulip"],["red_flower","white_tulip"],["red_flower","pink_tulip"],["red_flower","oxeye_daisy"],["double_stone_slab","stone_slab"],["double_stone_slab","sandstone_slab"],["double_stone_slab","petrified_oak_slab"],["double_stone_slab","cobblestone_slab"],["double_stone_slab","brick_slab"],["double_stone_slab","stone_brick_slab"],["double_stone_slab","nether_brick_slab"],["double_stone_slab","quartz_slab"],["double_stone_slab","smooth_stone"],["double_stone_slab","smooth_sandstone"],["double_stone_slab","smooth_quartz"],["stone_slab","sandstone_slab"],["stone_slab","petrified_oak_slab"],["stone_slab","cobblestone_slab"],["stone_slab","brick_slab"],["stone_slab","stone_brick_slab"],["stone_slab","nether_brick_slab"],["stone_slab","quartz_slab"],["brick_block","bricks"],["mob_spawner","spawner"],["lit_furnace","furnace"],["standing_sign","sign"],["wooden_door","oak_door"],["stone_stairs","cobblestone_stairs"],["wooden_pressure_plate","oak_pressure_plate"],["lit_redstone_ore","redstone_ore"],["unlit_redstone_torch","redstone_wall_torch"],["unlit_redstone_torch","redstone_torch"],["redstone_torch","redstone_wall_torch"],["snow_layer","snow"],["snow","snow_block"],["reeds","sugar_cane"],["fence","oak_fence"],["pumpkin","carved_pumpkin"],["portal","nether_portal"],["lit_pumpkin","jack_o_lantern"],["unpowered_repeater","repeater"],["powered_repeater","repeater"],["stained_glass","white_stained_glass"],["stained_glass","orange_stained_glass"],["stained_glass","magenta_stained_glass"],["stained_glass","light_blue_stained_glass"],["stained_glass","yellow_stained_glass"],["stained_glass","lime_stained_glass"],["stained_glass","pink_stained_glass"],["stained_glass","gray_stained_glass"],["stained_glass","light_gray_stained_glass"],["stained_glass","cyan_stained_glass"],["stained_glass","purple_stained_glass"],["stained_glass","blue_stained_glass"],["stained_glass","brown_stained_glass"],["stained_glass","green_stained_glass"],["stained_glass","red_stained_glass"],["stained_glass","black_stained_glass"],["trapdoor","oak_trapdoor"],["monster_egg","infested_stone"],["monster_egg","infested_cobblestone"],["monster_egg","infested_stone_bricks"],["monster_egg","infested_mossy_stone_bricks"],["monster_egg","infested_cracked_stone_bricks"],["monster_egg","infested_chiseled_stone_bricks"],["stonebrick","stone_bricks"],["stonebrick","mossy_stone_bricks"],["stonebrick","cracked_stone_bricks"],["stonebrick","chiseled_stone_bricks"],["brown_mushroom_block","mushroom_stem"],["red_mushroom_block","mushroom_stem"],["melon_block","melon"],["fence_gate","oak_fence_gate"],["waterlily","lily_pad"],["nether_brick","nether_bricks"],["lit_redstone_lamp","redstone_lamp"],["double_wooden_slab","oak_slab"],["double_wooden_slab","spruce_slab"],["double_wooden_slab","birch_slab"],["double_wooden_slab","jungle_slab"],["double_wooden_slab","acacia_slab"],["double_wooden_slab","dark_oak_slab"],["wooden_slab","oak_slab"],["wooden_slab","spruce_slab"],["wooden_slab","birch_slab"],["wooden_slab","jungle_slab"],["wooden_slab","acacia_slab"],["wooden_slab","dark_oak_slab"],["cobblestone_wall","mossy_cobblestone_wall"],["flower_pot","potted_poppy"],["flower_pot","potted_dandelion"],["flower_pot","potted_oak_sapling"],["flower_pot","potted_spruce_sapling"],["flower_pot","potted_birch_sapling"],["flower_pot","potted_jungle_sapling"],["flower_pot","potted_red_mushroom"],["flower_pot","potted_brown_mushroom"],["flower_pot","potted_cactus"],["flower_pot","potted_dead_bush"],["flower_pot","potted_fern"],["flower_pot","potted_acacia_sapling"],["flower_pot","potted_dark_oak_sapling"],["flower_pot","potted_blue_orchid"],["flower_pot","potted_allium"],["wooden_button","oak_button"],["skull","skeleton_skull"],["skull","skeleton_wall_skull"],["anvil","chipped_anvil"],["anvil","damaged_anvil"],["unpowered_comparator","comparator"],["powered_comparator","comparator"],["quartz_ore","nether_quartz_ore"],["quartz_block","chiseled_quartz_block"],["quartz_block","quartz_pillar"],["stained_hardened_clay","white_terracotta"],["stained_hardened_clay","orange_terracotta"],["stained_hardened_clay","magenta_terracotta"],["stained_hardened_clay","light_blue_terracotta"],["stained_hardened_clay","yellow_terracotta"],["stained_hardened_clay","lime_terracotta"],["stained_hardened_clay","pink_terracotta"],["stained_hardened_clay","gray_terracotta"],["stained_hardened_clay","light_gray_terracotta"],["stained_hardened_clay","cyan_terracotta"],["stained_hardened_clay","purple_terracotta"],["stained_hardened_clay","blue_terracotta"],["stained_hardened_clay","brown_terracotta"],["stained_hardened_clay","green_terracotta"],["stained_hardened_clay","red_terracotta"],["stained_hardened_clay","black_terracotta"],["stained_glass_pane","white_stained_glass_pane"],["stained_glass_pane","orange_stained_glass_pane"],["stained_glass_pane","magenta_stained_glass_pane"],["stained_glass_pane","light_blue_stained_glass_pane"],["stained_glass_pane","yellow_stained_glass_pane"],["stained_glass_pane","lime_stained_glass_pane"],["stained_glass_pane","pink_stained_glass_pane"],["stained_glass_pane","gray_stained_glass_pane"],["stained_glass_pane","light_gray_stained_glass_pane"],["stained_glass_pane","cyan_stained_glass_pane"],["stained_glass_pane","purple_stained_glass_pane"],["stained_glass_pane","blue_stained_glass_pane"],["stained_glass_pane","brown_stained_glass_pane"],["stained_glass_pane","green_stained_glass_pane"],["stained_glass_pane","red_stained_glass_pane"],["stained_glass_pane","black_stained_glass_pane"],["leaves2","acacia_leaves"],["leaves2","dark_oak_leaves"],["log2","acacia_log"],["log2","dark_oak_log"],["log2","acacia_wood"],["log2","dark_oak_wood"],["slime","slime_block"],["prismarine","prismarine_bricks"],["prismarine","dark_prismarine"],["carpet","white_carpet"],["carpet","orange_carpet"],["carpet","magenta_carpet"],["carpet","light_blue_carpet"],["carpet","yellow_carpet"],["carpet","lime_carpet"],["carpet","pink_carpet"],["carpet","gray_carpet"],["carpet","light_gray_carpet"],["carpet","cyan_carpet"],["carpet","purple_carpet"],["carpet","blue_carpet"],["carpet","brown_carpet"],["carpet","green_carpet"],["carpet","red_carpet"],["carpet","black_carpet"],["hardened_clay","terracotta"],["double_plant","sunflower"],["double_plant","lilac"],["double_plant","tall_grass"],["double_plant","large_fern"],["double_plant","rose_bush"],["double_plant","peony"],["standing_banner","white_banner"],["wall_banner","white_wall_banner"],["daylight_detector_inverted","daylight_detector"],["red_sandstone","chiseled_red_sandstone"],["red_sandstone","cut_red_sandstone"],["double_stone_slab2","red_sandstone_slab"],["double_stone_slab2","smooth_red_sandstone"],["stone_slab2","red_sandstone_slab"],["purpur_double_slab","purpur_slab"],["end_bricks","end_stone_bricks"],["magma","magma_block"],["red_nether_brick","red_nether_bricks"],["concrete","white_concrete"],["concrete","orange_concrete"],["concrete","magenta_concrete"],["concrete","light_blue_concrete"],["concrete","yellow_concrete"],["concrete","lime_concrete"],["concrete","pink_concrete"],["concrete","gray_concrete"],["concrete","light_gray_concrete"],["concrete","cyan_concrete"],["concrete","purple_concrete"],["concrete","blue_concrete"],["concrete","brown_concrete"],["concrete","green_concrete"],["concrete","red_concrete"],["concrete","black_concrete"],["concrete_powder","white_concrete_powder"],["concrete_powder","orange_concrete_powder"],["concrete_powder","magenta_concrete_powder"],["concrete_powder","light_blue_concrete_powder"],["concrete_powder","yellow_concrete_powder"],["concrete_powder","lime_concrete_powder"],["concrete_powder","pink_concrete_powder"],["concrete_powder","gray_concrete_powder"],["concrete_powder","light_gray_concrete_powder"],["concrete_powder","cyan_concrete_powder"],["concrete_powder","purple_concrete_powder"],["concrete_powder","blue_concrete_powder"],["concrete_powder","brown_concrete_powder"],["concrete_powder","green_concrete_powder"],["concrete_powder","red_concrete_powder"],["concrete_powder","black_concrete_powder"]],items:[["stone","granite"],["stone","polished_granite"],["stone","diorite"],["stone","polished_diorite"],["stone","andesite"],["stone","polished_andesite"],["grass","grass_block"],["dirt","coarse_dirt"],["dirt","podzol"],["planks","oak_planks"],["planks","spruce_planks"],["planks","birch_planks"],["planks","jungle_planks"],["planks","acacia_planks"],["planks","dark_oak_planks"],["sapling","oak_sapling"],["sapling","spruce_sapling"],["sapling","birch_sapling"],["sapling","jungle_sapling"],["sapling","acacia_sapling"],["sapling","dark_oak_sapling"],["sand","red_sand"],["log","oak_log"],["log","spruce_log"],["log","birch_log"],["log","jungle_log"],["leaves","oak_leaves"],["leaves","spruce_leaves"],["leaves","birch_leaves"],["leaves","jungle_leaves"],["sponge","wet_sponge"],["sandstone","chiseled_sandstone"],["sandstone","cut_sandstone"],["noteblock","note_block"],["golden_rail","powered_rail"],["web","cobweb"],["tallgrass","grass"],["tallgrass","fern"],["deadbush","dead_bush"],["wool","white_wool"],["wool","orange_wool"],["wool","magenta_wool"],["wool","light_blue_wool"],["wool","yellow_wool"],["wool","lime_wool"],["wool","pink_wool"],["wool","gray_wool"],["wool","light_gray_wool"],["wool","cyan_wool"],["wool","purple_wool"],["wool","blue_wool"],["wool","brown_wool"],["wool","green_wool"],["wool","red_wool"],["wool","black_wool"],["yellow_flower","dandelion"],["red_flower","poppy"],["red_flower","blue_orchid"],["red_flower","allium"],["red_flower","azure_bluet"],["red_flower","red_tulip"],["red_flower","orange_tulip"],["red_flower","white_tulip"],["red_flower","pink_tulip"],["red_flower","oxeye_daisy"],["stone_slab","sandstone_slab"],["stone_slab","cobblestone_slab"],["stone_slab","brick_slab"],["stone_slab","stone_brick_slab"],["stone_slab","nether_brick_slab"],["stone_slab","quartz_slab"],["brick_block","bricks"],["mob_spawner","spawner"],["stone_stairs","cobblestone_stairs"],["wooden_pressure_plate","oak_pressure_plate"],["snow_layer","snow"],["snow","snow_block"],["fence","oak_fence"],["pumpkin","carved_pumpkin"],["lit_pumpkin","jack_o_lantern"],["stained_glass","white_stained_glass"],["stained_glass","orange_stained_glass"],["stained_glass","magenta_stained_glass"],["stained_glass","light_blue_stained_glass"],["stained_glass","yellow_stained_glass"],["stained_glass","lime_stained_glass"],["stained_glass","pink_stained_glass"],["stained_glass","gray_stained_glass"],["stained_glass","light_gray_stained_glass"],["stained_glass","cyan_stained_glass"],["stained_glass","purple_stained_glass"],["stained_glass","blue_stained_glass"],["stained_glass","brown_stained_glass"],["stained_glass","green_stained_glass"],["stained_glass","red_stained_glass"],["stained_glass","black_stained_glass"],["trapdoor","oak_trapdoor"],["monster_egg","infested_stone"],["monster_egg","infested_cobblestone"],["monster_egg","infested_stone_bricks"],["monster_egg","infested_mossy_stone_bricks"],["monster_egg","infested_cracked_stone_bricks"],["monster_egg","infested_chiseled_stone_bricks"],["stonebrick","stone_bricks"],["stonebrick","mossy_stone_bricks"],["stonebrick","cracked_stone_bricks"],["stonebrick","chiseled_stone_bricks"],["melon_block","melon"],["fence_gate","oak_fence_gate"],["waterlily","lily_pad"],["nether_brick","nether_bricks"],["wooden_slab","oak_slab"],["wooden_slab","spruce_slab"],["wooden_slab","birch_slab"],["wooden_slab","jungle_slab"],["wooden_slab","acacia_slab"],["wooden_slab","dark_oak_slab"],["cobblestone_wall","mossy_cobblestone_wall"],["wooden_button","oak_button"],["anvil","chipped_anvil"],["anvil","damaged_anvil"],["quartz_ore","nether_quartz_ore"],["quartz_block","chiseled_quartz_block"],["quartz_block","quartz_pillar"],["stained_hardened_clay","white_terracotta"],["stained_hardened_clay","orange_terracotta"],["stained_hardened_clay","magenta_terracotta"],["stained_hardened_clay","light_blue_terracotta"],["stained_hardened_clay","yellow_terracotta"],["stained_hardened_clay","lime_terracotta"],["stained_hardened_clay","pink_terracotta"],["stained_hardened_clay","gray_terracotta"],["stained_hardened_clay","light_gray_terracotta"],["stained_hardened_clay","cyan_terracotta"],["stained_hardened_clay","purple_terracotta"],["stained_hardened_clay","blue_terracotta"],["stained_hardened_clay","brown_terracotta"],["stained_hardened_clay","green_terracotta"],["stained_hardened_clay","red_terracotta"],["stained_hardened_clay","black_terracotta"],["stained_glass_pane","white_stained_glass_pane"],["stained_glass_pane","orange_stained_glass_pane"],["stained_glass_pane","magenta_stained_glass_pane"],["stained_glass_pane","light_blue_stained_glass_pane"],["stained_glass_pane","yellow_stained_glass_pane"],["stained_glass_pane","lime_stained_glass_pane"],["stained_glass_pane","pink_stained_glass_pane"],["stained_glass_pane","gray_stained_glass_pane"],["stained_glass_pane","light_gray_stained_glass_pane"],["stained_glass_pane","cyan_stained_glass_pane"],["stained_glass_pane","purple_stained_glass_pane"],["stained_glass_pane","blue_stained_glass_pane"],["stained_glass_pane","brown_stained_glass_pane"],["stained_glass_pane","green_stained_glass_pane"],["stained_glass_pane","red_stained_glass_pane"],["stained_glass_pane","black_stained_glass_pane"],["leaves2","acacia_leaves"],["leaves2","dark_oak_leaves"],["log2","acacia_log"],["log2","dark_oak_log"],["slime","slime_block"],["prismarine","prismarine_bricks"],["prismarine","dark_prismarine"],["carpet","white_carpet"],["carpet","orange_carpet"],["carpet","magenta_carpet"],["carpet","light_blue_carpet"],["carpet","yellow_carpet"],["carpet","lime_carpet"],["carpet","pink_carpet"],["carpet","gray_carpet"],["carpet","light_gray_carpet"],["carpet","cyan_carpet"],["carpet","purple_carpet"],["carpet","blue_carpet"],["carpet","brown_carpet"],["carpet","green_carpet"],["carpet","red_carpet"],["carpet","black_carpet"],["hardened_clay","terracotta"],["double_plant","sunflower"],["double_plant","lilac"],["double_plant","tall_grass"],["double_plant","large_fern"],["double_plant","rose_bush"],["double_plant","peony"],["red_sandstone","chiseled_red_sandstone"],["red_sandstone","cut_red_sandstone"],["stone_slab2","red_sandstone_slab"],["end_bricks","end_stone_bricks"],["magma","magma_block"],["red_nether_brick","red_nether_bricks"],["silver_shulker_box","light_gray_shulker_box"],["silver_glazed_terracotta","light_gray_glazed_terracotta"],["concrete","white_concrete"],["concrete","orange_concrete"],["concrete","magenta_concrete"],["concrete","light_blue_concrete"],["concrete","yellow_concrete"],["concrete","lime_concrete"],["concrete","pink_concrete"],["concrete","gray_concrete"],["concrete","light_gray_concrete"],["concrete","cyan_concrete"],["concrete","purple_concrete"],["concrete","blue_concrete"],["concrete","brown_concrete"],["concrete","green_concrete"],["concrete","red_concrete"],["concrete","black_concrete"],["concrete_powder","white_concrete_powder"],["concrete_powder","orange_concrete_powder"],["concrete_powder","magenta_concrete_powder"],["concrete_powder","light_blue_concrete_powder"],["concrete_powder","yellow_concrete_powder"],["concrete_powder","lime_concrete_powder"],["concrete_powder","pink_concrete_powder"],["concrete_powder","gray_concrete_powder"],["concrete_powder","light_gray_concrete_powder"],["concrete_powder","cyan_concrete_powder"],["concrete_powder","purple_concrete_powder"],["concrete_powder","blue_concrete_powder"],["concrete_powder","brown_concrete_powder"],["concrete_powder","green_concrete_powder"],["concrete_powder","red_concrete_powder"],["concrete_powder","black_concrete_powder"],["coal","charcoal"],["golden_apple","enchanted_golden_apple"],["wooden_door","oak_door"],["boat","oak_boat"],["reeds","sugar_cane"],["fish","cod"],["fish","salmon"],["fish","tropical_fish"],["fish","pufferfish"],["cooked_fish","cooked_cod"],["cooked_fish","cooked_salmon"],["dye","ink_sac"],["dye","rose_red"],["dye","cactus_green"],["dye","cocoa_beans"],["dye","lapis_lazuli"],["dye","purple_dye"],["dye","cyan_dye"],["dye","light_gray_dye"],["dye","gray_dye"],["dye","pink_dye"],["dye","lime_dye"],["dye","dandelion_yellow"],["dye","light_blue_dye"],["dye","magenta_dye"],["dye","orange_dye"],["dye","bone_meal"],["bed","white_bed"],["bed","orange_bed"],["bed","magenta_bed"],["bed","light_blue_bed"],["bed","yellow_bed"],["bed","lime_bed"],["bed","pink_bed"],["bed","gray_bed"],["bed","light_gray_bed"],["bed","cyan_bed"],["bed","purple_bed"],["bed","blue_bed"],["bed","brown_bed"],["bed","green_bed"],["bed","red_bed"],["bed","black_bed"],["melon","melon_slice"],["speckled_melon","glistering_melon_slice"],["spawn_egg","pig_spawn_egg"],["skull","skeleton_skull"],["skull","wither_skeleton_skull"],["skull","zombie_head"],["skull","player_head"],["skull","creeper_head"],["skull","dragon_head"],["fireworks","firework_rocket"],["firework_charge","firework_star"],["netherbrick","nether_brick"],["banner","black_banner"],["banner","red_banner"],["banner","green_banner"],["banner","brown_banner"],["banner","blue_banner"],["banner","purple_banner"],["banner","cyan_banner"],["banner","light_gray_banner"],["banner","gray_banner"],["banner","pink_banner"],["banner","lime_banner"],["banner","yellow_banner"],["banner","light_blue_banner"],["banner","magenta_banner"],["banner","orange_banner"],["banner","white_banner"],["chorus_fruit_popped","popped_chorus_fruit"],["record_13","music_disc_13"],["record_cat","music_disc_cat"],["record_blocks","music_disc_blocks"],["record_chirp","music_disc_chirp"],["record_far","music_disc_far"],["record_mall","music_disc_mall"],["record_mellohi","music_disc_mellohi"],["record_stal","music_disc_stal"],["record_strad","music_disc_strad"],["record_ward","music_disc_ward"],["record_11","music_disc_11"],["record_wait","music_disc_wait"]]},"1.14":{blocks:[["sign","oak_sign"],["wall_sign","oak_wall_sign"]],items:[["sign","oak_sign"],["rose_red","red_dye"],["cactus_green","green_dye"],["dandelion_yellow","yellow_dye"]]},"1.15.2":{blocks:[],items:[]},"1.16.1":{blocks:[],items:[["zombie_pigman_spawn_egg","zombified_piglin_spawn_egg"]]},"1.16.2":{blocks:[],items:[]},"1.17":{blocks:[["grass_path","dirt_path"]],items:[["grass_path","dirt_path"]]},"1.18":{blocks:[],items:[]},"1.19":{blocks:[],items:[]},"1.19.3":{blocks:[],items:[]},"1.19.4":{blocks:[],items:[]},"1.20":{blocks:[],items:[["pottery_shard_archer","archer_pottery_sherd"],["pottery_shard_prize","prize_pottery_sherd"],["pottery_shard_arms_up","arms_up_pottery_sherd"],["pottery_shard_skull","skull_pottery_sherd"]]},"1.16":{items:[["zombie_pigman_spawn_egg","zombified_piglin_spawn_egg"]]},"1.20.3":{blocks:[["grass","short_grass"]],items:[["grass","short_grass"]]}}});var lo=et(P1=>{"use strict";x();R();T();k();Object.defineProperty(P1,"__esModule",{value:!0});P1.versionToNumber=void 0;var E4=n=>{let[t,e="0",i="0"]=n.split(".");return+`${t.padStart(2,"0")}${parseInt(e).toString().padStart(2,"0")}${parseInt(i).toString().padStart(2,"0")}`};P1.versionToNumber=E4});var uo=et(Ie=>{"use strict";x();R();T();k();var x4=Ie&&Ie.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.getRenamedData=void 0;var co=x4(vo()),Ht=lo(),R4=(n,t,e,i)=>{let r=(0,Ht.versionToNumber)(e),s=(0,Ht.versionToNumber)(i),o=r<s?1:-1,a=o>0?1:0,v=t,l=Object.keys(co.default).sort((f,m)=>o*((0,Ht.versionToNumber)(f)-(0,Ht.versionToNumber)(m))),c=o>0?s:r,d=o>0?r:s;for(let f of l.filter(m=>(0,Ht.versionToNumber)(m)<=c&&(0,Ht.versionToNumber)(m)>=d)){if(o>0&&(0,Ht.versionToNumber)(f)>=c||o<0&&(0,Ht.versionToNumber)(f)<=d)break;let m=co.default[f][n];if(m)for(let g of m){let b=g[a],A=g[1-a];if(Array.isArray(v))v.includes(A)&&(v=v.map(_=>_===A?b:_));else if(v===A){v=b;break}}}return v};Ie.getRenamedData=R4});var ko={};U5(ko,{applyWorldGeometryExport:()=>O4,createMeshesFromExport:()=>xo,downloadWorldGeometry:()=>Ar,exportWorldGeometry:()=>Eo,loadTextureFromDataUrl:()=>Ro,loadWorldGeometryFromUrl:()=>I4});import*as C0 from"three";function Eo(n,t,e,i=!1){let r=[];for(let[o,a]of Object.entries(n.sectionObjects)){let v=a.children.find(A=>A.name==="mesh");if(!v?.geometry)continue;let{geometry:l}=v,c=l.getAttribute("position"),d=l.getAttribute("normal"),f=l.getAttribute("color"),m=l.getAttribute("uv"),g=l.index;if(!c||!g)continue;let b=n.sceneOrigin.getWorldPosition(v);r.push({key:o,position:{x:b?.x??n.sceneOrigin.toWorldX(v.position.x),y:b?.y??n.sceneOrigin.toWorldY(v.position.y),z:b?.z??n.sceneOrigin.toWorldZ(v.position.z)},geometry:{positions:[...c.array],normals:d?[...d.array]:[],colors:f?[...f.array]:[],uvs:m?[...m.array]:[],indices:[...g.array]}})}let s={version:n.version??"unknown",exportedAt:new Date().toISOString(),camera:{position:t,rotation:e},sections:r};if(i&&n.material.map){let o=document.createElement("canvas"),a=n.material.map,{image:v}=a;v&&(o.width=v.width,o.height=v.height,o.getContext("2d").drawImage(v,0,0),s.textureAtlasDataUrl=o.toDataURL("image/png"))}return s}function Ar(n,t,e,i="world-geometry.json",r=!1){let s=Eo(n,t,e,r),o=JSON.stringify(s),a=new Blob([o],{type:"application/json"}),v=URL.createObjectURL(a),l=document.createElement("a");l.href=v,l.download=i,l.click(),URL.revokeObjectURL(v)}async function I4(n){let t=await fetch(n);if(!t.ok)throw new Error(`Failed to fetch world geometry: ${t.statusText}`);return t.json()}function xo(n,t){let e=[];for(let i of n.sections){let r=new C0.BufferGeometry;r.setAttribute("position",new C0.Float32BufferAttribute(i.geometry.positions,3)),i.geometry.normals.length&&r.setAttribute("normal",new C0.Float32BufferAttribute(i.geometry.normals,3)),i.geometry.colors.length&&r.setAttribute("color",new C0.Float32BufferAttribute(i.geometry.colors,3)),i.geometry.uvs.length&&r.setAttribute("uv",new C0.Float32BufferAttribute(i.geometry.uvs,2));let o=Math.max(...i.geometry.indices)>65535?Uint32Array:Uint16Array;r.setIndex(new C0.BufferAttribute(new o(i.geometry.indices),1));let a=new C0.Mesh(r,t);a.position.set(i.position.x,i.position.y,i.position.z),a.name="mesh";let v=new C0.Group;v.name="chunk",v.add(a),e.push(v)}return e}async function Ro(n){return new Promise((t,e)=>{let i=new Image;i.onload=()=>{let r=new C0.Texture(i);r.magFilter=C0.NearestFilter,r.minFilter=C0.NearestFilter,r.needsUpdate=!0,r.flipY=!1,t(r)},i.onerror=e,i.src=n})}async function O4(n,t){let{scene:e,renderUpdateEmitter:i,material:r}=n,s=e.getObjectByName(Ao);s&&(e.remove(s),H4(s));let o=!!t.textureAtlasDataUrl,a;if(o&&t.textureAtlasDataUrl){let c=await Ro(t.textureAtlasDataUrl);a=new C0.MeshLambertMaterial({map:c,vertexColors:!0,transparent:!0,alphaTest:.1}),a.name="geometry-export-material"}else a=r;let v=xo(t,a),l=new C0.Group;l.name=Ao,o&&(l.userData.geometryExportMaterial=a);for(let c of v)l.add(c);return e.add(l),i.emit("update"),v.length}var Ao,H4,Er=mt(()=>{"use strict";x();R();T();k();Ao="geometry-export-root";H4=n=>{n.traverse(e=>{e.isMesh&&e.geometry?.dispose()});let t=n.userData?.geometryExportMaterial;t&&(t.map?.dispose?.(),t.dispose?.())}});x();R();T();k();x();R();T();k();x();R();T();k();x();R();T();k();import{proxy as g2}from"valtio";x();R();T();k();x();R();T();k();var ai=()=>({longRenderTime:!1,constantLongRenderTime:!1,tooManyEntities:!1,tooManyTextures:!1,unknownReason:!1});x();R();T();k();var j5=30;var vi=45,li=100;x();R();T();k();var Je=class{constructor(t){this.factors=t;u(this,"renderTimeHistory",[])}onFrame(t){this.pushRenderTime(t.totalMs),this.recompute(t)}pushRenderTime(t){this.renderTimeHistory.push(t),this.renderTimeHistory.length>24&&this.renderTimeHistory.shift()}recompute(t){let e=t.fps>0&&t.fps<=45,i=Math.max(0,t.totalMs-t.entitiesMs),r=t.totalMs>=30,s=this.renderTimeHistory.length,o=this.renderTimeHistory.filter(f=>f>=30).length,a=s>=8&&o/s>=.65,v=t.loadedTextureCount>=100,l=e&&t.entitiesMs>=8&&i<=20,d=e&&!(r||a||l||v);this.factors.longRenderTime=r,this.factors.constantLongRenderTime=a,this.factors.tooManyEntities=l,this.factors.tooManyTextures=v,this.factors.unknownReason=d}reset(){this.renderTimeHistory.length=0,this.factors.longRenderTime=!1,this.factors.constantLongRenderTime=!1,this.factors.tooManyEntities=!1,this.factors.tooManyTextures=!1,this.factors.unknownReason=!1}};x();R();T();k();var x6=[{key:"longRenderTime",code:"LR"},{key:"constantLongRenderTime",code:"CLR"},{key:"tooManyEntities",code:"ENT"},{key:"tooManyTextures",code:"TEX"},{key:"unknownReason",code:"UNK"}];function ci(n){let t=x6.filter(({key:e})=>n[e]).map(({code:e})=>e);return t.length>0?t.join("+"):""}var qe={paused:!1,showChunkBorders:!1,enableDebugOverlay:!1,debugWasmPerf:!1,debugModelVariant:void 0,futuristicReveal:!1,wasmMesher:!0,mesherWorkers:1,addChunksBatchWaitTime:200,_experimentalSmoothChunkLoading:!0,_renderByChunks:!1,autoLowerRenderDistance:!1,disableMesherConversionCache:!1,dedicatedChangeWorker:!1,shadingTheme:"high-contrast",cardinalLight:"default",dayCycle:!0,smoothLighting:!0,enableLighting:!0,starfield:!0,defaultSkybox:!0,renderEntities:!0,extraBlockRenderers:!0,foreground:!0,fov:75,volume:1,showHand:!1,viewBobbing:!1,handRenderer:"vanilla",renderEars:!0,highlightBlockColor:"blue",fetchPlayerSkins:!0,skinTexturesProxy:void 0,vrSupport:!0,vrPageGameRendering:!0,clipWorldBelowY:void 0,isPlayground:!1,instantCameraUpdate:!1,isRaining:!1,moduleStates:{}},b2={fpsLimit:void 0,powerPreference:void 0,sceneBackground:"lightblue",timeoutRendering:!1},Bl=(n={})=>g2({...qe,...n}),Yt=()=>({reactive:g2({world:{chunksLoaded:new Set,heightmaps:new Map,allChunksLoaded:!1,mesherWork:!1,instabilityFactors:ai(),intersectMedia:null},renderer:"...",preventEscapeMenu:!1}),nonReactive:{fps:0,worstRenderTime:0,avgRenderTime:0,world:{chunksLoaded:new Set,chunksTotalNumber:0},renderer:{timeline:{live:[],frozen:[],lastSecond:[]}}}});x();R();T();k();import{proxy as R6}from"valtio";var di=()=>R6({playerSkin:void 0,inWater:!1,waterBreathing:!1,backgroundColor:[0,0,0],ambientLight:0,directionalLight:0,eyeHeight:0,gameMode:void 0,lookingAtBlock:void 0,diggingBlock:void 0,movementState:"NOT_MOVING",onGround:!0,sneaking:!1,flying:!1,sprinting:!1,walkDist:0,prevWalkDist:0,bob:0,prevBob:0,itemUsageTicks:0,username:"",onlineMode:!1,cardinalLight:"default",lightingDisabled:!1,shouldHideHand:!1,heldItemMain:void 0,heldItemOff:void 0,perspective:"first_person",onFire:!1,cameraSpectatingEntity:void 0,team:void 0}),y2=n=>({isSpectator(){return n.gameMode==="spectator"},isSpectatingEntity(){return n.cameraSpectatingEntity!==void 0&&n.gameMode==="spectator"},isThirdPerson(){return this.isSpectatingEntity()?!1:n.perspective==="third_person_back"||n.perspective==="third_person_front"}}),_2=()=>({reactive:di()});x();R();T();k();import{Vec3 as W6}from"vec3";import{proxy as R2}from"valtio";x();R();T();k();x();R();T();k();x();R();T();k();x();R();T();k();var Y5={},w2=!1;function k6(){if(w2)return Y5;w2=!0;var n=typeof Reflect=="object"?Reflect:null,t=n&&typeof n.apply=="function"?n.apply:function(C,H,B){return Function.prototype.apply.call(C,H,B)},e;n&&typeof n.ownKeys=="function"?e=n.ownKeys:Object.getOwnPropertySymbols?e=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:e=function(C){return Object.getOwnPropertyNames(C)};function i(S){}var r=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}Y5=s,Y5.once=_,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(S){if(typeof S!="number"||S<0||r(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");o=S}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||r(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function v(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}s.prototype.getMaxListeners=function(){return v(this)},s.prototype.emit=function(C){for(var H=[],B=1;B<arguments.length;B++)H.push(arguments[B]);var I=C==="error",N=this._events;if(N!==void 0)I=I&&N.error===void 0;else if(!I)return!1;if(I){var O;if(H.length>0&&(O=H[0]),O instanceof Error)throw O;var j=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw j.context=O,j}var q=N[C];if(q===void 0)return!1;if(typeof q=="function")t(q,this,H);else for(var $=q.length,e0=g(q,$),B=0;B<$;++B)t(e0[B],this,H);return!0};function l(S,C,H,B){var I,N,O;if(a(H),N=S._events,N===void 0?(N=S._events=Object.create(null),S._eventsCount=0):(N.newListener!==void 0&&(S.emit("newListener",C,H.listener?H.listener:H),N=S._events),O=N[C]),O===void 0)O=N[C]=H,++S._eventsCount;else if(typeof O=="function"?O=N[C]=B?[H,O]:[O,H]:B?O.unshift(H):O.push(H),I=v(S),I>0&&O.length>I&&!O.warned){O.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=S,j.type=C,j.count=O.length}return S}s.prototype.addListener=function(C,H){return l(this,C,H,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,H){return l(this,C,H,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(S,C,H){var B={fired:!1,wrapFn:void 0,target:S,type:C,listener:H},I=c.bind(B);return I.listener=H,B.wrapFn=I,I}s.prototype.once=function(C,H){return a(H),this.on(C,d(this,C,H)),this},s.prototype.prependOnceListener=function(C,H){return a(H),this.prependListener(C,d(this,C,H)),this},s.prototype.removeListener=function(C,H){var B,I,N,O,j;if(a(H),I=this._events,I===void 0)return this;if(B=I[C],B===void 0)return this;if(B===H||B.listener===H)--this._eventsCount===0?this._events=Object.create(null):(delete I[C],I.removeListener&&this.emit("removeListener",C,B.listener||H));else if(typeof B!="function"){for(N=-1,O=B.length-1;O>=0;O--)if(B[O]===H||B[O].listener===H){j=B[O].listener,N=O;break}if(N<0)return this;N===0?B.shift():b(B,N),B.length===1&&(I[C]=B[0]),I.removeListener!==void 0&&this.emit("removeListener",C,j||H)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var H,B,I;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[C]),this;if(arguments.length===0){var N=Object.keys(B),O;for(I=0;I<N.length;++I)O=N[I],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(H=B[C],typeof H=="function")this.removeListener(C,H);else if(H!==void 0)for(I=H.length-1;I>=0;I--)this.removeListener(C,H[I]);return this};function f(S,C,H){var B=S._events;if(B===void 0)return[];var I=B[C];return I===void 0?[]:typeof I=="function"?H?[I.listener||I]:[I]:H?A(I):g(I,I.length)}s.prototype.listeners=function(C){return f(this,C,!0)},s.prototype.rawListeners=function(C){return f(this,C,!1)},s.listenerCount=function(S,C){return typeof S.listenerCount=="function"?S.listenerCount(C):m.call(S,C)},s.prototype.listenerCount=m;function m(S){var C=this._events;if(C!==void 0){var H=C[S];if(typeof H=="function")return 1;if(H!==void 0)return H.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]};function g(S,C){for(var H=new Array(C),B=0;B<C;++B)H[B]=S[B];return H}function b(S,C){for(;C+1<S.length;C++)S[C]=S[C+1];S.pop()}function A(S){for(var C=new Array(S.length),H=0;H<C.length;++H)C[H]=S[H].listener||S[H];return C}function _(S,C){return new Promise(function(H,B){function I(O){S.removeListener(C,N),B(O)}function N(){typeof S.removeListener=="function"&&S.removeListener("error",I),H([].slice.call(arguments))}M(S,C,N,{once:!0}),C!=="error"&&w(S,I,{once:!0})})}function w(S,C,H){typeof S.on=="function"&&M(S,"error",C,H)}function M(S,C,H,B){if(typeof S.on=="function")B.once?S.once(C,H):S.on(C,H);else if(typeof S.addEventListener=="function")S.addEventListener(C,function I(N){B.once&&S.removeEventListener(C,I),H(N)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Y5}var Q5=k6();Q5.once;Q5.once=function(n,t){return new Promise((e,i)=>{function r(...o){s!==void 0&&n.removeListener("error",s),e(o)}let s;t!=="error"&&(s=o=>{n.removeListener(name,r),i(o)},n.once("error",s)),n.once(t,r)})};Q5.on=function(n,t){let e=[],i=[],r=null,s=!1,o={async next(){let l=e.shift();if(l)return createIterResult(l,!1);if(r){let c=Promise.reject(r);return r=null,c}return s?createIterResult(void 0,!0):new Promise((c,d)=>i.push({resolve:c,reject:d}))},async return(){n.removeListener(t,a),n.removeListener("error",v),s=!0;for(let l of i)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){r=l,n.removeListener(t,a),n.removeListener("error",v)},[Symbol.asyncIterator](){return this}};return n.on(t,a),n.on("error",v),o;function a(...l){let c=i.shift();c?c.resolve(createIterResult(l,!1)):e.push(l)}function v(l){s=!0;let c=i.shift();c?c.reject(l):r=l,o.return()}};var{EventEmitter:Qt,defaultMaxListeners:Kl,init:Jl,listenerCount:ql,on:Zl,once:Xl}=Q5;import{Vec3 as Kt}from"vec3";x();R();T();k();function Ze(n){let t=n*2+1;if(t<=0)return[];let e=[],i=0,r=0,s=0,o=-1;for(let a=0;a<t*t;a++){if(Math.abs(i)<=t/2&&Math.abs(r)<=t/2&&e.push([i,r]),i===r||i<0&&i===-r||i>0&&i===1-r){let v=s;s=-o,o=v}i+=s,r+=o}return e}var me=n=>[Math.floor(n.x/16),Math.floor(n.z/16)],T6=n=>[Math.floor(n.x/16),Math.floor(n.y/16),Math.floor(n.z/16)],A2=async(n,t,e,i=1)=>{for(let r=0;r<n.length;r+=i)t&&await new Promise(s=>setTimeout(s,t)),await e(n[r],r)},Xe=class Xe extends Qt{static restoreTransferred(t,e){let i=new Xe;return e&&e.addEventListener("message",({data:r})=>{r.class===Xe.restorerName&&r.type==="event"&&i.emit(r.eventName,...r.args)}),i}};u(Xe,"restorerName","WorldViewWorker");var Jt=Xe,qt=class extends Qt{constructor(e,i,r=new Kt(0,0,0)){super();this.world=e;this.viewDistance=i;u(this,"spiralNumber",0);u(this,"gotPanicLastTime",!1);u(this,"panicChunksReload",()=>{});u(this,"loadedChunks",{});u(this,"inLoading",!1);u(this,"chunkReceiveTimes",[]);u(this,"lastChunkReceiveTime",0);u(this,"lastChunkReceiveTimeAvg",0);u(this,"panicTimeout");u(this,"lastPos");u(this,"eventListeners",{});u(this,"debugChunksInfo",{});u(this,"waitingSpiralChunksLoad",{});u(this,"addWaitTime",1);u(this,"keepChunksDistance",0);u(this,"isPlayground",!1);u(this,"allowPositionUpdate",!0);u(this,"lastBiomeId",null);u(this,"lastPosCheck",null);this.lastPos=new Kt(0,0,0).update(r)}prepareForTransfer(e){if(e){let i=this.emit.bind(this);this.emit=(r,...s)=>{i(r,...s),e.postMessage({class:Jt.restorerName,type:"event",eventName:r,args:s})}}return{__restorer:Jt.restorerName}}setBlockStateId(e,i){let r=this.world.setBlockStateId(e,i);if(r&&typeof r.then=="function")throw new Error("setBlockStateId returned promise (not supported)");this.emit("blockUpdate",{pos:e,stateId:i})}updateViewDistance(e){this.viewDistance=e,this.emit("renderDistance",e)}async init(e,i){this.updateViewDistance(this.viewDistance),this.emit("chunkPosUpdate",{pos:e}),i?.time?.timeOfDay!==void 0&&this.emit("time",i.time.timeOfDay),i?.entity&&this.emit("playerEntity",i.entity),this.emitterGotConnected(i);let[r,s]=me(e),o=Ze(this.viewDistance).map(([a,v])=>new Kt((r+a)*16,0,(s+v)*16));this.lastPos.update(e),await this._loadChunks(o,e)}chunkProgress(){if(this.panicTimeout&&clearTimeout(this.panicTimeout),this.chunkReceiveTimes.length>=5){let e=this.chunkReceiveTimes.reduce((r,s)=>r+s,0)/this.chunkReceiveTimes.length;this.lastChunkReceiveTimeAvg=e;let i=e*2+1e3;this.panicTimeout&&clearTimeout(this.panicTimeout),this.panicTimeout=setTimeout(()=>{!this.gotPanicLastTime&&this.inLoading&&(this.gotPanicLastTime=!0,this.panicChunksReload())},i)}}async _loadChunks(e,i){this.spiralNumber++;let{spiralNumber:r}=this;for(let o of Object.keys(this.waitingSpiralChunksLoad))this.waitingSpiralChunksLoad[o](!1),delete this.waitingSpiralChunksLoad[o];let s=!0;this.inLoading=!0,await A2(e,this.addWaitTime,async o=>{!s||this.loadedChunks[`${o.x},${o.z}`]||(this.world.getColumnAt(o)||(s=await new Promise(a=>{this.waitingSpiralChunksLoad[`${o.x},${o.z}`]=a})),s&&(await this.loadChunk(o,void 0,`spiral ${r} from ${i.x},${i.z}`),this.chunkProgress()))}),this.panicTimeout&&clearTimeout(this.panicTimeout),this.inLoading=!1,this.gotPanicLastTime=!1,this.chunkReceiveTimes=[],this.lastChunkReceiveTime=0}async loadChunk(e,i=!1,r="spiral"){var l,c;let[s,o]=me(this.lastPos),a=Math.abs(s-Math.floor(e.x/16)),v=Math.abs(o-Math.floor(e.z/16));if(a<=this.viewDistance&&v<=this.viewDistance){let d=await this.world.getColumnAt(e.y!==void 0?e:new Kt(e.x,0,e.z));if(d){let f=d.toJson(),m={minY:d.minY??0,worldHeight:d.worldHeight??256};this.emit("loadChunk",{x:e.x,z:e.z,chunk:f,blockEntities:d.blockEntities,worldConfig:m,isLightUpdate:i}),this.loadedChunks[`${e.x},${e.z}`]=!0,(l=this.debugChunksInfo)[c=`${e.x},${e.z}`]??(l[c]={loads:[]}),this.debugChunksInfo[`${e.x},${e.z}`].loads.push({dataLength:f.length,reason:r,time:Date.now()})}else this.isPlayground&&this.emit("markAsLoaded",{x:e.x,z:e.z})}}unloadAllChunks(){for(let e of Object.keys(this.loadedChunks)){let[i,r]=e.split(",").map(Number);this.unloadChunk({x:i,z:r})}}unloadChunk(e){this.emit("unloadChunk",{x:e.x,z:e.z}),delete this.loadedChunks[`${e.x},${e.z}`],delete this.debugChunksInfo[`${e.x},${e.z}`]}emitterGotConnected(e){typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope||!e||this.emit("blockEntities",new Proxy({},{get(r,s,o){if(typeof s!="string")return;let[a,v,l]=s.split(",").map(Number);return e.world.getBlock(new Kt(a,v,l))?.entity}}))}updateBiome(e){try{if(!this.world.getBiome)return;let i=this.world.getBiome(e);i!==this.lastBiomeId&&(this.lastBiomeId=i,this.emit("biomeReset"))}catch{}}async updatePosition(e,i=!1){if(!this.allowPositionUpdate)return;let r=e.floored();if(!i&&this.lastPosCheck&&this.lastPosCheck.equals(r))return;this.lastPosCheck=r,this.updateBiome(e);let[s,o]=me(this.lastPos),[a,v]=me(e);if(s!==a||o!==v||i){this.emit("chunkPosUpdate",{pos:e});let l=[],c=i?this.viewDistance:this.viewDistance+this.keepChunksDistance;for(let f of Object.keys(this.loadedChunks)){let[m,g]=f.split(",").map(Number),b=new Kt(m,0,g),[A,_]=me(b),w=Math.abs(a-A),M=Math.abs(v-_);(w>c||M>c)&&l.push(b)}for(let f of l)this.unloadChunk(f);let d=Ze(this.viewDistance).map(([f,m])=>{let g=new Kt((a+f)*16,0,(v+m)*16);if(!this.loadedChunks[`${g.x},${g.z}`])return g}).filter(f=>!!f);this.lastPos.update(e),this._loadChunks(d,e)}else this.emit("chunkPosUpdate",{pos:e}),this.lastPos.update(e)}};x();R();T();k();x();R();T();k();import E2 from"minecraft-data";import M6 from"mc-assets/dist/blocksAtlases.json";import S6 from"mc-assets/dist/itemsAtlases.json";import C6 from"mc-assets/dist/itemDefinitions.json";import P6 from"mc-assets/dist/blocksAtlasLatest.png";import B6 from"mc-assets/dist/blocksAtlasLegacy.png";import I6 from"mc-assets/dist/itemsAtlasLatest.png";import H6 from"mc-assets/dist/itemsAtlasLegacy.png";import O6 from"mc-assets/dist/textureReplacements/christmas";import{AtlasParser as K5}from"mc-assets/dist/atlasParser";import z6 from"mc-assets/dist/worldBlockProvider";import{ItemsRenderer as D6}from"mc-assets/dist/itemsRenderer";import{getLoadedItemDefinitionsStore as F6}from"mc-assets";var pe=class{constructor(t){u(this,"sourceItemDefinitionsJson",C6);u(this,"itemsDefinitionsStore",F6(this.sourceItemDefinitionsJson));u(this,"allReady",!1);u(this,"itemsAtlasImage");u(this,"blocksAtlasImage");u(this,"blocksAtlasJson");u(this,"customBlockStates");u(this,"customModels");u(this,"customItemModelNames",{});u(this,"customTextures",{});u(this,"guiAtlas",null);u(this,"guiAtlasVersion",0);u(this,"itemsRenderer");u(this,"worldBlockProvider");u(this,"blockstatesModels",null);u(this,"version");u(this,"texturesVersion");u(this,"mcData");t&&(Object.assign(this,t),this.mcData=E2(this.version))}prepareForTransfer(){let t={};for(let e in this)Object.prototype.hasOwnProperty.call(this,e)&&typeof this[e]!="function"&&(e==="itemsRenderer"||e==="worldBlockProvider"||e==="mcData"||(t[e]=this[e]));return t.customTextures={},t}},L6="1.21.4",Tt=class Tt extends Qt{constructor(){super(...arguments);u(this,"sourceBlockStatesModels",null);u(this,"sourceBlocksAtlases",M6);u(this,"sourceItemsAtlases",S6);u(this,"currentResources");u(this,"itemsAtlasParser");u(this,"blocksAtlasParser");u(this,"currentConfig");u(this,"abortController",new AbortController);u(this,"_promiseAssetsReadyResolvers",Promise.withResolvers())}static restoreTransferred(e,i){let r=new Tt,s=o=>{r.currentResources=new pe(o)};return s(e.currentResources),i&&i.addEventListener("message",({data:o})=>{o.class===Tt.restorerName&&(o.type==="newResources"&&s(o.currentResources),o.type==="event"&&r.emit(o.eventName,...o.args))}),r}prepareForTransfer(e){if(e){let i=this.emit.bind(this);this.emit=(r,...s)=>{i(r,...s),e.postMessage({class:Tt.restorerName,type:"event",eventName:r,args:s}),(r==="assetsTexturesUpdated"||r==="assetsInventoryReady")&&e.postMessage({class:Tt.restorerName,type:"newResources",currentResources:this.currentResources?.prepareForTransfer()})}}return{__restorer:Tt.restorerName,currentResources:this.currentResources?.prepareForTransfer()}}get promiseAssetsReady(){return this._promiseAssetsReadyResolvers.promise}async loadSourceData(e=this.currentConfig?.version){if(!e)throw new Error("No version loaded");this.sourceBlockStatesModels??(this.sourceBlockStatesModels=(await import("mc-assets/dist/blockStatesModels.json")).default)}resetResources(){this.currentResources=new pe}async updateAssetsData(e,i=!1){if(!this.currentConfig)throw new Error("No config loaded");this._promiseAssetsReadyResolvers=Promise.withResolvers();let r=new AbortController;if(await this.loadSourceData(this.currentConfig.version),r.signal.aborted)return;let s=this.currentResources??new pe;s.version=this.currentConfig.version,s.texturesVersion=this.currentConfig.texturesVersion??s.version,s.mcData=E2(s.version),s.blockstatesModels={blockstates:{},models:{}},s.blockstatesModels.blockstates.latest={...this.sourceBlockStatesModels.blockstates.latest,...s.customBlockStates},s.blockstatesModels.models.latest={...this.sourceBlockStatesModels.models.latest,...s.customModels},await Promise.all([this.recreateBlockAtlas(s),this.recreateItemsAtlas(s)]),!r.signal.aborted&&(s.version&&s.blockstatesModels&&this.itemsAtlasParser&&this.blocksAtlasParser&&(s.itemsRenderer=new D6(s.version,s.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser)),!r.signal.aborted&&(this.currentResources=s,s.allReady=!0,i||this.emit("assetsTexturesUpdated"),this.currentConfig.noInventoryGui?this._promiseAssetsReadyResolvers.resolve():(this.emit("assetsInventoryStarted"),this.generateGuiTextures().then(()=>{r.signal.aborted||(i||this.emit("assetsInventoryReady"),this._promiseAssetsReadyResolvers.resolve())}))))}async recreateBlockAtlas(e=this.currentResources){let i={},r=new Date;(r.getMonth()===11&&r.getDate()>=24||r.getMonth()===0&&r.getDate()<=6)&&Object.assign(i,O6);let s=new K5(this.sourceBlocksAtlases,P6,B6),o=Object.keys(e.customTextures.blocks?.textures??{}),{atlas:a,canvas:v}=await s.makeNewAtlas(e.texturesVersion,l=>{if(this.currentConfig.includeOnlyBlocks&&!this.currentConfig.includeOnlyBlocks.includes(l))return!1;let c=e.customTextures.blocks?.textures[l];return i[l]??c},void 0,void 0,o,{needHorizontalIndexes:!!this.currentConfig.includeOnlyBlocks});this.blocksAtlasParser=new K5({latest:a},v.toDataURL()),e.blocksAtlasImage=await createImageBitmap(v),e.blocksAtlasJson=this.blocksAtlasParser.atlas.latest,e.worldBlockProvider=z6(e.blockstatesModels,this.blocksAtlasParser.atlas,L6)}async recreateItemsAtlas(e=this.currentResources){let i=new K5(this.sourceItemsAtlases,I6,H6),r=Object.keys(e.customTextures.items?.textures??{}),{atlas:s,canvas:o}=await i.makeNewAtlas(e.texturesVersion,a=>{let v=e.customTextures.items?.textures[a];if(v)return v},e.customTextures.items?.tileSize,void 0,r);this.itemsAtlasParser=new K5({latest:s},o.toDataURL()),e.itemsAtlasImage=await createImageBitmap(o)}async generateGuiTextures(){}async downloadDebugAtlas(e=!1){if(!this.currentResources)throw new Error("No resources loaded");let s=await(e?this.itemsAtlasParser:this.blocksAtlasParser).createDebugImage(!0),o=document.createElement("a");o.href=s,o.download=`atlas-debug-${e?"items":"blocks"}.png`,o.click()}destroy(){this.abortController.abort(),this.currentResources=void 0,this.abortController=new AbortController}};u(Tt,"restorerName","ResourcesManager");var lt=Tt;x();R();T();k();var nt=class extends Error{constructor(e,i){super(e);u(this,"failure");this.name="MesherWorkerPreloadError",this.failure=i}};function U6(n){return!n||typeof n!="object"?!1:n.type==="mc-web-pong"?!0:Array.isArray(n)?n.some(t=>t&&typeof t=="object"&&t.type==="mc-web-pong"):!1}var G6=45e3,N6=1e4;async function x2(n){if(D.env.SINGLE_FILE_BUILD)return;let t=n?.fetchTimeoutMs??G6,e=n?.pingTimeoutMs??N6,i=n?.script??"mesher.js",r=new URL(i,document.baseURI).href,s;try{let d=new AbortController,f=window.setTimeout(()=>d.abort(),t);try{s=await fetch(r,{credentials:"same-origin",cache:"force-cache",signal:d.signal})}finally{clearTimeout(f)}}catch(d){let f=d;throw f?.name==="AbortError"?new nt(`Mesher script fetch timed out after ${t}ms (${r}).`,{phase:"fetch",code:"timeout"}):new nt(`Mesher script fetch failed (network): ${f?.message??d}. URL: ${r}`,{phase:"fetch",code:"network",detail:String(f?.message??d)})}if(!s.ok)throw new nt(`Mesher script HTTP ${s.status} ${s.statusText}: ${r}`,{phase:"fetch",code:"bad-status",status:s.status});let o=s.headers.get("content-type")??"",a=await s.arrayBuffer();if(a.byteLength===0)throw new nt(`Mesher script response was empty: ${r}`,{phase:"fetch",code:"invalid-body",hint:"empty"});let v=Math.min(1024,a.byteLength),l=new TextDecoder().decode(a.slice(0,v)).trimStart();if(l.startsWith("<!DOCTYPE")||l.startsWith("<html")||l.startsWith("<HTML"))throw new nt(`Mesher URL returned HTML (wrong path, redirect, or SPA fallback), not JavaScript: ${r}`,{phase:"fetch",code:"invalid-body",hint:"html"});o.length>0&&/javascript|ecmascript/i.test(o);let c;try{c=new Worker(r)}catch(d){let f=d instanceof Error?d.message:String(d);throw new nt(`Could not construct Worker for mesher (${r}): ${f}`,{phase:"worker",code:"construct-failed",message:f})}await new Promise((d,f)=>{let m=!1,g=window.setTimeout(()=>{m||(m=!0,b(),f(new nt(`Mesher worker did not reply with mc-web-pong within ${e}ms (wrong script, SW stale cache, worker blocked, or COEP/CORP). URL: ${r}`,{phase:"ping",code:"timeout"})))},e),b=()=>{clearTimeout(g);let C=c;c=void 0,C&&(C.removeEventListener("message",w),C.removeEventListener("error",M),C.removeEventListener("messageerror",S),C.terminate())},A=()=>{m||(m=!0,b(),d())},_=C=>{m||(m=!0,b(),f(C))};function w(C){U6(C.data)&&A()}function M(C){_(new nt(`Mesher worker script failed to load or threw during startup: ${C.message||"unknown"} @ ${r}`,{phase:"worker",code:"script-error",message:C.message}))}function S(){_(new nt(`Mesher worker message channel error (structured clone / deserialization). URL: ${r}`,{phase:"ping",code:"messageerror"}))}c.addEventListener("message",w),c.addEventListener("error",M),c.addEventListener("messageerror",S);try{c.postMessage({type:"mc-web-ping",t:performance.now(),workerIndex:0})}catch(C){let H=C instanceof Error?C.message:String(C);_(new nt(`Failed to post mc-web-ping to mesher worker: ${H}`,{phase:"ping",code:"post-failed",detail:H}))}})}var k2=class{constructor(t={},e=new lt){this.resourcesManager=e;u(this,"waitBackendLoadPromises",[]);u(this,"onWorldStart");u(this,"onBeforeWorldStart");u(this,"worldView");u(this,"config");u(this,"menuBackgroundOptions");u(this,"inWorldRenderingConfig");u(this,"backend");u(this,"backendLoader");u(this,"currentState");u(this,"currentDisplay",null);u(this,"playerState",{reactive:di()});u(this,"rendererState");u(this,"nonReactiveState");u(this,"worldReady");u(this,"resolveWorldReady");u(this,"lastCamUpdate",0);this.config={...b2,...t.config},this.menuBackgroundOptions={...t.config?.menuBackground,...t.menuBackground},this.inWorldRenderingConfig=R2({...qe,...t.rendererConfig});let i=Yt();this.rendererState=i.reactive,this.nonReactiveState=i.nonReactive,this.initWorldReadyPromise()}initWorldReadyPromise(){let{promise:t,resolve:e}=Promise.withResolvers();this.worldReady=t,this.resolveWorldReady=e}preloadWorkers(){let t=this.inWorldRenderingConfig.wasmMesher?"mesherWasm.js":"mesher.js";return x2({script:t})}async loadBackend(t){this.backend&&this.disconnectBackend(),await Promise.all(this.waitBackendLoadPromises),this.waitBackendLoadPromises=[],this.backendLoader=t;let e={config:this.config,callbacks:{displayCriticalError:r=>{},setRendererSpecificSettings:(r,s)=>{},fireCustomEvent:(r,...s)=>{}},rendererSpecificSettings:{}},i=t(e);if(this.backend=await Promise.resolve(i),this.currentState)if(this.currentState.method==="startMenuBackground")this.startMenuBackground(...this.currentState.args);else{let{method:r,args:s}=this.currentState;this.backend[r](...s)}}async startWorld(t,e,i=this.playerState.reactive,r){if(this.currentDisplay==="world")throw new Error("World already started");this.currentDisplay="world";let s=r??new W6(0,64,0);this.worldView=new qt(t,e,s),this.worldView.isPlayground=this.inWorldRenderingConfig.isPlayground;let o={version:this.resourcesManager?.currentConfig?.version??"1.20.4",worldView:this.worldView,inWorldRenderingConfig:this.inWorldRenderingConfig,playerStateReactive:i,rendererState:this.rendererState,nonReactiveState:this.nonReactiveState,resourcesManager:this.resourcesManager};this.onBeforeWorldStart?.();let a;if(this.backend){let v=this.backend.startWorld(o);v&&typeof v.then=="function"&&(a=v)}return this.currentState={method:"startWorld",args:[o]},await a,this.resolveWorldReady(),this.onWorldStart?.(),!!a}startMenuBackground(t){if(this.currentDisplay==="menu")return;let e={...this.menuBackgroundOptions,...t,resourcesManager:t?.resourcesManager??this.resourcesManager};this.backend&&(this.currentDisplay="menu",this.backend.startMenuBackground(e)),this.currentState={method:"startMenuBackground",args:[e]}}resetBackend(t=!1){this.disconnectBackend(t),this.backendLoader&&this.loadBackend(this.backendLoader)}disconnectBackend(t=!1){t&&(this.currentState=void 0,this.currentDisplay=null,this.worldView=void 0),this.backend&&(this.backend.disconnect(),this.backend=void 0),this.currentDisplay=null,this.initWorldReadyPromise(),this.rendererState=R2(Yt().reactive),this.nonReactiveState=Yt().nonReactive}updateCamera(t,e,i){this.backend?.updateCamera(t,e,i)}setRendering(t){this.backend?.setRendering(t)}async startWithBot(t,e){await this.startWorld(t.world,e),this.worldView&&typeof this.worldView.listenToBot=="function"&&this.worldView.listenToBot(t)}destroyAll(){this.disconnectBackend(!0),this.resourcesManager&&typeof this.resourcesManager.destroy=="function"&&this.resourcesManager.destroy()}get utils(){let t=this.backend;return{async waitingForChunks(){if(!t?.worldState?.allChunksLoaded)return new Promise(e=>{let i=setInterval(()=>{t?.worldState?.allChunksLoaded&&(clearInterval(i),e())},100)})}}}destroy(){this.disconnectBackend(!0)}};x();R();T();k();import{proxy as V6}from"valtio";var T2=()=>V6({playerSkin:void 0,inWater:!1,waterBreathing:!1,backgroundColor:[0,0,0],ambientLight:0,directionalLight:0,eyeHeight:0,gameMode:void 0,lookingAtBlock:void 0,diggingBlock:void 0,movementState:"NOT_MOVING",onGround:!0,sneaking:!1,flying:!1,sprinting:!1,walkDist:0,prevWalkDist:0,bob:0,prevBob:0,itemUsageTicks:0,username:"",onlineMode:!1,cardinalLight:"default",lightingDisabled:!1,shouldHideHand:!1,heldItemMain:void 0,heldItemOff:void 0,perspective:"first_person",onFire:!1,cameraSpectatingEntity:void 0,team:void 0}),j6=n=>({isSpectator(){return n.gameMode==="spectator"},isSpectatingEntity(){return n.cameraSpectatingEntity!==void 0&&n.gameMode==="spectator"},isThirdPerson(){return this.isSpectatingEntity()?!1:n.perspective==="third_person_back"||n.perspective==="third_person_front"}}),Y6=()=>({reactive:T2()}),M2=(n,t,e)=>({...t,"minecraft:date":new Date});x();R();T();k();x();R();T();k();import*as z5 from"three";import{Vec3 as w9}from"vec3";x();R();T();k();import{proxy as Q6,getVersion as C2,subscribe as P2}from"valtio";import{Vec3 as B2}from"vec3";function I2(n,t){let e=t??globalThis;return e.addEventListener("message",i=>{let{type:r,args:s,msgId:o}=i.data;if(n[r]){let a=n[r](...s);a instanceof Promise&&a.then(v=>{e.postMessage({type:"result",msgId:o,args:[v]})})}}),null}var H2=(n,t=!0)=>{let e=0;return new Proxy({},{get(i,r){return r==="transfer"?(...s)=>new Proxy({},{get(o,a){return(...v)=>{n.postMessage({type:a,args:v},s)}}}):(...s)=>{let o=e++,a=t?s.filter(v=>v instanceof ArrayBuffer||v instanceof MessagePort||typeof ImageBitmap<"u"&&v instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&v instanceof OffscreenCanvas||typeof ImageData<"u"&&v instanceof ImageData):[];return n.postMessage({type:r,msgId:o,args:s},a),{then(v){let l=({data:c})=>{c.type==="result"&&c.msgId===o&&(v(c.args[0]),n.removeEventListener("message",l))};n.addEventListener("message",l)}}}}})};var O2=(n,t,e,i)=>{try{e.postMessage({type:"sync",syncId:n,value:J5(t)}),$e.toWorker++,globalThis.debugSyncMessagesOutgoing??(globalThis.debugSyncMessagesOutgoing=0),globalThis.debugSyncMessagesOutgoing++}catch{t5(t)}},$e={toWorker:0,fromWorker:0};typeof window<"u"&&setInterval(()=>{globalThis.debugWorkerSyncStats={...$e},$e.toWorker=0,$e.fromWorker=0},1e3);var K6=()=>Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15),S2=(n,t,e,i,r)=>{if(!n.__syncToWorker&&!n.__syncFromWorker&&!i)return;let s=K6();if(n.__syncId=s,n.__syncToWorker||i){let o=()=>{O2(s,t,e,`toWorker:${r}`)};i&&P2(t,o);let a=n.__syncToWorkerInterval??0;a>0&&setInterval(o,a)}t.__syncFromWorker&&e.addEventListener("message",o=>{o.data.type==="sync"&&o.data.syncId===s&&($e.fromWorker++,Object.assign(t,o.data.value))})},J5=n=>{if(C2(n)===void 0)return n;if(Array.isArray(n))return n.map(J5);if(typeof n=="object"&&n!==null){let t={};for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=J5(n[e]));return t}return n},q5=(n,t,e=!0,i=!0,r=!1)=>{var a,v;let s=n,o={};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){if(e&&typeof n[l]=="function")continue;if(n[l]instanceof Date||n[l]instanceof RegExp||n[l]instanceof Map||n[l]instanceof WeakMap||n[l]instanceof WeakSet,n[l]instanceof Set){o[l]=[...n[l]],o[l].__restorer="Set";continue}if(n[l]instanceof B2){o[l]={x:n[l].x,y:n[l].y,z:n[l].z},o[l].__restorer="Vec3";continue}if(o[l]=n[l],typeof n[l]=="object"&&n[l]!==null){if(n[l].prepareForTransfer){o[l]=n[l].prepareForTransfer(t);continue}let c=C2(n[l])!==void 0;o[l]=c?J5(n[l]):n[l];let d=n[l].__syncToWorker!==!1&&!r&&c&&!n[l].__syncFromWorker;if((a=o[l]).__syncToWorker??(a.__syncToWorker=d),c&&((v=o[l]).__valtio??(v.__valtio=!0)),o[l].__syncToWorker&&c){S2(o[l],s[l],t,!0,l);continue}S2(o[l],s[l],t,!1,l),o[l]=q5(o[l],t,e,!1,c)}}return o},t5=(n,t=[])=>{for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e)){if(!n[e])continue;typeof n[e]=="object"&&n[e]!==null&&t5(n[e],[...t,e]);try{structuredClone(n[e])}catch{}}},J6=(n,t,e)=>{if(!n.__syncId)return;let i=n.__syncId;if(n.__syncToWorker&&t.addEventListener("message",r=>{r.data.type==="sync"&&r.data.syncId===i&&Object.assign(n,r.data.value)}),n.__syncFromWorker){let r=()=>{O2(i,n,t,`fromWorker:${e}`)};n.__valtio&&P2(n,r);let s=n.__syncFromWorkerInterval??0;s>0&&setInterval(r,s)}},q6=[{restorerName:"Set",restoreTransferred(n,t){return new Set(n)}},{restorerName:"Vec3",restoreTransferred(n,t){return new B2(n.x,n.y,n.z)}}];var Z5=(n,t,e,i=!0)=>{let r=[...q6,...t];for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){if(!n[s])continue;if(typeof n[s]=="object"&&n[s]!==null&&Z5(n[s],r,e,i),n[s].__restorer){let o=r.find(a=>a.restorerName?a.restorerName===n[s].__restorer:a.name===n[s].__restorer);if(o)n[s]=o.restoreTransferred(n[s],e);else{let a=new Error(`Restorer ${n[s].__restorer} not found`);if(typeof i=="function")i(a);else if(i)throw a}}n[s].__valtio&&(n[s]=Q6(n[s])),J6(n[s],e,s)}return n};x();R();T();k();var X5=class{constructor(t){this.nonReactiveState=t;u(this,"events",[]);u(this,"frozenEvents",[]);u(this,"lastSecondEvents",[]);u(this,"currentFrameStartTime",null);u(this,"lastInteractionTime",0);u(this,"lastSecondUpdateTime",0);u(this,"timeWindowMs",5e3);u(this,"lastSecondWindowMs",1e3);u(this,"maxEvents",500);u(this,"lastSecondUpdateInterval",1e3);this.nonReactiveState.renderer||(this.nonReactiveState.renderer={timeline:{live:[],frozen:[],lastSecond:[]}}),this.nonReactiveState.renderer.timeline||(this.nonReactiveState.renderer.timeline={live:[],frozen:[],lastSecond:[]}),setInterval(()=>{this.updateLastSecondTimeline()},this.lastSecondUpdateInterval)}markFrameStart(){this.currentFrameStartTime=performance.now(),this.addEvent({type:"frameStart",timestamp:this.currentFrameStartTime})}markFrameEnd(){if(!this.currentFrameStartTime)return;let t=performance.now(),e=t-this.currentFrameStartTime;this.addEvent({type:"frameEnd",timestamp:t,duration:e}),this.currentFrameStartTime=null}markCameraUpdate(t){if(!t)return;let e=performance.now();this.lastInteractionTime=e,this.addEvent({type:"cameraUpdate",timestamp:e}),this.frozenEvents=[...this.events],this.trimEvents(this.frozenEvents),this.syncFrozenEvents()}markFrameDisplay(){this.addEvent({type:"frameDisplay",timestamp:performance.now()})}addEvent(t){this.events.push(t),this.lastSecondEvents.push(t),this.trimEvents(this.events),this.trimLastSecondEvents(),this.syncLiveEvents()}trimEvents(t){let i=performance.now()-this.timeWindowMs;for(;t.length>0&&t[0].timestamp<i;)t.shift();t.length>this.maxEvents&&t.splice(0,t.length-this.maxEvents)}trimLastSecondEvents(){let e=performance.now()-this.lastSecondWindowMs;for(;this.lastSecondEvents.length>0&&this.lastSecondEvents[0].timestamp<e;)this.lastSecondEvents.shift()}updateLastSecondTimeline(){let t=performance.now();t-this.lastSecondUpdateTime<this.lastSecondUpdateInterval||(this.lastSecondUpdateTime=t,this.trimLastSecondEvents(),this.syncLastSecondEvents())}syncLiveEvents(){this.nonReactiveState.renderer.timeline.live=[...this.events]}syncFrozenEvents(){this.nonReactiveState.renderer.timeline.frozen=[...this.frozenEvents]}syncLastSecondEvents(){this.nonReactiveState.renderer.timeline.lastSecond=[...this.lastSecondEvents]}clear(){this.events=[],this.frozenEvents=[],this.lastSecondEvents=[],this.syncLiveEvents(),this.syncFrozenEvents(),this.syncLastSecondEvents()}};x();R();T();k();import*as Q from"three";import{Vec3 as Dt}from"vec3";import X4 from"prismarine-chat";x();R();T();k();var I0=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return this.None(n)},Out:function(n){return this.None(n)},InOut:function(n){return this.None(n)}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var t=1.70158;return n===1?1:n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return n===0?0:--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}}),Bounce:Object.freeze({In:function(n){return 1-I0.Bounce.Out(1-n)},Out:function(n){return n<.36363636363636365?7.5625*n*n:n<.7272727272727273?7.5625*(n-=.5454545454545454)*n+.75:n<.9090909090909091?7.5625*(n-=.8181818181818182)*n+.9375:7.5625*(n-=.9545454545454546)*n+.984375},InOut:function(n){return n<.5?I0.Bounce.In(n*2)*.5:I0.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return Math.pow(t,n)},Out:function(t){return 1-Math.pow(1-t,n)},InOut:function(t){return t<.5?Math.pow(t*2,n)/2:(1-Math.pow(2-t*2,n))/2+.5}}}}),e5=function(){return performance.now()},be=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},n.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},n.prototype.update=function(t,e){t===void 0&&(t=e5()),e===void 0&&(e=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var s=this._tweens[i[r]],o=!e;s&&s.update(t,o)===!1&&!e&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),ge={Linear:function(n,t){var e=n.length-1,i=e*t,r=Math.floor(i),s=ge.Utils.Linear;return t<0?s(n[0],n[1],i):t>1?s(n[e],n[e-1],e-i):s(n[r],n[r+1>e?e:r+1],i-r)},Bezier:function(n,t){for(var e=0,i=n.length-1,r=Math.pow,s=ge.Utils.Bernstein,o=0;o<=i;o++)e+=r(1-t,i-o)*r(t,o)*n[o]*s(i,o);return e},CatmullRom:function(n,t){var e=n.length-1,i=e*t,r=Math.floor(i),s=ge.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(r=Math.floor(i=e*(1+t))),s(n[(r-1+e)%e],n[r],n[(r+1)%e],n[(r+2)%e],i-r)):t<0?n[0]-(s(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(s(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):s(n[r?r-1:0],n[r],n[e<r+1?e:r+1],n[e<r+2?e:r+2],i-r)},Utils:{Linear:function(n,t,e){return(t-n)*e+n},Bernstein:function(n,t){var e=ge.Utils.Factorial;return e(n)/e(t)/e(n-t)},Factorial:function(){var n=[1];return function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}}(),CatmullRom:function(n,t,e,i,r){var s=(e-n)*.5,o=(i-t)*.5,a=r*r,v=r*a;return(2*t-2*e+s+o)*v+(-3*t+3*e-2*s-o)*a+s*r+t}}},z2=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),ui=new be,O0=function(){function n(t,e){e===void 0&&(e=ui),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=I0.Linear.None,this._interpolationFunction=ge.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=z2.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e,this},n.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},n.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},n.prototype.start=function(t,e){if(t===void 0&&(t=e5()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var s in this._valuesEnd)r[s]=this._valuesEnd[s];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},n.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},n.prototype._setupProperties=function(t,e,i,r,s){for(var o in i){var a=t[o],v=Array.isArray(a),l=v?"array":typeof a,c=!v&&Array.isArray(i[o]);if(!(l==="undefined"||l==="function")){if(c){var d=i[o];if(d.length===0)continue;for(var f=[a],m=0,g=d.length;m<g;m+=1){var b=this._handleRelativeValue(a,d[m]);if(isNaN(b)){c=!1;break}f.push(b)}c&&(i[o]=f)}if((l==="object"||v)&&a&&!c){e[o]=v?[]:{};var A=a;for(var _ in A)e[o][_]=A[_];r[o]=v?[]:{};var d=i[o];if(!this._isDynamic){var w={};for(var _ in d)w[_]=d[_];i[o]=d=w}this._setupProperties(A,e[o],d,r[o],s)}else(typeof e[o]>"u"||s)&&(e[o]=a),v||(e[o]*=1),c?r[o]=i[o].slice().reverse():r[o]=e[o]||0}}},n.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},n.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},n.prototype.pause=function(t){return t===void 0&&(t=e5()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},n.prototype.resume=function(t){return t===void 0&&(t=e5()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},n.prototype.group=function(t){return t===void 0&&(t=ui),this._group=t,this},n.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},n.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},n.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},n.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},n.prototype.easing=function(t){return t===void 0&&(t=I0.Linear.None),this._easingFunction=t,this},n.prototype.interpolation=function(t){return t===void 0&&(t=ge.Linear),this._interpolationFunction=t,this},n.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},n.prototype.onStart=function(t){return this._onStartCallback=t,this},n.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},n.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},n.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},n.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},n.prototype.onStop=function(t){return this._onStopCallback=t,this},n.prototype.update=function(t,e){if(t===void 0&&(t=e5()),e===void 0&&(e=!0),this._isPaused)return!0;var i,r,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>s)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),r=(t-this._startTime)/this._duration,r=this._duration===0||r>1?1:r;var o=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,v=this._chainedTweens.length;a<v;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(t,e,i,r){for(var s in i)if(e[s]!==void 0){var o=e[s]||0,a=i[s],v=Array.isArray(t[s]),l=Array.isArray(a),c=!v&&l;c?t[s]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[s],o,a,r):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[s]=o+(a-o)*r))}},n.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},n.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},n}();var Xd=z2.nextId,dt=ui,$d=dt.getAll.bind(dt),tu=dt.removeAll.bind(dt),eu=dt.add.bind(dt),iu=dt.remove.bind(dt),D2=dt.update.bind(dt);x();R();T();k();x();R();T();k();var Z6=()=>{if(typeof OffscreenCanvas>"u")return!1;try{let n=new OffscreenCanvas(1,1);return(n.getContext("webgl2")||n.getContext("webgl"))!==null}catch{return!1}},X6=Z6(),W0=(n,t)=>{if(X6)return new OffscreenCanvas(n,t);let e=document.createElement("canvas");return e.width=n,e.height=t,e};async function $5(n){let e=await(await fetch(n)).blob();return createImageBitmap(e)}var $6=(n,t)=>{try{return JSON.parse(n)}catch{return null}},ta={black:"#000000",dark_blue:"#0000AA",dark_green:"#00AA00",dark_aqua:"#00AAAA",dark_red:"#AA0000",dark_purple:"#AA00AA",gold:"#FFAA00",gray:"#AAAAAA",dark_gray:"#555555",blue:"#5555FF",green:"#55FF55",aqua:"#55FFFF",red:"#FF5555",light_purple:"#FF55FF",yellow:"#FFFF55",white:"#FFFFFF"},t1=(n,t,e,i=s=>{},r=(s,o)=>W0(s,o))=>{let a=[16,9],v=a[0]-a[1],l=v/16,c="front_text"in n?n.front_text.messages:[n.Text1,n.Text2,n.Text3,n.Text4];if(!c.some(g=>g!=="null"))return;let d=r(16*40,v*40),f=d.getContext("2d");i(f);let m=("front_text"in n?n.front_text.color:n.Color)||"black";for(let[g,b]of c.slice(0,4).entries())b!=="null"&&fi(b,e,d,64,m,64*(g+1)+(t?0:-8));return d},fi=(n,t,e,i,r,s=0)=>{let o=!1,a=typeof n=="string"&&(n?.startsWith("{")||n?.startsWith('"'))?$6(n??'""',"sign text"):n;if(!a||typeof a!="object"&&typeof a!="string")return;let v=e.getContext("2d");if(!v)throw new Error("Could not get 2d context");v.imageSmoothingEnabled=!1,v.font=`${i}px mojangles`;let l=new t(a),c=[],d=!1,f="",m=s,g=[],b=(M,S)=>{M.text!==null&&M.text!==void 0&&M.text;let C=M.text===null||M.text===void 0?void 0:String(M.text),H={color:M.color??S?.color,underlined:M.underlined??S?.underlined,strikethrough:M.strikethrough??S?.strikethrough,bold:M.bold??S?.bold,italic:M.italic??S?.italic};if(d=d||H.underlined||H.strikethrough||!1,C?.includes(`
|
|
14
|
-
`))for(let
|
|
15
|
-
`))A(B,H),m+=i,f="";else C&&A(C,H);if(M.extra)for(let B of M.extra)b(B,H)},A=(M,S)=>{o||(o=M.trim()!==""),f+=M,g[m]=v.measureText(f).width;let C=S.color??r;C.startsWith("#")||(C=ta[C.toLowerCase()]||C),c.push({fontStyle:`${S.bold?"bold":""} ${S.italic?"italic":""}`,fillStyle:C,underlineStyle:S.underlined??!1,strikeStyle:S.strikethrough??!1,offset:m,text:M})};if(b(l),!d&&!l.toString().trim())return;let _=0,w=0;for(let{fillStyle:M,fontStyle:S,underlineStyle:C,strikeStyle:H,offset:B,text:I}of c){w!==B&&(_=0),w=B,v.fillStyle=M,v.textRendering="optimizeLegibility",v.font=`${S} ${i}px mojangles`;let N=g[B]??v.measureText(I).width,O=(e.width-N)/2+_;v.fillText(I,O,B),H&&(v.lineWidth=i/8,v.strokeStyle=M,v.beginPath(),v.moveTo(O,B-v.lineWidth*2.5),v.lineTo(O+v.measureText(I).width,B-v.lineWidth*2.5),v.stroke()),C&&(v.lineWidth=i/8,v.strokeStyle=M,v.beginPath(),v.moveTo(O,B+v.lineWidth),v.lineTo(O+v.measureText(I).width,B+v.lineWidth),v.stroke()),_+=v.measureText(I).width}return o};x();R();T();k();function ye(n){let t=Math.floor(n.x/16),e=Math.floor(n.z/16);return[t,e]}function hi(n){let t=Math.floor(n.x/16),e=Math.floor(n.y/16),i=Math.floor(n.z/16);return[t,e,i]}x();R();T();k();import{Vec3 as o5}from"vec3";import{subscribeKey as Si}from"valtio/utils";import{proxy as da,subscribe as ua}from"valtio";x();R();T();k();var i5={blocks:"blocksArray",blockCollisionShapes:"blockCollisionShapes",biomes:"biomesArray"};x();R();T();k();var F2=16;var L2=(n,t)=>t?`${n}:${t}`:String(n);x();R();T();k();x();R();T();k();var gi=Qe(U2(),1);import*as r1 from"three";x();R();T();k();x();R();T();k();var e1=class{constructor(t,e,i){this.name=t,this.fg=e,this.bg=i,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement("canvas"),this.canvas.width=90*this.PR,this.canvas.height=48*this.PR,this.canvas.style.width="90px",this.canvas.style.position="absolute",this.canvas.style.height="48px",this.canvas.style.cssText="width:90px;height:48px",this.context=this.canvas.getContext("2d"),this.context&&(this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(t,e,i,r,s=0){let o=1/0,a=0;this.context&&(o=Math.min(o,t),a=Math.max(i,t),r=Math.max(r,e),this.context.fillStyle=this.bg,this.context.globalAlpha=1,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(t.toFixed(s)+" "+this.name+" ("+o.toFixed(s)+"-"+parseFloat(a.toFixed(s))+")",this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT),this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,(1-e/r)*this.GRAPH_HEIGHT))}};var G2=class i1{constructor({logsPerSecond:t=20,samplesLog:e=100,samplesGraph:i=10,precision:r=2,minimal:s=!1,horizontal:o=!0,mode:a=0}={}){this.mode=a,this.horizontal=o,this.container=document.createElement("div"),this.container.style.cssText="position:fixed;top:0;left:0;opacity:0.9;z-index:10000;",s&&(this.container.style.cssText+="cursor:pointer"),this.gl=null,this.query=null,this.minimal=s,this.beginTime=(performance||Date).now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.frames=0,this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.queryCreated=!1,this.fpsPanel=this.addPanel(new i1.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new i1.Panel("CPU","#0f0","#020"),1),this.gpuPanel=null,this.samplesLog=e,this.samplesGraph=i,this.precision=r,this.logsPerSecond=t,this.minimal?(this.container.addEventListener("click",v=>{v.preventDefault(),this.showPanel(++this.mode%this.container.children.length)},!1),this.mode=a,this.showPanel(this.mode)):window.addEventListener("resize",()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2)})}resizePanel(t,e){t.canvas.style.position="absolute",this.minimal?t.canvas.style.display="none":(t.canvas.style.display="block",this.horizontal?(t.canvas.style.top="0px",t.canvas.style.left=e*t.WIDTH/t.PR+"px"):(t.canvas.style.left="0px",t.canvas.style.top=e*t.HEIGHT/t.PR+"px"))}addPanel(t,e){return t.canvas&&(this.container.appendChild(t.canvas),this.resizePanel(t,e)),t}showPanel(t){for(let e=0;e<this.container.children.length;e++){let i=this.container.children[e];i.style.display=e===t?"block":"none"}this.mode=t}init(t){if(t){if(t instanceof WebGL2RenderingContext)this.gl=t;else if(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas){if(this.gl=t.getContext("webgl2"),!this.gl)return}else return;this.ext=this.gl.getExtension("EXT_disjoint_timer_query_webgl2"),this.ext&&(this.gpuPanel=this.addPanel(new i1.Panel("GPU","#ff0","#220"),2))}}begin(){if(this.beginProfiling("cpu-started"),!(!this.gl||!this.ext)){if(this.query){let t=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT_AVAILABLE);if(this.disjoint=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT),t&&!this.disjoint){this.ns=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT);let e=this.ns*1e-6;(t||this.disjoint)&&(this.gl.deleteQuery(this.query),this.query=null),t&&this.addToAverage(e,this.averageGpu)}}this.query||(this.queryCreated=!0,this.query=this.gl.createQuery(),this.query&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.query))}}end(){this.beginTime=this.endInternal(),this.endProfiling("cpu-started","cpu-finished","cpu-duration",this.averageCpu),!(!this.gl||!this.ext)&&this.queryCreated&&this.gl.getQuery(this.ext.TIME_ELAPSED_EXT,this.gl.CURRENT_QUERY)&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT)}endInternal(){this.frames++;let t=(performance||Date).now();if(t>=this.prevCpuTime+1e3/this.logsPerSecond&&(this.updatePanel(this.msPanel,this.averageCpu),this.updatePanel(this.gpuPanel,this.averageGpu),this.prevCpuTime=t),t>=this.prevTime+1e3){let e=this.frames*1e3/(t-this.prevTime);this.fpsPanel.update(e,e,100,100,0),this.prevTime=t,this.frames=0}return t}addToAverage(t,e){e.logs.push(t),e.logs.length>this.samplesLog&&e.logs.shift(),e.graph.push(t),e.graph.length>this.samplesGraph&&e.graph.shift()}beginProfiling(t){window.performance&&window.performance.mark(t)}endProfiling(t,e,i,r){if(window.performance&&e){window.performance.mark(e);let s=performance.measure(i,t,e);this.addToAverage(s.duration,r)}}updatePanel(t,e){if(e.logs.length>0){let i=0,r=.01;for(let a=0;a<e.logs.length;a++)i+=e.logs[a],e.logs[a]>r&&(r=e.logs[a]);let s=0,o=.01;for(let a=0;a<e.graph.length;a++)s+=e.graph[a],e.graph[a]>o&&(o=e.graph[a]);t&&t.update(i/Math.min(e.logs.length,this.samplesLog),s/Math.min(e.graph.length,this.samplesGraph),r,o,this.precision)}}};G2.Panel=e1;var N2=G2;var x0=typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope,bi=class{constructor(t,e=0){this.canvas=t;u(this,"stats");u(this,"stats2");u(this,"statsGl");u(this,"total",0);u(this,"denseMode");this.stats=new gi.default,this.stats2=new gi.default,this.statsGl=new N2({minimal:!0}),this.stats2.showPanel(2),this.denseMode=typeof D<"u"&&!0||typeof window<"u"&&window.innerHeight<500,this.initStats(),this.setVisibility(e)}addStat(t,e=80){t.style.position="absolute",this.denseMode&&(t.style.height="12px"),t.style.overflow="hidden",t.style.left="",t.style.top="0",t.style.right=`${this.total}px`,t.style.width="80px",t.style.zIndex="1",t.style.opacity="0.8";let i=document.getElementById("corner-indicator-stats"),r=i??document.body;i&&(t.style.position="relative"),r.appendChild(t),this.total+=e}initStats(){let t=this.stats2.dom.children.length===3;this.addStat(this.stats.dom),t&&this.addStat(this.stats2.dom),this.statsGl.init(this.canvas),this.statsGl.container.style.display="flex",this.statsGl.container.style.justifyContent="flex-end";let e=0;for(let i of this.statsGl.container.children){let r=i;e++===0&&(r.style.display="none"),r.style.position=""}}setVisibility(t){t>0?(this.stats.dom.style.display="block",this.stats2.dom.style.display=t>=2?"block":"none",this.statsGl.container.style.display=t>=2?"block":"none"):(this.stats.dom.style.display="none",this.stats2.dom.style.display="none",this.statsGl.container.style.display="none")}markStart(){this.stats.begin(),this.stats2.begin(),this.statsGl.begin()}markEnd(){this.stats.end(),this.stats2.end(),this.statsGl.end()}dispose(){this.stats.dom.remove(),this.stats2.dom.remove(),this.statsGl.container.remove()}},r5=class{constructor(t,e,i){this.initOptions=t;this.externalCanvas=e;u(this,"canvas");u(this,"renderer");u(this,"animationFrameId");u(this,"timeoutId");u(this,"lastRenderTime",0);u(this,"previousCanvasWidth",0);u(this,"previousCanvasHeight",0);u(this,"currentWidth",0);u(this,"currentHeight",0);u(this,"pendingResize",!1);u(this,"renderedFps",0);u(this,"fpsInterval");u(this,"stats");u(this,"paused",!1);u(this,"disconnected",!1);u(this,"preRender",()=>{});u(this,"render",t=>{});u(this,"postRender",()=>{});u(this,"sizeChanged",()=>{});u(this,"droppedFpsPercentage",0);u(this,"config");u(this,"onRender",[]);u(this,"inWorldRenderingConfig");u(this,"nonReactiveState");this.config=t.config,e?this.canvas=e:this.addToPage();try{this.renderer=new r1.WebGLRenderer({canvas:this.canvas,preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0,powerPreference:this.config.powerPreference})}catch(s){throw t.callbacks.displayCriticalError(new Error(`Failed to create WebGL context, not possible to render (restart browser): ${s.message}`)),s}this.renderer.useLegacyLights=!0,this.renderer.outputColorSpace=r1.LinearSRGBColorSpace,e||(this.updatePixelRatio(),this.setupResizeListener()),this.sizeUpdated(),this.previousCanvasWidth=this.canvas.width,this.previousCanvasHeight=this.canvas.height;let r="WebGL2RenderingContext"in globalThis;!e&&r&&!x0&&(this.stats=new bi(this.canvas,this.config.statsVisible)),this.setupFpsTracking(),this.startRenderLoop()}setupResizeListener(){if(typeof window>"u")return;let t,e=()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.pendingResize=!0},16)};window.addEventListener("resize",e,{passive:!0})}updatePixelRatio(){if(typeof window>"u")return;let t=window.devicePixelRatio||1;this.renderer.capabilities.isWebGL2||(t=1),this.renderer.setPixelRatio(t)}sizeUpdated(){this.renderer.setSize(this.currentWidth,this.currentHeight,!1)}addToPage(){this.canvas=W2(),this.updateCanvasSize()}updateSizeExternal(t,e,i){this.currentWidth=t,this.currentHeight=e,this.renderer.setPixelRatio(i),this.sizeUpdated()}updateCanvasSize(){if(this.externalCanvas||typeof document>"u")return;let t=document.body.offsetWidth,e=document.body.offsetHeight;this.currentWidth!==t&&(this.currentWidth=t),this.currentHeight!==e&&(this.currentHeight=e)}setupFpsTracking(){let t=0;this.fpsInterval=setInterval(()=>{t>0&&(this.droppedFpsPercentage=this.renderedFps/t),t=Math.max(this.renderedFps,t),this.nonReactiveState&&(this.nonReactiveState.fps=this.renderedFps),this.renderedFps=0},1e3)}startRenderLoop(){let t=()=>{if(this.disconnected)return;if(this.config.timeoutRendering){let r=1e3/(this.config.fpsLimit?Math.min(this.config.fpsLimit,60):60);this.timeoutId=setTimeout(t,r)}else this.animationFrameId=requestAnimationFrame(t);if(this.paused||this.renderer.xr.isPresenting&&!this.inWorldRenderingConfig?.vrPageGameRendering)return;if(!this.config.timeoutRendering&&this.config.fpsLimit){let i=performance.now(),r=i-this.lastRenderTime,s=1e3/this.config.fpsLimit;if(r<s)return;this.lastRenderTime=i-r%s}let e=!1;this.pendingResize&&(this.updateCanvasSize(),this.pendingResize=!1),(this.previousCanvasWidth!==this.currentWidth||this.previousCanvasHeight!==this.currentHeight)&&(this.previousCanvasWidth=this.currentWidth,this.previousCanvasHeight=this.currentHeight,this.sizeUpdated(),e=!0),this.frameRender(e),this.config.statsVisible!==void 0&&this.stats?.setVisibility(this.config.statsVisible)};t()}frameRender(t){this.preRender(),this.stats?.markStart(),D2(),globalThis.freezeRender||this.render(t);for(let e of this.onRender)e(t);this.renderedFps++,this.stats?.markEnd(),this.postRender()}setPaused(t){this.paused=t}dispose(){this.disconnected=!0,this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.timeoutId&&clearTimeout(this.timeoutId),this.canvas instanceof HTMLCanvasElement&&this.canvas.remove(),clearInterval(this.fpsInterval),this.stats?.dispose(),this.renderer.dispose()}};function W2(){let n=document.createElement("canvas");return n.id="viewer-canvas",document.body.appendChild(n),n}var yi=()=>{let n=W2(),t=n.transferControlToOffscreen(),e=!1,i=(o,a)=>{},r={width:0,height:0},s=()=>{e||((r.width!==window.innerWidth||r.height!==window.innerHeight)&&(i(window.innerWidth,window.innerHeight),r={width:window.innerWidth,height:window.innerHeight}),requestAnimationFrame(s))};return requestAnimationFrame(s),{canvas:t,destroy(){e=!0,n.remove()},onSizeChanged(o){i=o},get size(){return{width:window.innerWidth,height:window.innerHeight}}}};var V2=0,bt={},_i=40,n5="mc-renderer-debug-overlay",_e=(n,t=80,e=V2,i=_i,r)=>{if(x0)return{updateText(){},setVisibility(){}};let s=document.createElement("div");return s.style.position="fixed",s.style.top=`${i??_i}px`,s.style.right=`${e}px`,s.style.backgroundColor="rgba(0, 0, 0, 0.7)",s.style.color="white",s.style.padding="2px",s.style.fontFamily="monospace",s.style.fontSize="12px",r?.className?s.className=r.className:s.style.zIndex="100",s.style.pointerEvents="none",document.body.appendChild(s),bt[n]=s,i===void 0&&e===V2&&(_i+=20),{updateText(o){s.innerText!==o&&(s.innerText=o)},setVisibility(o){s.style.display=o?"block":"none"}}};var wi=(n,t)=>{x0||!bt[n]||(bt[n].innerText=t)},j2=n=>{if(!x0)for(let t in bt)bt[t].style.display=n?"block":"none"},Y2=()=>{if(!x0)for(let n in bt)ea(n)},ea=n=>{x0||!bt[n]||(bt[n].remove(),delete bt[n])};x();R();T();k();x();R();T();k();x();R();T();k();x();R();T();k();function Ai(n,t,e,i,r){let s=n.getImageData(t,e,i,r);for(let o=0;o<i;o++)for(let a=0;a<r;a++){let v=(o+a*i)*4;if(s.data[v+3]!==255)return!0}return!1}function n1(n){return n/64}function Q2(n,t,e){if(e){if(Ai(n,0,0,t,t))return}else if(Ai(n,0,0,t,t/2))return;let i=n1(t),r=(s,o,a,v)=>n.clearRect(s*i,o*i,a*i,v*i);r(40,0,8,8),r(48,0,8,8),r(32,8,8,8),r(40,8,8,8),r(48,8,8,8),r(56,8,8,8),e&&(r(4,32,4,4),r(8,32,4,4),r(0,36,4,12),r(4,36,4,12),r(8,36,4,12),r(12,36,4,12),r(20,32,8,4),r(28,32,8,4),r(16,36,4,12),r(20,36,8,12),r(28,36,4,12),r(32,36,8,12),r(44,32,4,4),r(48,32,4,4),r(40,36,4,12),r(44,36,4,12),r(48,36,4,12),r(52,36,12,12),r(4,48,4,4),r(8,48,4,4),r(0,52,4,12),r(4,52,4,12),r(8,52,4,12),r(12,52,4,12),r(52,48,4,4),r(56,48,4,4),r(48,52,4,12),r(52,52,4,12),r(56,52,4,12),r(60,52,4,12))}function ia(n,t){n.save(),n.scale(-1,1);let e=n1(t),i=(r,s,o,a,v,l)=>n.drawImage(n.canvas,r*e,s*e,o*e,a*e,-v*e,l*e,-o*e,a*e);i(4,16,4,4,20,48),i(8,16,4,4,24,48),i(0,20,4,12,24,52),i(4,20,4,12,20,52),i(8,20,4,12,16,52),i(12,20,4,12,28,52),i(44,16,4,4,36,48),i(48,16,4,4,40,48),i(40,20,4,12,40,52),i(44,20,4,12,36,52),i(48,20,4,12,32,52),i(52,20,4,12,44,52),n.restore()}function Ei(n,t){let e=!1;if(t.width!==t.height)if(t.width===2*t.height)e=!0;else throw new Error(`Bad skin size: ${t.width}x${t.height}`);let i=n.getContext("2d",{willReadFrequently:!0});if(e){let r=t.width;n.width=r,n.height=r,i.clearRect(0,0,r,r),i.drawImage(t,0,0,r,r/2),ia(i,r),Q2(i,n.width,!1)}else n.width=t.width,n.height=t.height,i.clearRect(0,0,t.width,t.height),i.drawImage(t,0,0,n.width,n.height),Q2(i,n.width,!0)}function ra(n){if(n.width===2*n.height)return n.width/64;if(n.width*17===n.height*22)return n.width/22;if(n.width*11===n.height*23)return n.width/46;throw new Error(`Bad cape size: ${n.width}x${n.height}`)}function xi(n,t){let e=ra(t);n.width=64*e,n.height=32*e;let i=n.getContext("2d",{willReadFrequently:!0});i.clearRect(0,0,n.width,n.height),i.drawImage(t,0,0,t.width,t.height)}function na(n,t,e,i,r){let s=n.getImageData(t,e,i,r);for(let o=0;o<i;o++)for(let a=0;a<r;a++){let v=(o+a*i)*4;if(!(s.data[v+0]===0&&s.data[v+1]===0&&s.data[v+2]===0&&s.data[v+3]===255))return!1}return!0}function sa(n,t,e,i,r){let s=n.getImageData(t,e,i,r);for(let o=0;o<i;o++)for(let a=0;a<r;a++){let v=(o+a*i)*4;if(!(s.data[v+0]===255&&s.data[v+1]===255&&s.data[v+2]===255&&s.data[v+3]===255))return!1}return!0}function Ri(n){let t=n1(n.width),e=n.getContext("2d",{willReadFrequently:!0}),i=(a,v,l,c)=>Ai(e,a*t,v*t,l*t,c*t),r=(a,v,l,c)=>na(e,a*t,v*t,l*t,c*t),s=(a,v,l,c)=>sa(e,a*t,v*t,l*t,c*t);return i(50,16,2,4)||i(54,20,2,12)||i(42,48,2,4)||i(46,52,2,12)||r(50,16,2,4)&&r(54,20,2,12)&&r(42,48,2,4)&&r(46,52,2,12)||s(50,16,2,4)&&s(54,20,2,12)&&s(42,48,2,4)&&s(46,52,2,12)?"slim":"default"}function ki(n,t){if(t.width!==t.height&&t.width!==2*t.height)throw new Error(`Bad skin size: ${t.width}x${t.height}`);let e=n1(t.width),i=14*e,r=7*e;n.width=i,n.height=r;let s=n.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,i,r),s.drawImage(t,24*e,0,i,r,0,0,i,r)}x();R();T();k();import oa from"mc-assets/dist/other-textures/latest/entity/player/wide/steve.png";x();R();T();k();import*as yt from"three";var R0=(n,t=!1)=>{n instanceof yt.Mesh&&(n.geometry?.dispose?.(),n.material?.dispose?.()),n.children&&n.children.forEach(e=>R0(e,t)),t&&n instanceof yt.Mesh&&n.material?.map?.dispose?.()},Ti={},K2={},s1=n=>{let t=new yt.Texture,e=$5(n).then(i=>{let r=new OffscreenCanvas(i.width,i.height);return r.getContext("2d").drawImage(i,0,0),t.source.data=r,t.needsUpdate=!0,t});return{texture:t,promise:e}},St=async n=>s1(n).texture,s5=n=>{let t=W0(n.width,n.height);t.getContext("2d").drawImage(n,0,0);let i=new yt.Texture(t);return i.magFilter=yt.NearestFilter,i.minFilter=yt.NearestFilter,i};async function o1(n,t,e){if(!Ti[n]){let{promise:r,resolve:s}=Promise.withResolvers(),o=s1(n);Ti[n]=o.texture,o.promise.then(s),K2[n]=r}t(Ti[n]),K2[n].then(()=>{e?.()})}var ut=oa,Gf=St(ut),J2={apiEnabled:!0},q2=n=>{Object.assign(J2,n)};async function Ct(n,t){if(!J2.apiEnabled||t==="cape")return;let e=`https://playerdb.co/api/player/minecraft/${n}`,i=await fetch(e);return i.ok?(await i.json()).data.player.skin_texture:void 0}async function Zt(n){n.startsWith("data:")||(n=await aa(n.replace("http://","https://")));let t=await $5(n),e=W0(64,64);return Ei(e,t),{canvas:e,image:t}}var aa=async n=>{let e=await(await fetch(n,{})).arrayBuffer();return`data:image/png;base64,${F.from(e).toString("base64")}`};x();R();T();k();var va=n=>{let t=n%24e3/24e3-.25;return t<0&&(t+=1),t>1&&(t-=1),t+(1-Math.cos(t*Math.PI))/2},la=n=>{let t=(n%24e3+24e3)%24e3,e=va(t),r=Math.cos(e*Math.PI*2)*.5+.5,s=Math.round(4+r*11);return Math.max(4,Math.min(15,s))},Mi=n=>{let t=(n%24e3+24e3)%24e3;if(t>=0&&t<12e3)return 15;if(t>=12e3&&t<13e3){let e=(t-12e3)/1e3;return Math.round(15-e*11)}else{if(t>=13e3&&t<23e3)return 4;{let e=(t-23e3)/1e3;return Math.round(4+e*11)}}},ca=()=>{let n=[{ticks:0,label:"6:00 AM (sunrise)"},{ticks:6e3,label:"12:00 PM (noon)"},{ticks:12e3,label:"6:00 PM (sunset starts)"},{ticks:12500,label:"6:30 PM (sunset mid)"},{ticks:13e3,label:"7:00 PM (night begins)"},{ticks:18e3,label:"12:00 AM (midnight)"},{ticks:19e3,label:"1:00 AM"},{ticks:23e3,label:"5:00 AM (dawn begins)"},{ticks:23500,label:"5:30 AM (dawn mid)"}];for(let{ticks:t,label:e}of n){let i=la(t),r=Mi(t)}};typeof window<"u"&&(window.debugSkyLight=ca);function a5(n,t){return(n%t+t)%t}var _t=class _t{constructor(t,e,i){this.resourcesManager=t;this.displayOptions=e;this.initOptions=i;u(this,"worldReadyResolvers",Promise.withResolvers());u(this,"worldReadyPromise",this.worldReadyResolvers.promise);u(this,"timeOfTheDay",0);u(this,"worldSizeParams",{minY:0,worldHeight:256});u(this,"reactiveDebugParams",da({stopRendering:!1,chunksRenderAboveOverride:void 0,chunksRenderAboveEnabled:!1,chunksRenderBelowOverride:void 0,chunksRenderBelowEnabled:!1,chunksRenderDistanceOverride:void 0,chunksRenderDistanceEnabled:!1,disableEntities:!1}));u(this,"active",!1);u(this,"loadedChunks",{});u(this,"finishedChunks",{});u(this,"finishedSections",{});u(this,"sectionsWaiting",new Map);u(this,"queuedChunks",new Set);u(this,"queuedFunctions",[]);u(this,"renderUpdateEmitter",new Qt);u(this,"customTexturesDataUrl");u(this,"workers",[]);u(this,"viewerChunkPosition");u(this,"lastViewerChunkGridX");u(this,"lastViewerChunkGridZ");u(this,"lastCamUpdate",0);u(this,"droppedFpsPercentage",0);u(this,"initialChunkLoadWasStartedIn");u(this,"initialChunksLoad",!0);u(this,"enableChunksLoadDelay",!1);u(this,"texturesVersion");u(this,"viewDistance",-1);u(this,"onRenderDistanceChanged");u(this,"chunksLength",0);u(this,"allChunksFinished",!1);u(this,"messageQueue",[]);u(this,"isProcessingQueue",!1);u(this,"ONMESSAGE_TIME_LIMIT",30);u(this,"handleResize",()=>{});u(this,"highestBlocksByChunks",new Map);u(this,"blockEntities",{});u(this,"workersProcessAverageTime",0);u(this,"workersProcessAverageTimeCount",0);u(this,"maxWorkersProcessTime",0);u(this,"workersPreAverageTime",0);u(this,"workersWasmAverageTime",0);u(this,"workersPostAverageTime",0);u(this,"workersPhaseSampleCount",0);u(this,"workersPreTargetConvertAverageTime",0);u(this,"workersPreNeighborConvertAverageTime",0);u(this,"workersPreNeighborCountAverage",0);u(this,"workersPreTypedArrayBuildAverageTime",0);u(this,"workersPreOtherAverageTime",0);u(this,"workersPreCacheHitsTotal",0);u(this,"workersPreCacheMissesTotal",0);u(this,"geometryReceiveCount",{});u(this,"allLoadedIn");u(this,"onWorldSwitched",[]);u(this,"renderTimeMax",0);u(this,"renderTimeAvg",0);u(this,"renderTimeAvgCount",0);u(this,"edgeChunks",{});u(this,"lastAddChunk",null);u(this,"neighborChunkUpdates",!0);u(this,"lastChunkDistance",0);u(this,"debugStopGeometryUpdate",!1);u(this,"protocolCustomBlocks",new Map);u(this,"heightmapDebounceTimers",new Map);u(this,"sectionDirtyCount",new Map);u(this,"sectionDirtyTimers",new Map);u(this,"sectionDirtyPendingArgs",new Map);u(this,"blockStateModelInfo",new Map);u(this,"worldBlockProvider");u(this,"soundSystem");u(this,"worldRendererConfig");u(this,"playerStateReactive");u(this,"playerStateUtils");u(this,"reactiveState");u(this,"mesherLogReader");u(this,"forceCallFromMesherReplayer",!1);u(this,"stopMesherMessagesProcessing",!1);u(this,"abortController",new AbortController);u(this,"lastRendered",0);u(this,"renderingActive",!0);u(this,"geometryReceiveCountPerSec",0);u(this,"mesherLogger",{contents:[],active:new URL(location.href).searchParams.get("mesherlog")==="true"});u(this,"currentRenderedFrames",0);u(this,"fpsAverage",0);u(this,"lastFps",0);u(this,"fpsWorst");u(this,"fpsSamples",0);u(this,"backendInfoReport","-");u(this,"chunksFullInfo","-");u(this,"workerCustomHandleTime",0);u(this,"queueAwaited",!1);u(this,"toWorkerMessagesQueue",{});this.snapshotInitialValues(),this.worldRendererConfig=e.inWorldRenderingConfig,this.playerStateReactive=e.playerStateReactive,this.playerStateUtils=y2(this.playerStateReactive),this.reactiveState=e.rendererState,this.renderUpdateEmitter.on("update",()=>{let o=Object.keys(this.finishedChunks).length;wi("loaded-chunks",`${o}/${this.chunksLength} chunks (${this.lastChunkDistance}/${this.viewDistance})`)}),_e("downloaded-chunks",100,140,20,{className:n5}),this.connect(this.displayOptions.worldView);let r=setInterval(()=>{this.geometryReceiveCountPerSec=Object.values(this.geometryReceiveCount).reduce((o,a)=>o+a,0),this.geometryReceiveCount={},j2(this.displayAdvancedStats),this.updateChunksStats()},500),s=setInterval(()=>{this.fpsUpdate()},1e3);this.abortController.signal.addEventListener("abort",()=>{clearInterval(r),clearInterval(s)})}anyModuleRequiresHeightmap(){return!1}get version(){return this.displayOptions.version}get displayAdvancedStats(){return(this.initOptions.config.statsVisible??0)>1}fpsUpdate(){this.fpsSamples++,this.fpsAverage=(this.fpsAverage*(this.fpsSamples-1)+this.currentRenderedFrames)/this.fpsSamples,this.fpsWorst===void 0?this.fpsWorst=this.currentRenderedFrames:this.fpsWorst=Math.min(this.fpsWorst,this.currentRenderedFrames),this.lastFps=this.currentRenderedFrames,this.displayOptions.nonReactiveState.fps=this.currentRenderedFrames,this.displayOptions.nonReactiveState.worstRenderTime=this.renderTimeMax,this.displayOptions.nonReactiveState.avgRenderTime=this.renderTimeAvg,this.currentRenderedFrames=0}logWorkerWork(t){this.mesherLogger.active&&this.mesherLogger.contents.push(typeof t=="function"?t():t)}async init(){if(this.active)throw new Error("WorldRendererCommon is already initialized");await Promise.all([this.resetWorkers(),(async()=>{this.resourcesManager.currentResources?.allReady&&await this.updateAssetsData()})()]),this.resourcesManager.on("assetsTexturesUpdated",async()=>{this.active&&await this.updateAssetsData()}),this.watchReactivePlayerState(),this.watchReactiveConfig(),this.worldReadyResolvers.resolve()}snapshotInitialValues(){}wasChunkSentToWorker(t){return this.loadedChunks[t]}async getHighestBlocks(t){return this.highestBlocksByChunks.get(t)}updateCustomBlock(t,e,i){if(this.protocolCustomBlocks.set(t,{...this.protocolCustomBlocks.get(t),[e]:i}),this.logWorkerWork(()=>`-> updateCustomBlock ${t} ${e} ${i} ${this.wasChunkSentToWorker(t)}`),this.wasChunkSentToWorker(t)){let[r,s,o]=e.split(",").map(Number);this.setBlockStateId(new o5(r,s,o),void 0)}}async getBlockInfo(t,e){let r=`${Math.floor(t.x/16)*16},${Math.floor(t.z/16)*16}`,s=this.protocolCustomBlocks.get(r)?.[`${t.x},${t.y},${t.z}`],o=L2(e,s),a=this.blockStateModelInfo.get(o);return{customBlockName:s,modelInfo:a}}initWorkers(t=this.worldRendererConfig.mesherWorkers){for(let e=0;e<t+0;e++){let i=fa(r=>{Array.isArray(r)?this.messageQueue.push(...r):this.messageQueue.push(r),this.processMessageQueue("worker")},this.worldRendererConfig.wasmMesher?"mesherWasm.js":"mesher.js");this.workers.push(i)}}onReactivePlayerStateUpdated(t,e,i=!0){return i&&e(this.playerStateReactive[t]),Si(this.playerStateReactive,t,e)}onReactiveConfigUpdated(t,e){e(this.worldRendererConfig[t]),t==="*"?ua(this.worldRendererConfig,e):Si(this.worldRendererConfig,t,e)}onReactiveDebugUpdated(t,e){e(this.reactiveDebugParams[t]),Si(this.reactiveDebugParams,t,e)}watchReactivePlayerState(){this.onReactivePlayerStateUpdated("backgroundColor",t=>{this.changeBackgroundColor(t)}),this.onReactivePlayerStateUpdated("cardinalLight",t=>{this.changeCardinalLight(t)})}watchReactiveConfig(){this.onReactiveConfigUpdated("fetchPlayerSkins",t=>{q2({apiEnabled:t})})}async processMessageQueue(t){if(this.isProcessingQueue||this.messageQueue.length===0)return;if(this.logWorkerWork(`# ${t} processing queue`),this.lastRendered&&performance.now()-this.lastRendered>this.ONMESSAGE_TIME_LIMIT&&this.worldRendererConfig._experimentalSmoothChunkLoading&&this.renderingActive){let r=performance.now();await new Promise(s=>{requestAnimationFrame(s)}),this.logWorkerWork(`# processing got delayed by ${performance.now()-r}ms`)}this.isProcessingQueue=!0;let e=performance.now(),i=0;for(;this.messageQueue.length>0;){let r=this.stopMesherMessagesProcessing;if(!r){let s=this.messageQueue.shift();this.handleMessage(s),i++}if(r||performance.now()-e>this.ONMESSAGE_TIME_LIMIT&&this.renderingActive&&this.worldRendererConfig._experimentalSmoothChunkLoading){if(this.messageQueue.length>0){requestAnimationFrame(async()=>{this.isProcessingQueue=!1,this.processMessageQueue("queue-delay")});return}break}}this.isProcessingQueue=!1}handleMessage(t){var i,r;let e=t;if(this.active){if(this.mesherLogReader?.workerMessageReceived(e.type,e),e.type!=="geometry"||!this.debugStopGeometryUpdate){let s=performance.now();this.handleWorkerMessage(e),this.workerCustomHandleTime+=performance.now()-s}if(e.type==="geometry"){this.logWorkerWork(()=>`-> ${e.workerIndex} geometry ${e.key} ${JSON.stringify({dataSize:JSON.stringify(e).length})}`),(i=this.geometryReceiveCount)[r=e.workerIndex]??(i[r]=0),this.geometryReceiveCount[e.workerIndex]++;let s=e.key.split(",").map(Number);this.lastChunkDistance=Math.max(...this.getDistance(new o5(s[0],0,s[2])))}if(e.type==="sectionFinished"){if(this.logWorkerWork(`<- ${e.workerIndex} sectionFinished ${e.key} ${JSON.stringify({processTime:e.processTime})}`),!this.sectionsWaiting.has(e.key))throw new Error(`sectionFinished event for non-outstanding section ${e.key}`);this.sectionsWaiting.set(e.key,this.sectionsWaiting.get(e.key)-1),this.sectionsWaiting.get(e.key)===0&&(this.sectionsWaiting.delete(e.key),this.finishedSections[e.key]=!0);let s=e.key.split(",").map(Number),o=`${s[0]},${s[2]}`;if(this.loadedChunks[o]){let a=!0,v=this.getSectionHeight();for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=v)if(!this.finishedSections[`${s[0]},${l},${s[2]}`]){a=!1;break}if(a){this.finishedChunks[o]=!0;let l=16;this.reactiveState.world.chunksLoaded.add(`${Math.floor(s[0]/l)},${Math.floor(s[2]/l)}`),this.renderUpdateEmitter.emit("chunkFinished",`${s[0]},${s[2]}`),this.checkAllFinished()}}if(this.renderUpdateEmitter.emit("update"),e.processTime&&(this.workersProcessAverageTimeCount++,this.workersProcessAverageTime=(this.workersProcessAverageTime*(this.workersProcessAverageTimeCount-1)+e.processTime)/this.workersProcessAverageTimeCount,this.maxWorkersProcessTime=Math.max(this.maxWorkersProcessTime,e.processTime)),typeof e.pre=="number"&&typeof e.wasm=="number"&&typeof e.post=="number"&&(e.pre>0||e.wasm>0||e.post>0)){let a=++this.workersPhaseSampleCount;this.workersPreAverageTime=(this.workersPreAverageTime*(a-1)+e.pre)/a,this.workersWasmAverageTime=(this.workersWasmAverageTime*(a-1)+e.wasm)/a,this.workersPostAverageTime=(this.workersPostAverageTime*(a-1)+e.post)/a;let v=typeof e.preTargetConvert=="number"?e.preTargetConvert:0,l=typeof e.preNeighborConvert=="number"?e.preNeighborConvert:0,c=typeof e.preNeighborCount=="number"?e.preNeighborCount:0,d=typeof e.preTypedArrayBuild=="number"?e.preTypedArrayBuild:0,f=typeof e.preOther=="number"?e.preOther:0,m=typeof e.preCacheHits=="number"?e.preCacheHits:0,g=typeof e.preCacheMisses=="number"?e.preCacheMisses:0;if(this.workersPreTargetConvertAverageTime=(this.workersPreTargetConvertAverageTime*(a-1)+v)/a,this.workersPreNeighborConvertAverageTime=(this.workersPreNeighborConvertAverageTime*(a-1)+l)/a,this.workersPreNeighborCountAverage=(this.workersPreNeighborCountAverage*(a-1)+c)/a,this.workersPreTypedArrayBuildAverageTime=(this.workersPreTypedArrayBuildAverageTime*(a-1)+d)/a,this.workersPreOtherAverageTime=(this.workersPreOtherAverageTime*(a-1)+f)/a,this.workersPreCacheHitsTotal+=m,this.workersPreCacheMissesTotal+=g,this.worldRendererConfig.debugWasmPerf&&a%_t.PHASE_PERF_LOG_INTERVAL===0){let b=this.workersPreAverageTime+this.workersWasmAverageTime+this.workersPostAverageTime,A=b>0?this.workersPreAverageTime/b*100:0,_=b>0?this.workersWasmAverageTime/b*100:0,w=b>0?this.workersPostAverageTime/b*100:0,M=this.workersPreAverageTime,S=M>0?this.workersPreTargetConvertAverageTime/M*100:0,C=M>0?this.workersPreNeighborConvertAverageTime/M*100:0,H=M>0?this.workersPreTypedArrayBuildAverageTime/M*100:0,B=M>0?this.workersPreOtherAverageTime/M*100:0,I=this.workersPreNeighborCountAverage,N=I>0?this.workersPreNeighborConvertAverageTime/I:0,O=this.workersPreCacheHitsTotal+this.workersPreCacheMissesTotal,j=O>0?this.workersPreCacheHitsTotal/O*100:0}}}if(e.type==="blockStateModelInfo")for(let[s,o]of Object.entries(e.info))this.blockStateModelInfo.set(s,o);e.type==="heightmap"&&this.reactiveState.world.heightmaps.set(e.key,new Int16Array(e.heightmap))}}downloadMesherLog(){let t=document.createElement("a");t.href="data:text/plain;charset=utf-8,"+encodeURIComponent(this.mesherLogger.contents.join(`
|
|
16
|
-
`)),t.download="mesher.log",t.click()}checkAllFinished(){this.sectionsWaiting.size===0&&(this.reactiveState.world.mesherWork=!1),Object.keys(this.finishedChunks).length>=this.chunksLength&&(this.allChunksLoaded?.(),this.allChunksFinished=!0,this.allLoadedIn??(this.allLoadedIn=Date.now()-this.initialChunkLoadWasStartedIn)),this.updateChunksStats()}changeHandSwingingState(t,e){}updateViewerPosition(t){this.viewerChunkPosition=t;for(let[r,s]of Object.entries(this.loadedChunks))s&&this.updatePosDataChunk?.(r);let e=Math.floor(t.x/16),i=Math.floor(t.z/16);(e!==this.lastViewerChunkGridX||i!==this.lastViewerChunkGridZ)&&(this.lastViewerChunkGridX=e,this.lastViewerChunkGridZ=i,this.onViewerChunkPositionChanged())}onViewerChunkPositionChanged(){}sendWorkers(t){for(let e of this.workers)e.postMessage(t)}getDistance(t){let[e,i]=ye(this.viewerChunkPosition),r=16,s=Math.abs(e-Math.floor(t.x/r)),o=Math.abs(i-Math.floor(t.z/r));return[s,o]}resetWorld(){for(let t of this.workers)t.terminate();this.workers=[]}async resetWorkers(){this.resetWorld(),typeof document<"u"&&document?.readyState==="loading"&&await new Promise(t=>{document.addEventListener("DOMContentLoaded",t)}),this.initWorkers(),this.active=!0,this.sendMesherMcData()}getMesherConfig(){let t=this.timeOfTheDay,e=t<0||t>24e3?15:Mi(t);return{version:this.version,enableLighting:this.worldRendererConfig.enableLighting,skyLight:e,smoothLighting:this.worldRendererConfig.smoothLighting,shadingTheme:this.worldRendererConfig.shadingTheme,cardinalLight:this.worldRendererConfig.cardinalLight,outputFormat:this.outputFormat,debugModelVariant:this.worldRendererConfig.debugModelVariant,clipWorldBelowY:this.worldRendererConfig.clipWorldBelowY,disableBlockEntityTextures:!this.worldRendererConfig.extraBlockRenderers,worldMinY:this.worldMinYRender,worldMaxY:this.worldMinYRender+this.worldSizeParams.worldHeight,disableConversionCache:this.worldRendererConfig.disableMesherConversionCache,computeWireframeEdges:this.worldRendererConfig.futuristicReveal===!0}}sendMesherMcData(){let t=this.resourcesManager.currentResources.mcData;Ci(this.workers,this.version,i5,t),this.logWorkerWork("# mcData sent")}async updateAssetsData(){let t=this.resourcesManager.currentResources;if(this.workers.length===0)throw new Error("workers not initialized yet");for(let[e,i]of this.workers.entries()){let{blockstatesModels:r}=t;i.postMessage({type:"mesherData",workerIndex:e,blocksAtlas:{latest:t.blocksAtlasJson},blockstatesModels:r,config:this.getMesherConfig()})}this.logWorkerWork("# mesherData sent")}getSectionHeight(){return F2}get worldMinYRender(){let t=this.getSectionHeight();return Math.floor(Math.max(this.worldSizeParams.minY,this.worldRendererConfig.clipWorldBelowY??-1/0)/t)*t}updateChunksStats(){let t=Object.keys(this.finishedChunks);this.displayOptions.nonReactiveState.world.chunksLoaded=new Set(t),this.displayOptions.nonReactiveState.world.chunksTotalNumber=this.chunksLength,this.reactiveState.world.allChunksLoaded=this.allChunksFinished;let e=`Q: ${this.messageQueue.length} ${Object.keys(this.loadedChunks).length}/${Object.keys(this.finishedChunks).length}/${this.chunksLength} chunks (${this.workers.length}:${this.workersProcessAverageTime.toFixed(0)}ms/${this.geometryReceiveCountPerSec}ss/${this.allLoadedIn?.toFixed(1)??"-"}s)`;this.chunksFullInfo=e,wi("downloaded-chunks",e)}addColumn(t,e,i,r){if(!this.active)return;if(this.workers.length===0)throw new Error("workers not initialized yet");this.initialChunksLoad=!1,this.initialChunkLoadWasStartedIn??(this.initialChunkLoadWasStartedIn=Date.now()),this.loadedChunks[`${t},${e}`]=!0,this.updateChunksStats();let s=`${t},${e}`,o=this.protocolCustomBlocks.get(s);for(let l of this.workers)l.postMessage({type:"chunk",x:t,z:e,chunk:i,customBlockModels:o||void 0});this.worldRendererConfig.wasmMesher||this.workers[0].postMessage({type:"getHeightmap",x:t,z:e}),this.logWorkerWork(()=>`-> chunk ${JSON.stringify({x:t,z:e,chunkLength:i.length,customBlockModelsLength:o?Object.keys(o).length:0})}`),this.mesherLogReader?.chunkReceived(t,e,i.length);let a=this.getSectionHeight(),v=16;for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=a){let c=new o5(t,l,e);this.setSectionDirty(c),this.neighborChunkUpdates&&(!r||this.worldRendererConfig.smoothLighting)&&(this.setSectionDirty(c.offset(-v,0,0)),this.setSectionDirty(c.offset(v,0,0)),this.setSectionDirty(c.offset(0,0,-v)),this.setSectionDirty(c.offset(0,0,v)))}}markAsLoaded(t,e){this.loadedChunks[`${t},${e}`]=!0,this.finishedChunks[`${t},${e}`]=!0,this.logWorkerWork(`-> markAsLoaded ${JSON.stringify({x:t,z:e})}`),this.renderUpdateEmitter.emit("chunkFinished",`${t},${e}`),this.checkAllFinished()}removeColumn(t,e){delete this.loadedChunks[`${t},${e}`];let i=`${t},${e}`,r=this.heightmapDebounceTimers.get(i);r&&(clearTimeout(r),this.heightmapDebounceTimers.delete(i));for(let[o,a]of this.sectionDirtyTimers)o.startsWith(`${t},`)&&o.endsWith(`,${e}`)&&(clearTimeout(a),this.sectionDirtyTimers.delete(o),this.sectionDirtyCount.delete(o),this.sectionDirtyPendingArgs.delete(o));for(let o of this.workers)o.postMessage({type:"unloadChunk",x:t,z:e});this.logWorkerWork(`-> unloadChunk ${JSON.stringify({x:t,z:e})}`),delete this.finishedChunks[`${t},${e}`],this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,Object.keys(this.finishedChunks).length===0&&(this.allLoadedIn=void 0,this.initialChunkLoadWasStartedIn=void 0);let s=this.getSectionHeight();for(let o=this.worldSizeParams.minY;o<this.worldSizeParams.worldHeight;o+=s)this.setSectionDirty(new o5(t,o,e),!1),delete this.finishedSections[`${t},${o},${e}`];this.highestBlocksByChunks.delete(`${t},${e}`),this.reactiveState.world.heightmaps.delete(`${Math.floor(t/16)},${Math.floor(e/16)}`),this.updateChunksStats(),Object.keys(this.loadedChunks).length===0&&(this.mesherLogger.contents=[],this.logWorkerWork("# all chunks unloaded. New log started"),this.mesherLogReader?.maybeStartReplay())}setBlockStateId(t,e,i=!0){(async()=>{let o=Math.floor(t.x/16)*16,a=Math.floor(t.z/16)*16;this.queuedChunks.has(`${o},${a}`)&&await new Promise(v=>{this.queuedFunctions.push(()=>{v()})}),this.loadedChunks[`${o},${a}`],this.setBlockStateIdInner(t,e,i)})()}updateEntity(t,e=!1){}lightUpdate(t,e){}connect(t){let e=t;e.on("entity",r=>{this.updateEntity(r,!1)}),e.on("entityMoved",r=>{this.updateEntity(r,!0)}),e.on("playerEntity",r=>{this.updatePlayerEntity?.(r)});let i=null;e.on("loadChunk",({x:r,z:s,chunk:o,worldConfig:a,isLightUpdate:v})=>{this.worldSizeParams=a,this.queuedChunks.add(`${r},${s}`);let l=[r,s,o,v];i||(i={data:[],timeout:setTimeout(()=>{for(let c of i.data)this.queuedChunks.delete(`${c[0]},${c[1]}`),this.addColumn(...c);for(let c of this.queuedFunctions)c();this.queuedFunctions=[],i=null},this.worldRendererConfig.addChunksBatchWaitTime)}),i.data.push(l)}),e.on("blockEntities",r=>{this.blockEntities=r}),e.on("unloadChunk",({x:r,z:s})=>{this.removeColumn(r,s)}),e.on("blockUpdate",({pos:r,stateId:s})=>{this.setBlockStateId(new o5(r.x,r.y,r.z),s)}),e.on("chunkPosUpdate",({pos:r})=>{this.updateViewerPosition(r)}),e.on("end",()=>{this.worldStop?.()}),e.on("renderDistance",r=>{this.viewDistance=r,this.chunksLength=r===0?1:Ze(r).length,this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,this.onRenderDistanceChanged?.(r)}),e.on("markAsLoaded",({x:r,z:s})=>{this.markAsLoaded(r,s)}),e.on("updateLight",({pos:r})=>{this.lightUpdate(r.x,r.z)}),e.on("onWorldSwitch",()=>{for(let r of this.onWorldSwitched)try{r()}catch(s){setTimeout(()=>{throw s},0)}}),e.on("time",r=>{this.worldRendererConfig.dayCycle&&(this.timeUpdated?.(r),this.timeOfTheDay=r)}),e.on("biomeUpdate",({biome:r})=>{this.biomeUpdated?.(r)}),e.on("biomeReset",()=>{this.biomeReset?.()})}setBlockStateIdInner(t,e,i=!0){let s=`${Math.floor(t.x/16)*16},${Math.floor(t.z/16)*16}`,o=`${t.x},${t.y},${t.z}`,a=this.protocolCustomBlocks.get(s)||{};for(let v of this.workers)v.postMessage({type:"blockUpdate",pos:t,stateId:e,customBlockModels:a});if(this.anyModuleRequiresHeightmap()){let v=Math.floor(t.x/16)*16,l=Math.floor(t.z/16)*16,c=`${v},${l}`;if(!this.worldRendererConfig.wasmMesher){let d=this.heightmapDebounceTimers.get(c);d&&clearTimeout(d),this.heightmapDebounceTimers.set(c,setTimeout(()=>{this.heightmapDebounceTimers.delete(c),this.workers[0]?.postMessage({type:"getHeightmap",x:v,z:l})},100))}}if(this.logWorkerWork(`-> blockUpdate ${JSON.stringify({pos:t,stateId:e,customBlockModels:a})}`),this.setSectionDirty(t,!0,!0),this.neighborChunkUpdates){let l=this.getSectionHeight();t.x&15||this.setSectionDirty(t.offset(-16,0,0),!0,!0),(t.x&15)===15&&this.setSectionDirty(t.offset(16,0,0),!0,!0),t.y&l-1||this.setSectionDirty(t.offset(0,-l,0),!0,!0),(t.y&l-1)===l-1&&this.setSectionDirty(t.offset(0,l,0),!0,!0),t.z&15||this.setSectionDirty(t.offset(0,0,-16),!0,!0),(t.z&15)===15&&this.setSectionDirty(t.offset(0,0,16),!0,!0),i&&(!(t.x&15)&&!(t.z&15)&&this.setSectionDirty(t.offset(-16,0,-16),!0,!0),(t.x&15)===15&&!(t.z&15)&&this.setSectionDirty(t.offset(16,0,-16),!0,!0),!(t.x&15)&&(t.z&15)===15&&this.setSectionDirty(t.offset(-16,0,16),!0,!0),(t.x&15)===15&&(t.z&15)===15&&this.setSectionDirty(t.offset(16,0,16),!0,!0),!(t.x&15)&&!(t.y&l-1)&&this.setSectionDirty(t.offset(-16,-l,0),!0,!0),(t.x&15)===15&&!(t.y&l-1)&&this.setSectionDirty(t.offset(16,-l,0),!0,!0),!(t.z&15)&&!(t.y&l-1)&&this.setSectionDirty(t.offset(0,-l,-16),!0,!0),(t.z&15)===15&&!(t.y&l-1)&&this.setSectionDirty(t.offset(0,-l,16),!0,!0),!(t.y&l-1)&&!(t.x&15)&&!(t.z&15)&&this.setSectionDirty(t.offset(-16,-l,-16),!0,!0),!(t.y&l-1)&&(t.x&15)===15&&!(t.z&15)&&this.setSectionDirty(t.offset(16,-l,-16),!0,!0),!(t.y&l-1)&&!(t.x&15)&&(t.z&15)===15&&this.setSectionDirty(t.offset(-16,-l,16),!0,!0),!(t.y&l-1)&&(t.x&15)===15&&(t.z&15)===15&&this.setSectionDirty(t.offset(16,-l,16),!0,!0))}}getWorkerNumber(t,e=!1){let r=this.getSectionHeight();if(this.worldRendererConfig.dedicatedChangeWorker&&this.workers.length>1){if(this.worldRendererConfig.wasmMesher)return a5(Math.floor(t.x/16)+Math.floor(t.z/16),this.workers.length);if(e){let a=`${Math.floor(t.x/16)*16},${Math.floor(t.y/r)*r},${Math.floor(t.z/16)*16}`;if(this.sectionsWaiting.get(a)&&!this.finishedSections[a]){let l=this.workers.length-1;return a5(Math.floor(t.x/16)+Math.floor(t.y/r)+Math.floor(t.z/16),l)}return this.workers.length-1}let o=this.workers.length-1;return a5(Math.floor(t.x/16)+Math.floor(t.y/r)+Math.floor(t.z/16),o)}if(this.worldRendererConfig.wasmMesher)return a5(Math.floor(t.x/16)+Math.floor(t.z/16),this.workers.length);if(e){let o=`${Math.floor(t.x/16)*16},${Math.floor(t.y/r)*r},${Math.floor(t.z/16)*16}`;if(!(this.sectionsWaiting.get(o)&&!this.finishedSections[o]))return 0}return a5(Math.floor(t.x/16)+Math.floor(t.y/r)+Math.floor(t.z/16),this.workers.length)}async debugGetWorkerCustomBlockModel(t){let e=[];for(let i of this.workers)e.push(new Promise(r=>{i.addEventListener("message",s=>{s.data.type==="customBlockModel"&&r(s.data.customBlockModel)})})),i.postMessage({type:"getCustomBlockModel",pos:t});return Promise.all(e)}setSectionDirty(t,e=!0,i=!1){if(!this.forceCallFromMesherReplayer&&this.mesherLogReader)return;if(this.viewDistance===-1)throw new Error("viewDistance not set");let r=this.getDistance(t);if(!this.workers.length||r[0]>this.viewDistance||r[1]>this.viewDistance)return;if(!e){this._dispatchDirtyImmediate(t,e,i);return}let s=16,o=this.getSectionHeight(),a=`${Math.floor(t.x/s)*s},${Math.floor(t.y/o)*o},${Math.floor(t.z/s)*s}`,v=(this.sectionDirtyCount.get(a)??0)+1;this.sectionDirtyCount.set(a,v),v<=_t.GEOMETRY_THROTTLE_THRESHOLD?(this._dispatchDirtyImmediate(t,e,i),this.sectionDirtyTimers.has(a)||this.sectionDirtyTimers.set(a,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(a);this.sectionDirtyCount.delete(a),this.sectionDirtyTimers.delete(a),this.sectionDirtyPendingArgs.delete(a),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},_t.GEOMETRY_THROTTLE_DELAY))):(this.sectionDirtyPendingArgs.set(a,{pos:t,value:e,useChangeWorker:i}),this.sectionDirtyTimers.has(a)||this.sectionDirtyTimers.set(a,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(a);this.sectionDirtyCount.delete(a),this.sectionDirtyTimers.delete(a),this.sectionDirtyPendingArgs.delete(a),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},_t.GEOMETRY_THROTTLE_DELAY)))}_dispatchDirtyImmediate(t,e,i){var v;this.reactiveState.world.mesherWork=!0;let r=16,s=this.getSectionHeight(),o=`${Math.floor(t.x/r)*r},${Math.floor(t.y/s)*s},${Math.floor(t.z/r)*r}`;this.renderUpdateEmitter.emit("dirty",t,e);let a=this.getWorkerNumber(t,i&&(this.mesherLogger.active||this.worldRendererConfig.dedicatedChangeWorker));this.sectionsWaiting.set(o,(this.sectionsWaiting.get(o)??0)+1),this.forceCallFromMesherReplayer?this.workers[a].postMessage({type:"dirty",x:t.x,y:t.y,z:t.z,value:e,config:this.getMesherConfig()}):((v=this.toWorkerMessagesQueue)[a]??(v[a]=[]),this.toWorkerMessagesQueue[a].push({type:"dirty",x:t.x,y:t.y,z:t.z,value:e,config:this.getMesherConfig()}),this.dispatchMessages())}dispatchMessages(){this.queueAwaited||(this.queueAwaited=!0,setTimeout(()=>{for(let t in this.toWorkerMessagesQueue){let e=this.workers[Number(t)],i=this.toWorkerMessagesQueue[t];e.postMessage(i);for(let r of i)this.logWorkerWork(`-> ${t} dispatchMessages ${r.type} ${JSON.stringify({x:r.x,y:r.y,z:r.z,value:r.value})}`)}this.toWorkerMessagesQueue={},this.queueAwaited=!1}))}async waitForChunksToRender(){return new Promise((t,e)=>{if([...this.sectionsWaiting].length===0){t();return}let i=()=>{this.sectionsWaiting.size===0&&(this.renderUpdateEmitter.removeListener("update",i),t())};this.renderUpdateEmitter.on("update",i)})}async waitForChunkToLoad(t){return new Promise((e,i)=>{let s=`${Math.floor(t.x/16)*16},${Math.floor(t.z/16)*16}`;if(this.loadedChunks[s]){e();return}let o=()=>{this.loadedChunks[s]&&(this.renderUpdateEmitter.removeListener("update",o),e())};this.renderUpdateEmitter.on("update",o)})}destroy(){for(let t of this.heightmapDebounceTimers.values())clearTimeout(t);this.heightmapDebounceTimers.clear();for(let t of this.sectionDirtyTimers.values())clearTimeout(t);this.sectionDirtyTimers.clear(),this.sectionDirtyCount.clear(),this.sectionDirtyPendingArgs.clear();for(let t of this.workers)t.terminate();this.workers=[],this.soundSystem&&(this.soundSystem.destroy(),this.soundSystem=void 0),this.active=!1,this.loadedChunks={},this.finishedChunks={},this.finishedSections={},this.sectionsWaiting.clear(),this.queuedChunks.clear(),this.blockStateModelInfo.clear(),this.renderUpdateEmitter.removeAllListeners(),this.abortController.abort(),Y2()}};u(_t,"PHASE_PERF_LOG_INTERVAL",64),u(_t,"GEOMETRY_THROTTLE_THRESHOLD",1),u(_t,"GEOMETRY_THROTTLE_DELAY",100);var a1=_t,fa=(n,t="mesher.js")=>{let e;if(D.env.SINGLE_FILE_BUILD){let i=document.getElementById("mesher-worker-code").textContent,r=new Blob([i],{type:"text/javascript"});e=new Worker(window.URL.createObjectURL(r))}else e=new Worker(t);return e.onmessage=({data:i})=>{n(i)},e.on&&e.on("message",i=>{e.onmessage({data:i})}),e},Ci=(n,t,e=i5,i)=>{let r={version:JSON.parse(JSON.stringify(i.version))};for(let[s,o]of Object.entries(e))r[s]=i[o];for(let s of n)s.postMessage({type:"mcData",mcData:r})};x();R();T();k();import{Vec3 as ha}from"vec3";import*as it from"three";x();R();T();k();function v1(n,t){let e=t/180*Math.PI,i=Math.cos(e),r=Math.sin(e),s={x:0,y:1,z:2}[n],o=(s+1)%3,a=(s+2)%3,v=[[0,0,0],[0,0,0],[0,0,0]];return v[s][s]=1,v[o][o]=i,v[o][a]=-r,v[a][o]=+r,v[a][a]=i,v}function Pi(n,t){return t?[n[0]+t[0],n[1]+t[1],n[2]+t[2]]:n}function Bi(n,t){return t?[n[0]-t[0],n[1]-t[1],n[2]-t[2]]:n}function we(n,t){return n?[n[0][0]*t[0]+n[0][1]*t[1]+n[0][2]*t[2],n[1][0]*t[0]+n[1][1]*t[1]+n[1][2]*t[2],n[2][0]*t[0]+n[2][1]*t[1]+n[2][2]*t[2]]:t}function Z2(n,t){let e=[[0,0,0],[0,0,0],[0,0,0]],i=n[0][0],r=n[1][0],s=n[2][0],o=n[0][1],a=n[1][1],v=n[2][1],l=n[0][2],c=n[1][2],d=n[2][2],f=t[0][0],m=t[1][0],g=t[2][0],b=t[0][1],A=t[1][1],_=t[2][1],w=t[0][2],M=t[1][2],S=t[2][2];return e[0][0]=i*f+r*b+s*w,e[1][0]=i*m+r*A+s*M,e[2][0]=i*g+r*_+s*S,e[0][1]=o*f+a*b+v*w,e[1][1]=o*m+a*A+v*M,e[2][1]=o*g+a*_+v*S,e[0][2]=l*f+c*b+d*w,e[1][2]=l*m+c*A+d*M,e[2][2]=l*g+c*_+d*S,e}var Ii={up:{dir:[0,1,0],mask1:[1,1,0],mask2:[0,1,1],corners:[[0,1,1,0,1],[1,1,1,1,1],[0,1,0,0,0],[1,1,0,1,0]]},down:{dir:[0,-1,0],mask1:[1,1,0],mask2:[0,1,1],corners:[[1,0,1,0,1],[0,0,1,1,1],[1,0,0,0,0],[0,0,0,1,0]]},east:{dir:[1,0,0],mask1:[1,1,0],mask2:[1,0,1],corners:[[1,1,1,0,0],[1,0,1,0,1],[1,1,0,1,0],[1,0,0,1,1]]},west:{dir:[-1,0,0],mask1:[1,1,0],mask2:[1,0,1],corners:[[0,1,0,0,0],[0,0,0,0,1],[0,1,1,1,0],[0,0,1,1,1]]},north:{dir:[0,0,-1],mask1:[1,0,1],mask2:[0,1,1],corners:[[1,0,0,1,1],[0,0,0,0,1],[1,1,0,1,0],[0,1,0,0,0]]},south:{dir:[0,0,1],mask1:[1,0,1],mask2:[0,1,1],corners:[[0,0,1,0,1],[1,0,1,1,1],[0,1,1,0,0],[1,1,1,1,0]]}};function ma(n,t,e,i,r,s,o,a){let v=new ha(0,0,0);for(let l in n.faces){let c=n.faces[l],{corners:d,mask1:f,mask2:m}=Ii[l],g=we(i,Ii[l].dir);if(c.cullface&&a[l])continue;let b=n.from[0],A=n.from[1],_=n.from[2],w=n.to[0],M=n.to[1],S=n.to[2],C=c.texture,{u:H}=C,{v:B}=C,{su:I}=C,{sv:N}=C,O=Math.floor(e.positions.length/3),j=[1,1,1];c.tintindex!==void 0&&c.tintindex===0&&(j=[.5686274509803921,.7411764705882353,.34901960784313724]);let q=c.rotation||0,$=Math.cos(q*Math.PI/180),e0=-Math.sin(q*Math.PI/180),d0=null,l0=null;n.rotation&&(d0=v1(n.rotation.axis,n.rotation.angle),l0=Bi(n.rotation.origin,we(d0,n.rotation.origin)));let m0=[],p0=1;for(let w0 of d){let n0=[w0[0]?w:b,w0[1]?M:A,w0[2]?S:_];n0=Pi(we(d0,n0),l0),n0=Pi(we(i,n0),r),n0=n0.map(L0=>L0/16),e.positions.push(n0[0],n0[1],n0[2]),e.normals.push(...g);let Y=(w0[3]-.5)*$-(w0[4]-.5)*e0+.5,o0=(w0[3]-.5)*e0+(w0[4]-.5)*$+.5;e.uvs.push(Y*I+H,o0*N+B);let g0=1;t&&(g0=4/4*(15/15),m0.push(3)),e.colors.push(p0*j[0]*g0,p0*j[1]*g0,p0*j[2]*g0)}t&&m0[0]+m0[3]>=m0[1]+m0[2]?e.indices.push(O,O+3,O+2,O,O+1,O+3):e.indices.push(O,O+1,O+2,O+2,O+1,O+3)}}var pa=(n,t,e,i,r=[],s={})=>{let l={sx:.5,sy:.5,sz:.5,positions:[],normals:[],colors:[],uvs:[],t_positions:[],t_normals:[],t_colors:[],t_uvs:[],indices:[],tiles:{}};for(let[d,f]of n.entries()){let m=f[r[d]]??f[0];if(!m)continue;let g=null,b=null;for(let _ of["x","y","z"])_ in m&&(g?g=Z2(g,v1(_,-(m[_]??0))):g=v1(_,-(m[_]??0)));g&&(b=[8,8,8],b=Bi(b,we(g,b)));let A=m.ao??!0;for(let _ of m.elements??[])ma(_,A,l,g,b,t,e,s)}let c=l.positions.length/3;for(let d=0;d<l.t_positions.length/12;d++)l.indices.push(c,c+1,c+2,c+2,c+1,c+3,c,c+2,c+1,c+2,c+3,c+1),c+=4;return l.positions.push(...l.t_positions),l.normals.push(...l.t_normals),l.colors.push(...l.t_colors),l.uvs.push(...l.t_uvs),delete l.t_positions,delete l.t_normals,delete l.t_colors,delete l.t_uvs,l.positions=new Float32Array(l.positions),l.normals=new Float32Array(l.normals),l.colors=new Float32Array(l.colors),l.uvs=new Float32Array(l.uvs),l},ga=(...n)=>{let e={geometry:pa(...n)},i=new it.BufferGeometry;return i.setAttribute("position",new it.BufferAttribute(e.geometry.positions,3)),i.setAttribute("normal",new it.BufferAttribute(e.geometry.normals,3)),i.setAttribute("color",new it.BufferAttribute(e.geometry.colors,3)),i.setAttribute("uv",new it.BufferAttribute(e.geometry.uvs,2)),i.setIndex(e.geometry.indices),i.name="block-geometry",i},Hi=(n,...t)=>{let e=ga(...t),i=new it.Mesh(e,n);i.position.set(-.5,-.5,-.5);let r=new it.Group;return r.add(i),r.rotation.set(0,-it.MathUtils.degToRad(90),0,"ZYX"),globalThis.mesh=r,r},X2=(n,t)=>{n.position.set(t.x+.5,t.y+.5,t.z+.5)};x();R();T();k();import*as G0 from"three";x();R();T();k();import fr from"prismarine-nbt";import*as W from"three";x();R();T();k();x();R();T();k();import{BoxGeometry as V0,DoubleSide as Ui,FrontSide as t3,Group as ot,Mesh as U0,MeshStandardMaterial as v5,Vector2 as l1}from"three";function Gi(n,t,e,i,r,s,o,a){let v=(B,I,N,O)=>[new l1(B/o,1-O/a),new l1(N/o,1-O/a),new l1(N/o,1-I/a),new l1(B/o,1-I/a)],l=v(t+s,e,t+i+s,e+s),c=v(t+i+s,e,t+i*2+s,e+s),d=v(t,e+s,t+s,e+s+r),f=v(t+s,e+s,t+i+s,e+s+r),m=v(t+i+s,e+s,t+i+s*2,e+r+s),g=v(t+i+s*2,e+s,t+i*2+s*2,e+r+s),b=n.attributes.uv,A=[m[3],m[2],m[0],m[1]],_=[d[3],d[2],d[0],d[1]],w=[l[3],l[2],l[0],l[1]],M=[c[0],c[1],c[3],c[2]],S=[f[3],f[2],f[0],f[1]],C=[g[3],g[2],g[0],g[1]],H=[];for(let B of[A,_,w,M,S,C])for(let I of B)H.push(I.x,I.y);b.set(new Float32Array(H)),b.needsUpdate=!0}function st(n,t,e,i,r,s){Gi(n,t,e,i,r,s,64,64)}function Oi(n,t,e,i,r,s){Gi(n,t,e,i,r,s,64,32)}var wt=class extends ot{constructor(t,e){super(),Object.defineProperty(this,"innerLayer",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"outerLayer",{enumerable:!0,configurable:!0,writable:!0,value:e}),t.name="inner",e.name="outer"}},zi=class extends ot{constructor(){super(),Object.defineProperty(this,"head",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightArm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftArm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightLeg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftLeg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelListeners",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slim",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"layer1Material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer1MaterialBiased",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer2Material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer2MaterialBiased",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.layer1Material=new v5({side:t3}),this.layer2Material=new v5({side:Ui,transparent:!0,alphaTest:1e-5}),this.layer1MaterialBiased=this.layer1Material.clone(),this.layer1MaterialBiased.polygonOffset=!0,this.layer1MaterialBiased.polygonOffsetFactor=1,this.layer1MaterialBiased.polygonOffsetUnits=1,this.layer2MaterialBiased=this.layer2Material.clone(),this.layer2MaterialBiased.polygonOffset=!0,this.layer2MaterialBiased.polygonOffsetFactor=1,this.layer2MaterialBiased.polygonOffsetUnits=1;let t=new V0(8,8,8);st(t,0,0,8,8,8);let e=new U0(t,this.layer1Material),i=new V0(9,9,9);st(i,32,0,8,8,8);let r=new U0(i,this.layer2Material);this.head=new wt(e,r),this.head.name="head",this.head.add(e,r),e.position.y=4,r.position.y=4,this.add(this.head);let s=new V0(8,12,4);st(s,16,16,8,12,4);let o=new U0(s,this.layer1Material),a=new V0(8.5,12.5,4.5);st(a,16,32,8,12,4);let v=new U0(a,this.layer2Material);this.body=new wt(o,v),this.body.name="body",this.body.add(o,v),this.body.position.y=-6,this.add(this.body);let l=new V0,c=new U0(l,this.layer1MaterialBiased);this.modelListeners.push(()=>{c.scale.x=this.slim?3:4,c.scale.y=12,c.scale.z=4,st(l,40,16,this.slim?3:4,12,4)});let d=new V0,f=new U0(d,this.layer2MaterialBiased);this.modelListeners.push(()=>{f.scale.x=this.slim?3.5:4.5,f.scale.y=12.5,f.scale.z=4.5,st(d,40,32,this.slim?3:4,12,4)});let m=new ot;m.add(c,f),this.modelListeners.push(()=>{m.position.x=this.slim?-.5:-1}),m.position.y=-4,this.rightArm=new wt(c,f),this.rightArm.name="rightArm",this.rightArm.add(m),this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.add(this.rightArm);let g=new V0,b=new U0(g,this.layer1MaterialBiased);this.modelListeners.push(()=>{b.scale.x=this.slim?3:4,b.scale.y=12,b.scale.z=4,st(g,32,48,this.slim?3:4,12,4)});let A=new V0,_=new U0(A,this.layer2MaterialBiased);this.modelListeners.push(()=>{_.scale.x=this.slim?3.5:4.5,_.scale.y=12.5,_.scale.z=4.5,st(A,48,48,this.slim?3:4,12,4)});let w=new ot;w.add(b,_),this.modelListeners.push(()=>{w.position.x=this.slim?.5:1}),w.position.y=-4,this.leftArm=new wt(b,_),this.leftArm.name="leftArm",this.leftArm.add(w),this.leftArm.position.x=5,this.leftArm.position.y=-2,this.add(this.leftArm);let M=new V0(4,12,4);st(M,0,16,4,12,4);let S=new U0(M,this.layer1MaterialBiased),C=new V0(4.5,12.5,4.5);st(C,0,32,4,12,4);let H=new U0(C,this.layer2MaterialBiased),B=new ot;B.add(S,H),B.position.y=-6,this.rightLeg=new wt(S,H),this.rightLeg.name="rightLeg",this.rightLeg.add(B),this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.add(this.rightLeg);let I=new V0(4,12,4);st(I,16,48,4,12,4);let N=new U0(I,this.layer1MaterialBiased),O=new V0(4.5,12.5,4.5);st(O,0,48,4,12,4);let j=new U0(O,this.layer2MaterialBiased),q=new ot;q.add(N,j),q.position.y=-6,this.leftLeg=new wt(N,j),this.leftLeg.name="leftLeg",this.leftLeg.add(q),this.leftLeg.position.x=1.9,this.leftLeg.position.y=-12,this.leftLeg.position.z=-.1,this.add(this.leftLeg),this.modelType="default"}get map(){return this._map}set map(t){this._map=t,this.layer1Material.map=t,this.layer1Material.needsUpdate=!0,this.layer1MaterialBiased.map=t,this.layer1MaterialBiased.needsUpdate=!0,this.layer2Material.map=t,this.layer2Material.needsUpdate=!0,this.layer2MaterialBiased.map=t,this.layer2MaterialBiased.needsUpdate=!0}get modelType(){return this.slim?"slim":"default"}set modelType(t){this.slim=t==="slim",this.modelListeners.forEach(e=>e())}getBodyParts(){return this.children.filter(t=>t instanceof wt)}setInnerLayerVisible(t){this.getBodyParts().forEach(e=>e.innerLayer.visible=t)}setOuterLayerVisible(t){this.getBodyParts().forEach(e=>e.outerLayer.visible=t)}resetJoints(){this.head.rotation.set(0,0,0),this.leftArm.rotation.set(0,0,0),this.rightArm.rotation.set(0,0,0),this.leftLeg.rotation.set(0,0,0),this.rightLeg.rotation.set(0,0,0),this.body.rotation.set(0,0,0),this.head.position.y=0,this.body.position.y=-6,this.body.position.z=0,this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.rightArm.position.z=0,this.leftArm.position.x=5,this.leftArm.position.y=-2,this.leftArm.position.z=0,this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.leftLeg.position.x=1.9,this.leftLeg.position.y=-12,this.leftLeg.position.z=-.1}},Di=class extends ot{constructor(){super(),Object.defineProperty(this,"cape",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new v5({side:Ui,transparent:!0,alphaTest:1e-5});let t=new V0(10,16,1);Oi(t,0,0,10,16,1),this.cape=new U0(t,this.material),this.cape.position.y=-8,this.cape.position.z=.5,this.add(this.cape)}get map(){return this.material.map}set map(t){this.material.map=t,this.material.needsUpdate=!0}},Fi=class extends ot{constructor(){super(),Object.defineProperty(this,"leftWing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightWing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new v5({side:Ui,transparent:!0,alphaTest:1e-5});let t=new V0(12,22,4);Oi(t,22,0,10,20,2);let e=new U0(t,this.material);e.position.x=-5,e.position.y=-10,e.position.z=-1,this.leftWing=new ot,this.leftWing.add(e),this.add(this.leftWing);let i=new V0(12,22,4);Oi(i,22,0,10,20,2);let r=new U0(i,this.material);r.scale.x=-1,r.position.x=5,r.position.y=-10,r.position.z=-1,this.rightWing=new ot,this.rightWing.add(r),this.add(this.rightWing),this.leftWing.position.x=5,this.leftWing.rotation.x=.2617994,this.resetJoints()}resetJoints(){this.leftWing.rotation.y=.01,this.leftWing.rotation.z=.2617994,this.updateRightWing()}updateRightWing(){this.rightWing.position.x=-this.leftWing.position.x,this.rightWing.position.y=this.leftWing.position.y,this.rightWing.rotation.x=this.leftWing.rotation.x,this.rightWing.rotation.y=-this.leftWing.rotation.y,this.rightWing.rotation.z=-this.leftWing.rotation.z}get map(){return this.material.map}set map(t){this.material.map=t,this.material.needsUpdate=!0}},Li=class extends ot{constructor(){super(),Object.defineProperty(this,"rightEar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftEar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new v5({side:t3});let t=new V0(8,8,4/3);Gi(t,0,0,6,6,1,14,7),this.rightEar=new U0(t,this.material),this.rightEar.name="rightEar",this.rightEar.position.x=-6,this.add(this.rightEar),this.leftEar=new U0(t,this.material),this.leftEar.name="leftEar",this.leftEar.position.x=6,this.add(this.leftEar)}get map(){return this.material.map}set map(t){this.material.map=t,this.material.needsUpdate=!0}},$2=10.8*Math.PI/180,l5=class extends ot{constructor(){super(),Object.defineProperty(this,"skin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cape",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"elytra",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ears",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.skin=new zi,this.skin.name="skin",this.skin.position.y=8,this.add(this.skin),this.cape=new Di,this.cape.name="cape",this.cape.position.y=8,this.cape.position.z=-2,this.cape.rotation.x=$2,this.cape.rotation.y=Math.PI,this.add(this.cape),this.elytra=new Fi,this.elytra.name="elytra",this.elytra.position.y=8,this.elytra.position.z=-2,this.elytra.visible=!1,this.add(this.elytra),this.ears=new Li,this.ears.name="ears",this.ears.position.y=10,this.ears.position.z=2/3,this.ears.visible=!1,this.skin.head.add(this.ears)}get backEquipment(){return this.cape.visible?"cape":this.elytra.visible?"elytra":null}set backEquipment(t){this.cape.visible=t==="cape",this.elytra.visible=t==="elytra"}resetJoints(){this.skin.resetJoints(),this.cape.rotation.x=$2,this.cape.position.y=8,this.cape.position.z=-2,this.elytra.position.y=8,this.elytra.position.z=-2,this.elytra.rotation.x=0,this.elytra.resetJoints()}};x();R();T();k();import{Color as um,PointLight as fm,EquirectangularReflectionMapping as hm,Group as mm,NearestFilter as pm,PerspectiveCamera as gm,Scene as bm,Texture as ym,Vector2 as _m,WebGLRenderer as wm,AmbientLight as Am,CanvasTexture as Em,WebGLRenderTarget as xm,FloatType as Rm,DepthTexture as km,Clock as Tm,Object3D as Mm,ColorManagement as Sm}from"three";import{OrbitControls as Pm}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as Im}from"three/examples/jsm/postprocessing/EffectComposer.js";import"three/examples/jsm/postprocessing/Pass.js";import{RenderPass as Dm}from"three/examples/jsm/postprocessing/RenderPass.js";import{ShaderPass as Lm}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as Gm}from"three/examples/jsm/shaders/FXAAShader.js";x();R();T();k();var c1=class{constructor(){Object.defineProperty(this,"speed",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"progress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"currentId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progress0",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"animationObjects",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}update(t,e){if(this.paused)return;let i=e*this.speed;this.animate(t,i),this.animationObjects.forEach((r,s)=>{let o=this.progress0.get(s);r(t,this.progress-o,s)}),this.progress+=i}addAnimation(t){let e=this.currentId++;return this.progress0.set(e,this.progress),this.animationObjects.set(e,t),e}removeAnimation(t){t!=null&&(this.animationObjects.delete(t),this.progress0.delete(t))}};x();R();T();k();import{CanvasTexture as Zh,NearestFilter as Xh,Sprite as $h,SpriteMaterial as tm}from"three";x();R();T();k();var ba=Object.defineProperty,ya=(n,t,e)=>t in n?ba(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,y0=(n,t,e)=>(ya(n,typeof t!="symbol"?t+"":t,e),e);function Ni(n){let t=[n];if(n.extra&&n.extra.length!==0)for(let e of n.extra)t.push(...Ni(e));return t}var Z=class{constructor(n,t,e,i,r,s){this.key=n,this.value=t,this.name=e,this.code=i,this.cssForeground=r,this.cssBackground=s}applyToStyle(n){n[this.key]=this.value}matchStyle(n){return n[this.key]===this.value}static fromCode(n){let e="0123456789abcdefklmnor".indexOf(n);if(e)return this.list[e]}toString(){return`${Z.CONTROL_STRING}${this.code}`}},_0=Z;y0(_0,"CONTROL_STRING","\xA7");y0(_0,"BLACK",new Z("color","black","BLACK","0",{color:"#000000"},{color:"#000000"}));y0(_0,"DARK_BLUE",new Z("color","dark_blue","DARK_BLUE","1",{color:"#0000AA"},{color:"#00002A"}));y0(_0,"DARK_GREEN",new Z("color","dark_green","DARK_GREEN","2",{color:"#00AA00"},{color:"#002A00"}));y0(_0,"DARK_AQUA",new Z("color","dark_aqua","DARK_AQUA","3",{color:"#00AAAA"},{color:"#002A2A"}));y0(_0,"DARK_RED",new Z("color","dark_red","DARK_RED","4",{color:"#AA0000"},{color:"#2A0000"}));y0(_0,"DARK_PURPLE",new Z("color","dark_purple","DARK_PURPLE","5",{color:"#AA00AA"},{color:"#2A002A"}));y0(_0,"GOLD",new Z("color","gold","GOLD","6",{color:"#FFAA00"},{color:"#2A2A00"}));y0(_0,"GRAY",new Z("color","gray","GRAY","7",{color:"#AAAAAA"},{color:"#2A2A2A"}));y0(_0,"DARK_GRAY",new Z("color","dark_gray","DARK_GRAY","8",{color:"#555555"},{color:"#151515"}));y0(_0,"BLUE",new Z("color","blue","BLUE","9",{color:"#5555FF"},{color:"#15153F"}));y0(_0,"GREEN",new Z("color","green","GREEN","a",{color:"#55FF55"},{color:"#153F15"}));y0(_0,"AQUA",new Z("color","aqua","AQUA","b",{color:"#55FFFF"},{color:"#153F3F"}));y0(_0,"RED",new Z("color","red","RED","c",{color:"#FF5555"},{color:"#3F1515"}));y0(_0,"LIGHT_PURPLE",new Z("color","light_purple","LIGHT_PURPLE","d",{color:"#FF55FF"},{color:"#3F153F"}));y0(_0,"YELLOW",new Z("color","yellow","YELLOW","e",{color:"#FFFF55"},{color:"#3F3F15"}));y0(_0,"WHITE",new Z("color","white","WHITE","f",{color:"#FFFFFF"},{color:"#3F3F3F"}));y0(_0,"OBFUSCATED",new Z("obfuscated",!0,"OBFUSCATED","k",{}));y0(_0,"BOLD",new Z("bold",!0,"BOLD","l",{"font-weight":"bold"}));y0(_0,"STRIKETHROUGH",new Z("strikethrough",!0,"STRIKETHROUGH","m",{"text-decoration":"line-through"}));y0(_0,"UNDERLINE",new Z("underlined",!0,"UNDERLINE","n",{"text-decoration":"underline"}));y0(_0,"ITALIC",new Z("italic",!0,"ITALIC","o",{"font-style":"italic"}));y0(_0,"RESET",{name:"RESET",code:"r",applyToStyle(n){n.bold=!1,n.strikethrough=!1,n.underlined=!1,n.italic=!1,n.obfuscated=!1,n.color=void 0},matchStyle(n){return!1},cssBackground:{},cssForeground:{},toString(){return`${Z.CONTROL_STRING}r`}});y0(_0,"list",[Z.BLACK,Z.DARK_BLUE,Z.DARK_GREEN,Z.DARK_AQUA,Z.DARK_RED,Z.DARK_PURPLE,Z.GOLD,Z.GRAY,Z.DARK_GRAY,Z.BLUE,Z.GREEN,Z.AQUA,Z.RED,Z.LIGHT_PURPLE,Z.YELLOW,Z.WHITE,Z.OBFUSCATED,Z.BOLD,Z.STRIKETHROUGH,Z.UNDERLINE,Z.ITALIC,Z.RESET]);var _5=Qe(Wi(),1);Qi();var Vs=Qe(R3(),1);import js from"prismarine-chat";x();R();T();k();import*as S0 from"three";x();R();T();k();x();R();T();k();var Pt=class n{constructor(t,e,i,r,s="div"){this.parent=t,this.object=e,this.property=i,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.nextNameID}`,this.$widget=document.createElement(s),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",o=>o.stopPropagation()),this.domElement.addEventListener("keyup",o=>o.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(t){return this._name=t,this.$name.innerHTML=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled?this:(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t),this)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(t){let e=this.parent.add(this.object,this.property,t);return e.name(this._name),this.destroy(),e}min(t){return this}max(t){return this}step(t){return this}decimals(t){return this}listen(t=!0){return this._listening=t,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.object[this.property]=t,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},Ki=class extends Pt{constructor(t,e,i){super(t,e,i,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function Ji(n){let t,e;return(t=n.match(/(#|0x)?([a-f0-9]{6})/i))?e=t[2]:(t=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?e=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(e=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),e?"#"+e:!1}var n7={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:Ji,toHexString:Ji},m5={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},s7={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,t,e=1){let i=m5.fromHexString(n);t[0]=(i>>16&255)/255*e,t[1]=(i>>8&255)/255*e,t[2]=(i&255)/255*e},toHexString([n,t,e],i=1){i=255/i;let r=n*i<<16^t*i<<8^e*i<<0;return m5.toHexString(r)}},o7={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,t,e=1){let i=m5.fromHexString(n);t.r=(i>>16&255)/255*e,t.g=(i>>8&255)/255*e,t.b=(i&255)/255*e},toHexString({r:n,g:t,b:e},i=1){i=255/i;let r=n*i<<16^t*i<<8^e*i<<0;return m5.toHexString(r)}},a7=[n7,m5,s7,o7];function v7(n){return a7.find(t=>t.match(n))}var qi=class extends Pt{constructor(t,e,i,r){super(t,e,i,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=v7(this.initialValue),this._rgbScale=r,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=Ji(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){let e=this._format.fromHexString(t);this.setValue(e)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},h5=class extends Pt{constructor(t,e,i){super(t,e,i,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",r=>{r.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},Zi=class extends Pt{constructor(t,e,i,r,s,o){super(t,e,i,"number"),this._initInput(),this.min(r),this.max(s);let a=o!==void 0;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}decimals(t){return this._decimals=t,this.updateDisplay(),this}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,e=!0){return this._step=t,this._stepExplicit=e,this}updateDisplay(){let t=this.getValue();if(this._hasSlider){let e=(t-this._min)/(this._max-this._min);e=Math.max(0,Math.min(e,1)),this.$fill.style.width=e*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?t:t.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let e=()=>{let w=parseFloat(this.$input.value);isNaN(w)||(this._stepExplicit&&(w=this._snap(w)),this.setValue(this._clamp(w)))},i=w=>{let M=parseFloat(this.$input.value);isNaN(M)||(this._snapClampSetValue(M+w),this.$input.value=this.getValue())},r=w=>{w.key==="Enter"&&this.$input.blur(),w.code==="ArrowUp"&&(w.preventDefault(),i(this._step*this._arrowKeyMultiplier(w))),w.code==="ArrowDown"&&(w.preventDefault(),i(this._step*this._arrowKeyMultiplier(w)*-1))},s=w=>{this._inputFocused&&(w.preventDefault(),i(this._step*this._normalizeMouseWheel(w)))},o=!1,a,v,l,c,d,f=5,m=w=>{a=w.clientX,v=l=w.clientY,o=!0,c=this.getValue(),d=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",b)},g=w=>{if(o){let M=w.clientX-a,S=w.clientY-v;Math.abs(S)>f?(w.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(M)>f&&b()}if(!o){let M=w.clientY-l;d-=M*this._step*this._arrowKeyMultiplier(w),c+d>this._max?d=this._max-c:c+d<this._min&&(d=this._min-c),this._snapClampSetValue(c+d)}l=w.clientY},b=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",b)},A=()=>{this._inputFocused=!0},_=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",e),this.$input.addEventListener("keydown",r),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",m),this.$input.addEventListener("focus",A),this.$input.addEventListener("blur",_)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let t=(_,w,M,S,C)=>(_-w)/(M-w)*(C-S)+S,e=_=>{let w=this.$slider.getBoundingClientRect(),M=t(_,w.left,w.right,this._min,this._max);this._snapClampSetValue(M)},i=_=>{this._setDraggingStyle(!0),e(_.clientX),window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)},r=_=>{e(_.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s)},o=!1,a,v,l=_=>{_.preventDefault(),this._setDraggingStyle(!0),e(_.touches[0].clientX),o=!1},c=_=>{_.touches.length>1||(this._hasScrollBar?(a=_.touches[0].clientX,v=_.touches[0].clientY,o=!0):l(_),window.addEventListener("touchmove",d,{passive:!1}),window.addEventListener("touchend",f))},d=_=>{if(o){let w=_.touches[0].clientX-a,M=_.touches[0].clientY-v;Math.abs(w)>Math.abs(M)?l(_):(window.removeEventListener("touchmove",d),window.removeEventListener("touchend",f))}else _.preventDefault(),e(_.touches[0].clientX)},f=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",d),window.removeEventListener("touchend",f)},m=this._callOnFinishChange.bind(this),g=400,b,A=_=>{if(Math.abs(_.deltaX)<Math.abs(_.deltaY)&&this._hasScrollBar)return;_.preventDefault();let M=this._normalizeMouseWheel(_)*this._step;this._snapClampSetValue(this.getValue()+M),this.$input.value=this.getValue(),clearTimeout(b),b=setTimeout(m,g)};this.$slider.addEventListener("mousedown",i),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",A,{passive:!1})}_setDraggingStyle(t,e="horizontal"){this.$slider&&this.$slider.classList.toggle("active",t),document.body.classList.toggle("lil-gui-dragging",t),document.body.classList.toggle(`lil-gui-${e}`,t)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(t){let{deltaX:e,deltaY:i}=t;return Math.floor(t.deltaY)!==t.deltaY&&t.wheelDelta&&(e=0,i=-t.wheelDelta/120,i*=this._stepExplicit?1:10),e+-i}_arrowKeyMultiplier(t){let e=this._stepExplicit?1:10;return t.shiftKey?e*=10:t.altKey&&(e/=10),e}_snap(t){let e=Math.round(t/this._step)*this._step;return parseFloat(e.toPrecision(15))}_clamp(t){return t<this._min&&(t=this._min),t>this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){let t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},Xi=class extends Pt{constructor(t,e,i,r){super(t,e,i,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(r)?r:Object.values(r),this._names=Array.isArray(r)?r:Object.keys(r),this._names.forEach(s=>{let o=document.createElement("option");o.innerHTML=s,this.$select.appendChild(o)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){let t=this.getValue(),e=this._values.indexOf(t);return this.$select.selectedIndex=e,this.$display.innerHTML=e===-1?t:this._names[e],this}},$i=class extends Pt{constructor(t,e,i){super(t,e,i,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",r=>{r.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},l7=`.lil-gui {
|
|
12
|
+
`)},s.prototype.displayStateStack=function(v,l){for(var c,d=0,f=0;f<v.length;f++){var m=v[f],g=m.rule.toString(m.dot);g===c?d++:(d>0&&l.push(" ^ "+d+" more lines identical to this"),d=0,l.push(" "+g)),c=g}},s.prototype.getSymbolDisplay=function(v){return o(v)},s.prototype.buildFirstStateStack=function(v,l){if(l.indexOf(v)!==-1)return null;if(v.wantedBy.length===0)return[v];var c=v.wantedBy[0],d=[v].concat(l),f=this.buildFirstStateStack(c,d);return f===null?null:[v].concat(f)},s.prototype.save=function(){var v=this.table[this.current];return v.lexerState=this.lexerState,v},s.prototype.restore=function(v){var l=v.index;this.current=l,this.table[l]=v,this.table.splice(l+1),this.lexerState=v.lexerState,this.results=this.finish()},s.prototype.rewind=function(v){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[v])},s.prototype.finish=function(){var v=[],l=this.grammar.start,c=this.table[this.table.length-1];return c.states.forEach(function(d){d.rule.name===l&&d.dot===d.rule.symbols.length&&d.reference===0&&d.data!==s.fail&&v.push(d)}),v.map(function(d){return d.data})};function o(v){var l=typeof v;if(l==="string")return v;if(l==="object"){if(v.literal)return JSON.stringify(v.literal);if(v instanceof RegExp)return"character matching "+v;if(v.type)return v.type+" token";if(v.test)return"token matching "+String(v.test);throw new Error("Unknown symbol type: "+v)}}function a(v){var l=typeof v;if(l==="string")return v;if(l==="object"){if(v.literal)return JSON.stringify(v.literal);if(v instanceof RegExp)return v.toString();if(v.type)return"%"+v.type;if(v.test)return"<"+String(v.test)+">";throw new Error("Unknown symbol type: "+v)}}return{Parser:s,Grammar:i,Rule:n}})});var c3=et((gg,y1)=>{x();R();M();k();(function(){function n(v){return v[0]}function t(v){if(v==="true")return{type:"boolean",value:!0};if(v==="false")return{type:"boolean",value:!1};let l="bslfdi",c={b:"byte",s:"short",l:"long",f:"float",d:"double",i:"int"},d=v.charAt(v.length-1).toLowerCase();if(l.indexOf(d)!==-1){let b=parseFloat(v.substring(0,v.length-1));return isNaN(b)?{value:v,type:"string"}:{value:b,type:c[d]}}let f=parseFloat(v),m=v.includes("."),g=f>>0===f;return!isNaN(v)&&(m||g)?{value:f,type:m?"double":"int"}:{value:v,type:"string"}}function e(v,l){v[0]!==void 0&&(l[v[0]]=v[1])}function i(v){let l={};e(v[2],l);for(let c in v[3])e(v[3][c][3],l);return{type:"compound",value:l}}function r(v){let l=[v[6]];for(let d in v[7])l.push(v[7][d][3]);return{type:{B:"byteArray",I:"intArray",L:"longArray"}[v[2]],value:{type:l[0].type,value:l.map(d=>d.value)}}}function s(v){let l=[v[2]];for(let c in v[3])l.push(v[3][c][3]);return{type:"list",value:{type:l[0].type,value:l.map(c=>c.value)}}}function o(v){let l=[];e(v[2],l);for(let c in v[3])e(v[3][c][3],l);return{type:"list",value:{type:l[0].type,value:l.map(c=>c.value)}}}var a={Lexer:void 0,ParserRules:[{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","wschar"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(v){return null}},{name:"__$ebnf$1",symbols:["wschar"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","wschar"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"__",symbols:["__$ebnf$1"],postprocess:function(v){return null}},{name:"wschar",symbols:[/[ \t\n\v\f]/],postprocess:n},{name:"MAIN",symbols:["_","JVALUE","_"],postprocess:v=>v[1]},{name:"JVALUE",symbols:["JOBJECT"],postprocess:v=>v[0]},{name:"JVALUE",symbols:[{literal:"'"},"_","JOBJECT","_",{literal:"'"}],postprocess:v=>v[2]},{name:"JVALUE",symbols:["JARRAY"],postprocess:v=>v[0]},{name:"JVALUE",symbols:["STRING"],postprocess:v=>v[0]},{name:"JVALUE$string$1",symbols:[{literal:"n"},{literal:"u"},{literal:"l"},{literal:"l"}],postprocess:function(l){return l.join("")}},{name:"JVALUE",symbols:["JVALUE$string$1"],postprocess:v=>null},{name:"JOBJECT",symbols:[{literal:"{"},"_",{literal:"}"}],postprocess:v=>({type:"compound",value:{}})},{name:"JOBJECT$ebnf$1",symbols:[]},{name:"JOBJECT$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","PAIR"]},{name:"JOBJECT$ebnf$1",symbols:["JOBJECT$ebnf$1","JOBJECT$ebnf$1$subexpression$1"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"JOBJECT$ebnf$2$subexpression$1",symbols:["_",{literal:","}]},{name:"JOBJECT$ebnf$2",symbols:["JOBJECT$ebnf$2$subexpression$1"],postprocess:n},{name:"JOBJECT$ebnf$2",symbols:[],postprocess:function(v){return null}},{name:"JOBJECT",symbols:[{literal:"{"},"_","PAIR","JOBJECT$ebnf$1","JOBJECT$ebnf$2",{literal:"}"}],postprocess:i},{name:"JARRAY",symbols:[{literal:"["},"_",{literal:"]"}],postprocess:v=>({type:"list",value:{}})},{name:"JARRAY$ebnf$1",symbols:[]},{name:"JARRAY$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","JVALUE"]},{name:"JARRAY$ebnf$1",symbols:["JARRAY$ebnf$1","JARRAY$ebnf$1$subexpression$1"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"JARRAY$ebnf$2$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$2",symbols:["JARRAY$ebnf$2$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$2",symbols:[],postprocess:function(v){return null}},{name:"JARRAY",symbols:[{literal:"["},"_",/[BIL]/,"_",{literal:";"},"_","JVALUE","JARRAY$ebnf$1","JARRAY$ebnf$2","_",{literal:"]"}],postprocess:r},{name:"JARRAY$ebnf$3",symbols:[]},{name:"JARRAY$ebnf$3$subexpression$1",symbols:["_",{literal:","},"_","JVALUE"]},{name:"JARRAY$ebnf$3",symbols:["JARRAY$ebnf$3","JARRAY$ebnf$3$subexpression$1"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"JARRAY$ebnf$4$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$4",symbols:["JARRAY$ebnf$4$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$4",symbols:[],postprocess:function(v){return null}},{name:"JARRAY",symbols:[{literal:"["},"_","JVALUE","JARRAY$ebnf$3","JARRAY$ebnf$4","_",{literal:"]"}],postprocess:s},{name:"JARRAY$ebnf$5",symbols:[]},{name:"JARRAY$ebnf$5$subexpression$1",symbols:["_",{literal:","},"_","PAIR"]},{name:"JARRAY$ebnf$5",symbols:["JARRAY$ebnf$5","JARRAY$ebnf$5$subexpression$1"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"JARRAY$ebnf$6$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$6",symbols:["JARRAY$ebnf$6$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$6",symbols:[],postprocess:function(v){return null}},{name:"JARRAY",symbols:[{literal:"["},"_","PAIR","JARRAY$ebnf$5","JARRAY$ebnf$6","_",{literal:"]"}],postprocess:o},{name:"PAIR",symbols:["STRING","_",{literal:":"},"_","JVALUE"],postprocess:v=>[v[0].value,v[4]]},{name:"STRING$ebnf$1",symbols:[]},{name:"STRING$ebnf$1$subexpression$1",symbols:[/[^\\"]/]},{name:"STRING$ebnf$1$subexpression$1",symbols:[{literal:"\\"},/["bfnrt\/\\]/]},{name:"STRING$ebnf$1$subexpression$1$string$1",symbols:[{literal:"\\"},{literal:"u"}],postprocess:function(l){return l.join("")}},{name:"STRING$ebnf$1$subexpression$1",symbols:["STRING$ebnf$1$subexpression$1$string$1",/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/]},{name:"STRING$ebnf$1",symbols:["STRING$ebnf$1","STRING$ebnf$1$subexpression$1"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"STRING",symbols:[{literal:'"'},"STRING$ebnf$1",{literal:'"'}],postprocess:v=>t(JSON.parse(v.flat(3).map(l=>l.replace(`
|
|
13
|
+
`,"\\n")).join("")))},{name:"STRING$ebnf$2",symbols:[/[^\"\'}\]:;,\s]/]},{name:"STRING$ebnf$2",symbols:["STRING$ebnf$2",/[^\"\'}\]:;,\s]/],postprocess:function(l){return l[0].concat([l[1]])}},{name:"STRING",symbols:["STRING$ebnf$2"],postprocess:v=>t(v[0].join(""))}],ParserStart:"MAIN"};typeof y1<"u"&&typeof y1.exports<"u"?y1.exports=a:window.grammar=a})()});var Qi=et((Ag,p3)=>{x();R();M();k();var d3=l3(),Ba=c3();function h3(n){function t(e,i){return i==="compound"?Object.keys(e).reduce(function(r,s){return r[s]=h3(e[s]),r},{}):i==="list"?Array.isArray(e.value)?e.value.map(function(r){return t(r,e.type)}):[]:e}return t(n.value,n.type)}function _1({value:n,type:t}){if(t==="compound"){let i=[],r=Object.entries(n);for(let s=0;s<r.length;s++){let o=r[s][0],a=_1(r[s][1]);o==="string"&&(a=u3(a)),i.push(`${o}:${a}`)}return`{${i.join(",")}}`}else{if(t==="list")return Array.isArray(n.value)?`[${f3(n)}]`:"[]";if(t==="byteArray"||t==="intArray"||t==="longArray"){let i=Ia(t),r=f3(n);return`[${i}${r}]`}}let e=n+Ha(n,t);return t==="string"&&(e=u3(e)),e}function u3(n){return n=n.replace(/"/g,'\\"'),(/'|{|}|\[|\]|:|;|,|\(|\)|§|=/g.test(n)||n==="")&&(n=`"${n}"`),n}function f3({value:n,type:t}){let e=Pa(n),i=[];for(let r=0;r<n.length;r++){let s=n[r];s!==void 0&&(s=_1({value:s,type:t}),e?i.push(`${r}:${s}`):i.push(s))}return i.join(",")}function Pa(n){for(let t=0;t<n.length;t++)if(n[t]===void 0)return!0;return!1}var Ia=n=>n.charAt(0).toUpperCase()+";";function Ha(n,t){return t==="double"?n>>0===n?"d":"":{int:"",byte:"b",short:"s",float:"f",long:"l",string:""}[t]}function Oa(n){return _1(m3(n))}function m3(n){try{let t=new d3.Parser(d3.Grammar.fromCompiled(Ba));return t.feed(n),t.results[0]}catch(t){throw t.message=`Error parsing text '${n}'`,t}}p3.exports={parse:m3,simplify:h3,stringify:_1,normalize:Oa}});var w3={};G5(w3,{camelCase:()=>Ua,capitalCase:()=>Ji,constantCase:()=>Wa,dotCase:()=>Va,kebabCase:()=>ja,noCase:()=>m5,pascalCase:()=>Ga,pascalSnakeCase:()=>Na,pathCase:()=>Ya,sentenceCase:()=>Qa,snakeCase:()=>qi,split:()=>Ki,splitSeparateNumbers:()=>y3,trainCase:()=>Ka});function Ki(n){let t=n.trim();t=t.replace(za,g3).replace(Da,g3),t=t.replace(La,"\0");let e=0,i=t.length;for(;t.charAt(e)==="\0";)e++;if(e===i)return[];for(;t.charAt(i-1)==="\0";)i--;return t.slice(e,i).split(/\0/g)}function y3(n){let t=Ki(n);for(let e=0;e<t.length;e++){let i=t[e],r=Fa.exec(i);if(r){let s=r.index+(r[1]??r[2]).length;t.splice(e,1,i.slice(0,s),i.slice(s))}}return t}function m5(n,t){let[e,i,r]=Re(n,t);return e+i.map(p5(t?.locale)).join(t?.delimiter??" ")+r}function Ua(n,t){let[e,i,r]=Re(n,t),s=p5(t?.locale),o=g5(t?.locale),a=t?.mergeAmbiguousCharacters?w1(s,o):_3(s,o);return e+i.map((v,l)=>l===0?s(v):a(v,l)).join(t?.delimiter??"")+r}function Ga(n,t){let[e,i,r]=Re(n,t),s=p5(t?.locale),o=g5(t?.locale),a=t?.mergeAmbiguousCharacters?w1(s,o):_3(s,o);return e+i.map(a).join(t?.delimiter??"")+r}function Na(n,t){return Ji(n,{delimiter:"_",...t})}function Ji(n,t){let[e,i,r]=Re(n,t),s=p5(t?.locale),o=g5(t?.locale);return e+i.map(w1(s,o)).join(t?.delimiter??" ")+r}function Wa(n,t){let[e,i,r]=Re(n,t);return e+i.map(g5(t?.locale)).join(t?.delimiter??"_")+r}function Va(n,t){return m5(n,{delimiter:".",...t})}function ja(n,t){return m5(n,{delimiter:"-",...t})}function Ya(n,t){return m5(n,{delimiter:"/",...t})}function Qa(n,t){let[e,i,r]=Re(n,t),s=p5(t?.locale),o=g5(t?.locale),a=w1(s,o);return e+i.map((v,l)=>l===0?a(v):s(v)).join(t?.delimiter??" ")+r}function qi(n,t){return m5(n,{delimiter:"_",...t})}function Ka(n,t){return Ji(n,{delimiter:"-",...t})}function p5(n){return n===!1?t=>t.toLowerCase():t=>t.toLocaleLowerCase(n)}function g5(n){return n===!1?t=>t.toUpperCase():t=>t.toLocaleUpperCase(n)}function w1(n,t){return e=>`${t(e[0])}${n(e.slice(1))}`}function _3(n,t){return(e,i)=>{let r=e[0];return(i>0&&r>="0"&&r<="9"?"_"+r:t(r))+n(e.slice(1))}}function Re(n,t={}){let e=t.split??(t.separateNumbers?y3:Ki),i=t.prefixCharacters??b3,r=t.suffixCharacters??b3,s=0,o=n.length;for(;s<n.length;){let a=n.charAt(s);if(!i.includes(a))break;s++}for(;o>s;){let a=o-1,v=n.charAt(a);if(!r.includes(v))break;o=a}return[n.slice(0,s),e(n.slice(s,o)),n.slice(o)]}var za,Da,Fa,La,g3,b3,Zi=mt(()=>{x();R();M();k();za=/([\p{Ll}\d])(\p{Lu})/gu,Da=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,Fa=/(\d)\p{Ll}|(\p{L})\d/u,La=/[^\p{L}\d]+/giu,g3="$1\0$2",b3=""});var A3=et((Bg,Ja)=>{Ja.exports={version:"1.21.4",attackable:["acacia_boat","acacia_chest_boat","allay","armadillo","armor_stand","axolotl","bamboo_chest_raft","bamboo_raft","bat","bee","birch_boat","birch_chest_boat","blaze","bogged","breeze","camel","cat","cave_spider","cherry_boat","cherry_chest_boat","chest_minecart","chicken","cod","command_block_minecart","cow","creaking","creeper","dark_oak_boat","dark_oak_chest_boat","dolphin","donkey","drowned","elder_guardian","end_crystal","ender_dragon","enderman","endermite","evoker","falling_block","fox","frog","furnace_minecart","ghast","giant","glow_item_frame","glow_squid","goat","guardian","hoglin","hopper_minecart","horse","husk","illusioner","iron_golem","item_frame","jungle_boat","jungle_chest_boat","leash_knot","llama","magma_cube","mangrove_boat","mangrove_chest_boat","minecart","mooshroom","mule","oak_boat","oak_chest_boat","ocelot","painting","pale_oak_boat","pale_oak_chest_boat","panda","parrot","phantom","pig","piglin","piglin_brute","pillager","player","polar_bear","pufferfish","rabbit","ravager","salmon","sheep","shulker","shulker_bullet","silverfish","skeleton","skeleton_horse","slime","sniffer","snow_golem","spawner_minecart","spider","spruce_boat","spruce_chest_boat","squid","stray","strider","tadpole","tnt","tnt_minecart","trader_llama","tropical_fish","turtle","vex","villager","vindicator","wandering_trader","warden","wind_charge","witch","wither","wither_skeleton","wolf","zoglin","zombie","zombie_horse","zombie_villager","zombified_piglin"],notAttackable:["area_effect_cloud","arrow","block_display","breeze_wind_charge","dragon_fireball","egg","ender_pearl","evoker_fangs","experience_bottle","experience_orb","eye_of_ender","fireball","firework_rocket","fishing_bobber","interaction","item","item_display","lightning_bolt","llama_spit","marker","ominous_item_spawner","potion","small_fireball","snowball","spectral_arrow","text_display","trident","wither_skull"],entityRenames:{Boat:"oak_boat",EnderCrystal:"end_crystal",EntityHorse:"horse",EyeOfEnderSignal:"eye_of_ender",FallingSand:"falling_block",FireworksRocketEntity:"firework_rocket","Fishing Float":"fishing_bobber","Fishing Hook":"fishing_bobber",LavaSlime:"magma_cube",MinecartRideable:"minecart",Mob:!1,Monster:!1,MushroomCow:"mooshroom",Ozelot:"ocelot",PigZombie:"zombified_piglin",PrimedTnt:"tnt",SnowMan:"snow_golem",ThrownEgg:"egg",ThrownEnderpearl:"ender_pearl",ThrownExpBottle:"experience_bottle",ThrownPotion:"potion",VillagerGolem:"iron_golem",WitherBoss:"wither",XPOrb:"experience_orb",activated_tnt:"tnt",armorstand:"armor_stand",boat:"oak_boat",chest_boat:"oak_chest_boat",commandblock_minecart:"command_block_minecart",creaking_transient:"creaking",ender_crystal:"end_crystal",endercrystal:"end_crystal",evocation_fangs:"evoker_fangs",evocation_illager:"evoker",eye_of_ender_signal:"eye_of_ender",falling_objects:"falling_block",firecharge:"fireball",fireworks_rocket:"firework_rocket",fishing_hook:"fishing_bobber",illusion_illager:"illusioner",item_frames:"item_frame",item_stack:"item",snowman:"snow_golem",thrown_enderpearl:"ender_pearl","thrown_exp bottle":"experience_bottle",thrown_exp_bottle:"experience_bottle",thrown_potion:"potion",tipped_arrow:"arrow",villager_golem:"iron_golem",vindication_illager:"vindicator",xp_bottle:"experience_bottle",xp_orb:"experience_orb",zombie_pigman:"zombified_piglin"}}});var x3=et((Pg,E3)=>{x();R();M();k();var ke=1e3,Me=ke*60,Te=Me*60,ie=Te*24,qa=ie*7,Za=ie*365.25;E3.exports=function(n,t){t=t||{};var e=typeof n;if(e==="string"&&n.length>0)return Xa(n);if(e==="number"&&isFinite(n))return t.long?t7(n):$a(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function Xa(n){if(n=String(n),!(n.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(t){var e=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return e*Za;case"weeks":case"week":case"w":return e*qa;case"days":case"day":case"d":return e*ie;case"hours":case"hour":case"hrs":case"hr":case"h":return e*Te;case"minutes":case"minute":case"mins":case"min":case"m":return e*Me;case"seconds":case"second":case"secs":case"sec":case"s":return e*ke;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function $a(n){var t=Math.abs(n);return t>=ie?Math.round(n/ie)+"d":t>=Te?Math.round(n/Te)+"h":t>=Me?Math.round(n/Me)+"m":t>=ke?Math.round(n/ke)+"s":n+"ms"}function t7(n){var t=Math.abs(n);return t>=ie?A1(n,t,ie,"day"):t>=Te?A1(n,t,Te,"hour"):t>=Me?A1(n,t,Me,"minute"):t>=ke?A1(n,t,ke,"second"):n+" ms"}function A1(n,t,e,i){var r=t>=e*1.5;return Math.round(n/e)+" "+i+(r?"s":"")}});var k3=et((Dg,R3)=>{x();R();M();k();function e7(n){e.debug=e,e.default=e,e.coerce=v,e.disable=o,e.enable=r,e.enabled=a,e.humanize=x3(),e.destroy=l,Object.keys(n).forEach(c=>{e[c]=n[c]}),e.names=[],e.skips=[],e.formatters={};function t(c){let d=0;for(let f=0;f<c.length;f++)d=(d<<5)-d+c.charCodeAt(f),d|=0;return e.colors[Math.abs(d)%e.colors.length]}e.selectColor=t;function e(c){let d,f=null,m,g;function b(...A){if(!b.enabled)return;let _=b,w=Number(new Date),T=w-(d||w);_.diff=T,_.prev=d,_.curr=w,d=w,A[0]=e.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let S=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(H,P)=>{if(H==="%%")return"%";S++;let I=e.formatters[P];if(typeof I=="function"){let N=A[S];H=I.call(_,N),A.splice(S,1),S--}return H}),e.formatArgs.call(_,A),(_.log||e.log).apply(_,A)}return b.namespace=c,b.useColors=e.useColors(),b.color=e.selectColor(c),b.extend=i,b.destroy=e.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(m!==e.namespaces&&(m=e.namespaces,g=e.enabled(c)),g),set:A=>{f=A}}),typeof e.init=="function"&&e.init(b),b}function i(c,d){let f=e(this.namespace+(typeof d>"u"?":":d)+c);return f.log=this.log,f}function r(c){e.save(c),e.namespaces=c,e.names=[],e.skips=[];let d=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of d)f[0]==="-"?e.skips.push(f.slice(1)):e.names.push(f)}function s(c,d){let f=0,m=0,g=-1,b=0;for(;f<c.length;)if(m<d.length&&(d[m]===c[f]||d[m]==="*"))d[m]==="*"?(g=m,b=f,m++):(f++,m++);else if(g!==-1)m=g+1,b++,f=b;else return!1;for(;m<d.length&&d[m]==="*";)m++;return m===d.length}function o(){let c=[...e.names,...e.skips.map(d=>"-"+d)].join(",");return e.enable(""),c}function a(c){for(let d of e.skips)if(s(c,d))return!1;for(let d of e.names)if(s(c,d))return!0;return!1}function v(c){return c instanceof Error?c.stack||c.message:c}function l(){}return e.enable(e.load()),e}R3.exports=e7});var M3=et(($0,E1)=>{x();R();M();k();$0.formatArgs=r7;$0.save=n7;$0.load=s7;$0.useColors=i7;$0.storage=o7();$0.destroy=(()=>{let n=!1;return()=>{n||(n=!0)}})();$0.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function i7(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r7(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+E1.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;n.splice(1,0,t,"color: inherit");let e=0,i=0;n[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(e++,r==="%c"&&(i=e))}),n.splice(i,0,t)}$0.log=console.debug||console.log||(()=>{});function n7(n){try{n?$0.storage.setItem("debug",n):$0.storage.removeItem("debug")}catch{}}function s7(){let n;try{n=$0.storage.getItem("debug")||$0.storage.getItem("DEBUG")}catch{}return!n&&typeof D<"u"&&"env"in D&&(n=D.env.DEBUG),n}function o7(){try{return localStorage}catch{}}E1.exports=k3()($0);var{formatters:a7}=E1.exports;a7.j=function(n){try{return JSON.stringify(n)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var T3=et(Se=>{"use strict";x();R();M();k();var v7=Se&&Se.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Se,"__esModule",{value:!0});Se.debug=void 0;var l7=v7(M3());Se.debug=(0,l7.default)("mineflayer-mouse")});var P3=et(re=>{"use strict";x();R();M();k();var c7=re&&re.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(re,"__esModule",{value:!0});re.isEntityAttackable=void 0;re.isArmorStandAttackable=B3;var S3=(Zi(),p6(w3)),b5=c7(A3()),d7=T3(),C3=Object.fromEntries([...b5.default.attackable,...b5.default.notAttackable].map(n=>[n,!0])),u7=b5.default.attackable,f7=(n,t)=>{if(!t.name)throw new Error("Entity has no name");let e=n.entitiesByName[t.name],r=b5.default.entityRenames[t.name]||b5.default.entityRenames[(0,S3.snakeCase)(t.name)]||t.name;if(!C3[r]&&(r=(0,S3.snakeCase)(r),!C3[r]))return(0,d7.debug)(`Cannot find entity ${r} in entityData.json`),!1;let s=h7[r];return s?s(t,e):u7.includes(r)};re.isEntityAttackable=f7;var h7={armor_stand:B3};function B3(n,t){let e=Number(n.metadata?.[t.metadataKeys?.indexOf("client_flags")??14]??0),i=(e&16)!==0,r=(e&8)!==0,s=(e&4)!==0,o=(e&1)!==0;return!i}});var po=et((mx,I4)=>{I4.exports={version:"1.20.4","1.8":{blocks:[["wood_planks","planks"],["large_flowers","double_plant"]]},"1.12":{items:[["totem","totem_of_undying"]]},"1.13":{blocks:[["grass","grass_block"],["planks","oak_planks"],["planks","spruce_planks"],["planks","birch_planks"],["planks","jungle_planks"],["planks","acacia_planks"],["planks","dark_oak_planks"],["sapling","oak_sapling"],["sapling","spruce_sapling"],["sapling","birch_sapling"],["sapling","jungle_sapling"],["sapling","acacia_sapling"],["sapling","dark_oak_sapling"],["sand","red_sand"],["log","oak_log"],["log","spruce_log"],["log","birch_log"],["log","jungle_log"],["log","oak_wood"],["log","spruce_wood"],["log","birch_wood"],["log","jungle_wood"],["leaves","oak_leaves"],["leaves","spruce_leaves"],["leaves","birch_leaves"],["leaves","jungle_leaves"],["sponge","wet_sponge"],["sandstone","chiseled_sandstone"],["sandstone","cut_sandstone"],["noteblock","note_block"],["bed","red_bed"],["golden_rail","powered_rail"],["web","cobweb"],["tallgrass","dead_bush"],["tallgrass","grass"],["tallgrass","fern"],["deadbush","dead_bush"],["wool","white_wool"],["wool","orange_wool"],["wool","magenta_wool"],["wool","light_blue_wool"],["wool","yellow_wool"],["wool","lime_wool"],["wool","pink_wool"],["wool","gray_wool"],["wool","light_gray_wool"],["wool","cyan_wool"],["wool","purple_wool"],["wool","blue_wool"],["wool","brown_wool"],["wool","green_wool"],["wool","red_wool"],["wool","black_wool"],["piston_extension","moving_piston"],["yellow_flower","dandelion"],["red_flower","poppy"],["red_flower","blue_orchid"],["red_flower","allium"],["red_flower","azure_bluet"],["red_flower","red_tulip"],["red_flower","orange_tulip"],["red_flower","white_tulip"],["red_flower","pink_tulip"],["red_flower","oxeye_daisy"],["double_stone_slab","stone_slab"],["double_stone_slab","sandstone_slab"],["double_stone_slab","petrified_oak_slab"],["double_stone_slab","cobblestone_slab"],["double_stone_slab","brick_slab"],["double_stone_slab","stone_brick_slab"],["double_stone_slab","nether_brick_slab"],["double_stone_slab","quartz_slab"],["double_stone_slab","smooth_stone"],["double_stone_slab","smooth_sandstone"],["double_stone_slab","smooth_quartz"],["stone_slab","sandstone_slab"],["stone_slab","petrified_oak_slab"],["stone_slab","cobblestone_slab"],["stone_slab","brick_slab"],["stone_slab","stone_brick_slab"],["stone_slab","nether_brick_slab"],["stone_slab","quartz_slab"],["brick_block","bricks"],["mob_spawner","spawner"],["lit_furnace","furnace"],["standing_sign","sign"],["wooden_door","oak_door"],["stone_stairs","cobblestone_stairs"],["wooden_pressure_plate","oak_pressure_plate"],["lit_redstone_ore","redstone_ore"],["unlit_redstone_torch","redstone_wall_torch"],["unlit_redstone_torch","redstone_torch"],["redstone_torch","redstone_wall_torch"],["snow_layer","snow"],["snow","snow_block"],["reeds","sugar_cane"],["fence","oak_fence"],["pumpkin","carved_pumpkin"],["portal","nether_portal"],["lit_pumpkin","jack_o_lantern"],["unpowered_repeater","repeater"],["powered_repeater","repeater"],["stained_glass","white_stained_glass"],["stained_glass","orange_stained_glass"],["stained_glass","magenta_stained_glass"],["stained_glass","light_blue_stained_glass"],["stained_glass","yellow_stained_glass"],["stained_glass","lime_stained_glass"],["stained_glass","pink_stained_glass"],["stained_glass","gray_stained_glass"],["stained_glass","light_gray_stained_glass"],["stained_glass","cyan_stained_glass"],["stained_glass","purple_stained_glass"],["stained_glass","blue_stained_glass"],["stained_glass","brown_stained_glass"],["stained_glass","green_stained_glass"],["stained_glass","red_stained_glass"],["stained_glass","black_stained_glass"],["trapdoor","oak_trapdoor"],["monster_egg","infested_stone"],["monster_egg","infested_cobblestone"],["monster_egg","infested_stone_bricks"],["monster_egg","infested_mossy_stone_bricks"],["monster_egg","infested_cracked_stone_bricks"],["monster_egg","infested_chiseled_stone_bricks"],["stonebrick","stone_bricks"],["stonebrick","mossy_stone_bricks"],["stonebrick","cracked_stone_bricks"],["stonebrick","chiseled_stone_bricks"],["brown_mushroom_block","mushroom_stem"],["red_mushroom_block","mushroom_stem"],["melon_block","melon"],["fence_gate","oak_fence_gate"],["waterlily","lily_pad"],["nether_brick","nether_bricks"],["lit_redstone_lamp","redstone_lamp"],["double_wooden_slab","oak_slab"],["double_wooden_slab","spruce_slab"],["double_wooden_slab","birch_slab"],["double_wooden_slab","jungle_slab"],["double_wooden_slab","acacia_slab"],["double_wooden_slab","dark_oak_slab"],["wooden_slab","oak_slab"],["wooden_slab","spruce_slab"],["wooden_slab","birch_slab"],["wooden_slab","jungle_slab"],["wooden_slab","acacia_slab"],["wooden_slab","dark_oak_slab"],["cobblestone_wall","mossy_cobblestone_wall"],["flower_pot","potted_poppy"],["flower_pot","potted_dandelion"],["flower_pot","potted_oak_sapling"],["flower_pot","potted_spruce_sapling"],["flower_pot","potted_birch_sapling"],["flower_pot","potted_jungle_sapling"],["flower_pot","potted_red_mushroom"],["flower_pot","potted_brown_mushroom"],["flower_pot","potted_cactus"],["flower_pot","potted_dead_bush"],["flower_pot","potted_fern"],["flower_pot","potted_acacia_sapling"],["flower_pot","potted_dark_oak_sapling"],["flower_pot","potted_blue_orchid"],["flower_pot","potted_allium"],["wooden_button","oak_button"],["skull","skeleton_skull"],["skull","skeleton_wall_skull"],["anvil","chipped_anvil"],["anvil","damaged_anvil"],["unpowered_comparator","comparator"],["powered_comparator","comparator"],["quartz_ore","nether_quartz_ore"],["quartz_block","chiseled_quartz_block"],["quartz_block","quartz_pillar"],["stained_hardened_clay","white_terracotta"],["stained_hardened_clay","orange_terracotta"],["stained_hardened_clay","magenta_terracotta"],["stained_hardened_clay","light_blue_terracotta"],["stained_hardened_clay","yellow_terracotta"],["stained_hardened_clay","lime_terracotta"],["stained_hardened_clay","pink_terracotta"],["stained_hardened_clay","gray_terracotta"],["stained_hardened_clay","light_gray_terracotta"],["stained_hardened_clay","cyan_terracotta"],["stained_hardened_clay","purple_terracotta"],["stained_hardened_clay","blue_terracotta"],["stained_hardened_clay","brown_terracotta"],["stained_hardened_clay","green_terracotta"],["stained_hardened_clay","red_terracotta"],["stained_hardened_clay","black_terracotta"],["stained_glass_pane","white_stained_glass_pane"],["stained_glass_pane","orange_stained_glass_pane"],["stained_glass_pane","magenta_stained_glass_pane"],["stained_glass_pane","light_blue_stained_glass_pane"],["stained_glass_pane","yellow_stained_glass_pane"],["stained_glass_pane","lime_stained_glass_pane"],["stained_glass_pane","pink_stained_glass_pane"],["stained_glass_pane","gray_stained_glass_pane"],["stained_glass_pane","light_gray_stained_glass_pane"],["stained_glass_pane","cyan_stained_glass_pane"],["stained_glass_pane","purple_stained_glass_pane"],["stained_glass_pane","blue_stained_glass_pane"],["stained_glass_pane","brown_stained_glass_pane"],["stained_glass_pane","green_stained_glass_pane"],["stained_glass_pane","red_stained_glass_pane"],["stained_glass_pane","black_stained_glass_pane"],["leaves2","acacia_leaves"],["leaves2","dark_oak_leaves"],["log2","acacia_log"],["log2","dark_oak_log"],["log2","acacia_wood"],["log2","dark_oak_wood"],["slime","slime_block"],["prismarine","prismarine_bricks"],["prismarine","dark_prismarine"],["carpet","white_carpet"],["carpet","orange_carpet"],["carpet","magenta_carpet"],["carpet","light_blue_carpet"],["carpet","yellow_carpet"],["carpet","lime_carpet"],["carpet","pink_carpet"],["carpet","gray_carpet"],["carpet","light_gray_carpet"],["carpet","cyan_carpet"],["carpet","purple_carpet"],["carpet","blue_carpet"],["carpet","brown_carpet"],["carpet","green_carpet"],["carpet","red_carpet"],["carpet","black_carpet"],["hardened_clay","terracotta"],["double_plant","sunflower"],["double_plant","lilac"],["double_plant","tall_grass"],["double_plant","large_fern"],["double_plant","rose_bush"],["double_plant","peony"],["standing_banner","white_banner"],["wall_banner","white_wall_banner"],["daylight_detector_inverted","daylight_detector"],["red_sandstone","chiseled_red_sandstone"],["red_sandstone","cut_red_sandstone"],["double_stone_slab2","red_sandstone_slab"],["double_stone_slab2","smooth_red_sandstone"],["stone_slab2","red_sandstone_slab"],["purpur_double_slab","purpur_slab"],["end_bricks","end_stone_bricks"],["magma","magma_block"],["red_nether_brick","red_nether_bricks"],["concrete","white_concrete"],["concrete","orange_concrete"],["concrete","magenta_concrete"],["concrete","light_blue_concrete"],["concrete","yellow_concrete"],["concrete","lime_concrete"],["concrete","pink_concrete"],["concrete","gray_concrete"],["concrete","light_gray_concrete"],["concrete","cyan_concrete"],["concrete","purple_concrete"],["concrete","blue_concrete"],["concrete","brown_concrete"],["concrete","green_concrete"],["concrete","red_concrete"],["concrete","black_concrete"],["concrete_powder","white_concrete_powder"],["concrete_powder","orange_concrete_powder"],["concrete_powder","magenta_concrete_powder"],["concrete_powder","light_blue_concrete_powder"],["concrete_powder","yellow_concrete_powder"],["concrete_powder","lime_concrete_powder"],["concrete_powder","pink_concrete_powder"],["concrete_powder","gray_concrete_powder"],["concrete_powder","light_gray_concrete_powder"],["concrete_powder","cyan_concrete_powder"],["concrete_powder","purple_concrete_powder"],["concrete_powder","blue_concrete_powder"],["concrete_powder","brown_concrete_powder"],["concrete_powder","green_concrete_powder"],["concrete_powder","red_concrete_powder"],["concrete_powder","black_concrete_powder"]],items:[["stone","granite"],["stone","polished_granite"],["stone","diorite"],["stone","polished_diorite"],["stone","andesite"],["stone","polished_andesite"],["grass","grass_block"],["dirt","coarse_dirt"],["dirt","podzol"],["planks","oak_planks"],["planks","spruce_planks"],["planks","birch_planks"],["planks","jungle_planks"],["planks","acacia_planks"],["planks","dark_oak_planks"],["sapling","oak_sapling"],["sapling","spruce_sapling"],["sapling","birch_sapling"],["sapling","jungle_sapling"],["sapling","acacia_sapling"],["sapling","dark_oak_sapling"],["sand","red_sand"],["log","oak_log"],["log","spruce_log"],["log","birch_log"],["log","jungle_log"],["leaves","oak_leaves"],["leaves","spruce_leaves"],["leaves","birch_leaves"],["leaves","jungle_leaves"],["sponge","wet_sponge"],["sandstone","chiseled_sandstone"],["sandstone","cut_sandstone"],["noteblock","note_block"],["golden_rail","powered_rail"],["web","cobweb"],["tallgrass","grass"],["tallgrass","fern"],["deadbush","dead_bush"],["wool","white_wool"],["wool","orange_wool"],["wool","magenta_wool"],["wool","light_blue_wool"],["wool","yellow_wool"],["wool","lime_wool"],["wool","pink_wool"],["wool","gray_wool"],["wool","light_gray_wool"],["wool","cyan_wool"],["wool","purple_wool"],["wool","blue_wool"],["wool","brown_wool"],["wool","green_wool"],["wool","red_wool"],["wool","black_wool"],["yellow_flower","dandelion"],["red_flower","poppy"],["red_flower","blue_orchid"],["red_flower","allium"],["red_flower","azure_bluet"],["red_flower","red_tulip"],["red_flower","orange_tulip"],["red_flower","white_tulip"],["red_flower","pink_tulip"],["red_flower","oxeye_daisy"],["stone_slab","sandstone_slab"],["stone_slab","cobblestone_slab"],["stone_slab","brick_slab"],["stone_slab","stone_brick_slab"],["stone_slab","nether_brick_slab"],["stone_slab","quartz_slab"],["brick_block","bricks"],["mob_spawner","spawner"],["stone_stairs","cobblestone_stairs"],["wooden_pressure_plate","oak_pressure_plate"],["snow_layer","snow"],["snow","snow_block"],["fence","oak_fence"],["pumpkin","carved_pumpkin"],["lit_pumpkin","jack_o_lantern"],["stained_glass","white_stained_glass"],["stained_glass","orange_stained_glass"],["stained_glass","magenta_stained_glass"],["stained_glass","light_blue_stained_glass"],["stained_glass","yellow_stained_glass"],["stained_glass","lime_stained_glass"],["stained_glass","pink_stained_glass"],["stained_glass","gray_stained_glass"],["stained_glass","light_gray_stained_glass"],["stained_glass","cyan_stained_glass"],["stained_glass","purple_stained_glass"],["stained_glass","blue_stained_glass"],["stained_glass","brown_stained_glass"],["stained_glass","green_stained_glass"],["stained_glass","red_stained_glass"],["stained_glass","black_stained_glass"],["trapdoor","oak_trapdoor"],["monster_egg","infested_stone"],["monster_egg","infested_cobblestone"],["monster_egg","infested_stone_bricks"],["monster_egg","infested_mossy_stone_bricks"],["monster_egg","infested_cracked_stone_bricks"],["monster_egg","infested_chiseled_stone_bricks"],["stonebrick","stone_bricks"],["stonebrick","mossy_stone_bricks"],["stonebrick","cracked_stone_bricks"],["stonebrick","chiseled_stone_bricks"],["melon_block","melon"],["fence_gate","oak_fence_gate"],["waterlily","lily_pad"],["nether_brick","nether_bricks"],["wooden_slab","oak_slab"],["wooden_slab","spruce_slab"],["wooden_slab","birch_slab"],["wooden_slab","jungle_slab"],["wooden_slab","acacia_slab"],["wooden_slab","dark_oak_slab"],["cobblestone_wall","mossy_cobblestone_wall"],["wooden_button","oak_button"],["anvil","chipped_anvil"],["anvil","damaged_anvil"],["quartz_ore","nether_quartz_ore"],["quartz_block","chiseled_quartz_block"],["quartz_block","quartz_pillar"],["stained_hardened_clay","white_terracotta"],["stained_hardened_clay","orange_terracotta"],["stained_hardened_clay","magenta_terracotta"],["stained_hardened_clay","light_blue_terracotta"],["stained_hardened_clay","yellow_terracotta"],["stained_hardened_clay","lime_terracotta"],["stained_hardened_clay","pink_terracotta"],["stained_hardened_clay","gray_terracotta"],["stained_hardened_clay","light_gray_terracotta"],["stained_hardened_clay","cyan_terracotta"],["stained_hardened_clay","purple_terracotta"],["stained_hardened_clay","blue_terracotta"],["stained_hardened_clay","brown_terracotta"],["stained_hardened_clay","green_terracotta"],["stained_hardened_clay","red_terracotta"],["stained_hardened_clay","black_terracotta"],["stained_glass_pane","white_stained_glass_pane"],["stained_glass_pane","orange_stained_glass_pane"],["stained_glass_pane","magenta_stained_glass_pane"],["stained_glass_pane","light_blue_stained_glass_pane"],["stained_glass_pane","yellow_stained_glass_pane"],["stained_glass_pane","lime_stained_glass_pane"],["stained_glass_pane","pink_stained_glass_pane"],["stained_glass_pane","gray_stained_glass_pane"],["stained_glass_pane","light_gray_stained_glass_pane"],["stained_glass_pane","cyan_stained_glass_pane"],["stained_glass_pane","purple_stained_glass_pane"],["stained_glass_pane","blue_stained_glass_pane"],["stained_glass_pane","brown_stained_glass_pane"],["stained_glass_pane","green_stained_glass_pane"],["stained_glass_pane","red_stained_glass_pane"],["stained_glass_pane","black_stained_glass_pane"],["leaves2","acacia_leaves"],["leaves2","dark_oak_leaves"],["log2","acacia_log"],["log2","dark_oak_log"],["slime","slime_block"],["prismarine","prismarine_bricks"],["prismarine","dark_prismarine"],["carpet","white_carpet"],["carpet","orange_carpet"],["carpet","magenta_carpet"],["carpet","light_blue_carpet"],["carpet","yellow_carpet"],["carpet","lime_carpet"],["carpet","pink_carpet"],["carpet","gray_carpet"],["carpet","light_gray_carpet"],["carpet","cyan_carpet"],["carpet","purple_carpet"],["carpet","blue_carpet"],["carpet","brown_carpet"],["carpet","green_carpet"],["carpet","red_carpet"],["carpet","black_carpet"],["hardened_clay","terracotta"],["double_plant","sunflower"],["double_plant","lilac"],["double_plant","tall_grass"],["double_plant","large_fern"],["double_plant","rose_bush"],["double_plant","peony"],["red_sandstone","chiseled_red_sandstone"],["red_sandstone","cut_red_sandstone"],["stone_slab2","red_sandstone_slab"],["end_bricks","end_stone_bricks"],["magma","magma_block"],["red_nether_brick","red_nether_bricks"],["silver_shulker_box","light_gray_shulker_box"],["silver_glazed_terracotta","light_gray_glazed_terracotta"],["concrete","white_concrete"],["concrete","orange_concrete"],["concrete","magenta_concrete"],["concrete","light_blue_concrete"],["concrete","yellow_concrete"],["concrete","lime_concrete"],["concrete","pink_concrete"],["concrete","gray_concrete"],["concrete","light_gray_concrete"],["concrete","cyan_concrete"],["concrete","purple_concrete"],["concrete","blue_concrete"],["concrete","brown_concrete"],["concrete","green_concrete"],["concrete","red_concrete"],["concrete","black_concrete"],["concrete_powder","white_concrete_powder"],["concrete_powder","orange_concrete_powder"],["concrete_powder","magenta_concrete_powder"],["concrete_powder","light_blue_concrete_powder"],["concrete_powder","yellow_concrete_powder"],["concrete_powder","lime_concrete_powder"],["concrete_powder","pink_concrete_powder"],["concrete_powder","gray_concrete_powder"],["concrete_powder","light_gray_concrete_powder"],["concrete_powder","cyan_concrete_powder"],["concrete_powder","purple_concrete_powder"],["concrete_powder","blue_concrete_powder"],["concrete_powder","brown_concrete_powder"],["concrete_powder","green_concrete_powder"],["concrete_powder","red_concrete_powder"],["concrete_powder","black_concrete_powder"],["coal","charcoal"],["golden_apple","enchanted_golden_apple"],["wooden_door","oak_door"],["boat","oak_boat"],["reeds","sugar_cane"],["fish","cod"],["fish","salmon"],["fish","tropical_fish"],["fish","pufferfish"],["cooked_fish","cooked_cod"],["cooked_fish","cooked_salmon"],["dye","ink_sac"],["dye","rose_red"],["dye","cactus_green"],["dye","cocoa_beans"],["dye","lapis_lazuli"],["dye","purple_dye"],["dye","cyan_dye"],["dye","light_gray_dye"],["dye","gray_dye"],["dye","pink_dye"],["dye","lime_dye"],["dye","dandelion_yellow"],["dye","light_blue_dye"],["dye","magenta_dye"],["dye","orange_dye"],["dye","bone_meal"],["bed","white_bed"],["bed","orange_bed"],["bed","magenta_bed"],["bed","light_blue_bed"],["bed","yellow_bed"],["bed","lime_bed"],["bed","pink_bed"],["bed","gray_bed"],["bed","light_gray_bed"],["bed","cyan_bed"],["bed","purple_bed"],["bed","blue_bed"],["bed","brown_bed"],["bed","green_bed"],["bed","red_bed"],["bed","black_bed"],["melon","melon_slice"],["speckled_melon","glistering_melon_slice"],["spawn_egg","pig_spawn_egg"],["skull","skeleton_skull"],["skull","wither_skeleton_skull"],["skull","zombie_head"],["skull","player_head"],["skull","creeper_head"],["skull","dragon_head"],["fireworks","firework_rocket"],["firework_charge","firework_star"],["netherbrick","nether_brick"],["banner","black_banner"],["banner","red_banner"],["banner","green_banner"],["banner","brown_banner"],["banner","blue_banner"],["banner","purple_banner"],["banner","cyan_banner"],["banner","light_gray_banner"],["banner","gray_banner"],["banner","pink_banner"],["banner","lime_banner"],["banner","yellow_banner"],["banner","light_blue_banner"],["banner","magenta_banner"],["banner","orange_banner"],["banner","white_banner"],["chorus_fruit_popped","popped_chorus_fruit"],["record_13","music_disc_13"],["record_cat","music_disc_cat"],["record_blocks","music_disc_blocks"],["record_chirp","music_disc_chirp"],["record_far","music_disc_far"],["record_mall","music_disc_mall"],["record_mellohi","music_disc_mellohi"],["record_stal","music_disc_stal"],["record_strad","music_disc_strad"],["record_ward","music_disc_ward"],["record_11","music_disc_11"],["record_wait","music_disc_wait"]]},"1.14":{blocks:[["sign","oak_sign"],["wall_sign","oak_wall_sign"]],items:[["sign","oak_sign"],["rose_red","red_dye"],["cactus_green","green_dye"],["dandelion_yellow","yellow_dye"]]},"1.15.2":{blocks:[],items:[]},"1.16.1":{blocks:[],items:[["zombie_pigman_spawn_egg","zombified_piglin_spawn_egg"]]},"1.16.2":{blocks:[],items:[]},"1.17":{blocks:[["grass_path","dirt_path"]],items:[["grass_path","dirt_path"]]},"1.18":{blocks:[],items:[]},"1.19":{blocks:[],items:[]},"1.19.3":{blocks:[],items:[]},"1.19.4":{blocks:[],items:[]},"1.20":{blocks:[],items:[["pottery_shard_archer","archer_pottery_sherd"],["pottery_shard_prize","prize_pottery_sherd"],["pottery_shard_arms_up","arms_up_pottery_sherd"],["pottery_shard_skull","skull_pottery_sherd"]]},"1.16":{items:[["zombie_pigman_spawn_egg","zombified_piglin_spawn_egg"]]},"1.20.3":{blocks:[["grass","short_grass"]],items:[["grass","short_grass"]]}}});var go=et(F1=>{"use strict";x();R();M();k();Object.defineProperty(F1,"__esModule",{value:!0});F1.versionToNumber=void 0;var H4=n=>{let[t,e="0",i="0"]=n.split(".");return+`${t.padStart(2,"0")}${parseInt(e).toString().padStart(2,"0")}${parseInt(i).toString().padStart(2,"0")}`};F1.versionToNumber=H4});var yo=et(ze=>{"use strict";x();R();M();k();var O4=ze&&ze.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ze,"__esModule",{value:!0});ze.getRenamedData=void 0;var bo=O4(po()),Ot=go(),z4=(n,t,e,i)=>{let r=(0,Ot.versionToNumber)(e),s=(0,Ot.versionToNumber)(i),o=r<s?1:-1,a=o>0?1:0,v=t,l=Object.keys(bo.default).sort((f,m)=>o*((0,Ot.versionToNumber)(f)-(0,Ot.versionToNumber)(m))),c=o>0?s:r,d=o>0?r:s;for(let f of l.filter(m=>(0,Ot.versionToNumber)(m)<=c&&(0,Ot.versionToNumber)(m)>=d)){if(o>0&&(0,Ot.versionToNumber)(f)>=c||o<0&&(0,Ot.versionToNumber)(f)<=d)break;let m=bo.default[f][n];if(m)for(let g of m){let b=g[a],A=g[1-a];if(Array.isArray(v))v.includes(A)&&(v=v.map(_=>_===A?b:_));else if(v===A){v=b;break}}}return v};ze.getRenamedData=z4});var Io={};G5(Io,{applyWorldGeometryExport:()=>Y4,createMeshesFromExport:()=>Bo,downloadWorldGeometry:()=>kr,exportWorldGeometry:()=>Co,loadTextureFromDataUrl:()=>Po,loadWorldGeometryFromUrl:()=>V4});import*as C0 from"three";function Co(n,t,e,i=!1){let r=[];for(let[o,a]of Object.entries(n.sectionObjects)){let v=a.children.find(A=>A.name==="mesh");if(!v?.geometry)continue;let{geometry:l}=v,c=l.getAttribute("position"),d=l.getAttribute("normal"),f=l.getAttribute("color"),m=l.getAttribute("uv"),g=l.index;if(!c||!g)continue;let b=n.sceneOrigin.getWorldPosition(v);r.push({key:o,position:{x:b?.x??n.sceneOrigin.toWorldX(v.position.x),y:b?.y??n.sceneOrigin.toWorldY(v.position.y),z:b?.z??n.sceneOrigin.toWorldZ(v.position.z)},geometry:{positions:[...c.array],normals:d?[...d.array]:[],colors:f?[...f.array]:[],uvs:m?[...m.array]:[],indices:[...g.array]}})}let s={version:n.version??"unknown",exportedAt:new Date().toISOString(),camera:{position:t,rotation:e},sections:r};if(i&&n.material.map){let o=document.createElement("canvas"),a=n.material.map,{image:v}=a;v&&(o.width=v.width,o.height=v.height,o.getContext("2d").drawImage(v,0,0),s.textureAtlasDataUrl=o.toDataURL("image/png"))}return s}function kr(n,t,e,i="world-geometry.json",r=!1){let s=Co(n,t,e,r),o=JSON.stringify(s),a=new Blob([o],{type:"application/json"}),v=URL.createObjectURL(a),l=document.createElement("a");l.href=v,l.download=i,l.click(),URL.revokeObjectURL(v)}async function V4(n){let t=await fetch(n);if(!t.ok)throw new Error(`Failed to fetch world geometry: ${t.statusText}`);return t.json()}function Bo(n,t){let e=[];for(let i of n.sections){let r=new C0.BufferGeometry;r.setAttribute("position",new C0.Float32BufferAttribute(i.geometry.positions,3)),i.geometry.normals.length&&r.setAttribute("normal",new C0.Float32BufferAttribute(i.geometry.normals,3)),i.geometry.colors.length&&r.setAttribute("color",new C0.Float32BufferAttribute(i.geometry.colors,3)),i.geometry.uvs.length&&r.setAttribute("uv",new C0.Float32BufferAttribute(i.geometry.uvs,2));let o=Math.max(...i.geometry.indices)>65535?Uint32Array:Uint16Array;r.setIndex(new C0.BufferAttribute(new o(i.geometry.indices),1));let a=new C0.Mesh(r,t);a.position.set(i.position.x,i.position.y,i.position.z),a.name="mesh";let v=new C0.Group;v.name="chunk",v.add(a),e.push(v)}return e}async function Po(n){return new Promise((t,e)=>{let i=new Image;i.onload=()=>{let r=new C0.Texture(i);r.magFilter=C0.NearestFilter,r.minFilter=C0.NearestFilter,r.needsUpdate=!0,r.flipY=!1,t(r)},i.onerror=e,i.src=n})}async function Y4(n,t){let{scene:e,renderUpdateEmitter:i,material:r}=n,s=e.getObjectByName(So);s&&(e.remove(s),j4(s));let o=!!t.textureAtlasDataUrl,a;if(o&&t.textureAtlasDataUrl){let c=await Po(t.textureAtlasDataUrl);a=new C0.MeshLambertMaterial({map:c,vertexColors:!0,transparent:!0,alphaTest:.1}),a.name="geometry-export-material"}else a=r;let v=Bo(t,a),l=new C0.Group;l.name=So,o&&(l.userData.geometryExportMaterial=a);for(let c of v)l.add(c);return e.add(l),i.emit("update"),v.length}var So,j4,Mr=mt(()=>{"use strict";x();R();M();k();So="geometry-export-root";j4=n=>{n.traverse(e=>{e.isMesh&&e.geometry?.dispose()});let t=n.userData?.geometryExportMaterial;t&&(t.map?.dispose?.(),t.dispose?.())}});x();R();M();k();x();R();M();k();x();R();M();k();x();R();M();k();import{proxy as y2}from"valtio";x();R();M();k();x();R();M();k();var vi=()=>({longRenderTime:!1,constantLongRenderTime:!1,tooManyEntities:!1,tooManyTextures:!1,unknownReason:!1});x();R();M();k();var Y5=30;var li=45,ci=100;x();R();M();k();var qe=class{constructor(t){this.factors=t;u(this,"renderTimeHistory",[])}onFrame(t){this.pushRenderTime(t.totalMs),this.recompute(t)}pushRenderTime(t){this.renderTimeHistory.push(t),this.renderTimeHistory.length>24&&this.renderTimeHistory.shift()}recompute(t){let e=t.fps>0&&t.fps<=45,i=Math.max(0,t.totalMs-t.entitiesMs),r=t.totalMs>=30,s=this.renderTimeHistory.length,o=this.renderTimeHistory.filter(f=>f>=30).length,a=s>=8&&o/s>=.65,v=t.loadedTextureCount>=100,l=e&&t.entitiesMs>=8&&i<=20,d=e&&!(r||a||l||v);this.factors.longRenderTime=r,this.factors.constantLongRenderTime=a,this.factors.tooManyEntities=l,this.factors.tooManyTextures=v,this.factors.unknownReason=d}reset(){this.renderTimeHistory.length=0,this.factors.longRenderTime=!1,this.factors.constantLongRenderTime=!1,this.factors.tooManyEntities=!1,this.factors.tooManyTextures=!1,this.factors.unknownReason=!1}};x();R();M();k();var R6=[{key:"longRenderTime",code:"LR"},{key:"constantLongRenderTime",code:"CLR"},{key:"tooManyEntities",code:"ENT"},{key:"tooManyTextures",code:"TEX"},{key:"unknownReason",code:"UNK"}];function di(n){let t=R6.filter(({key:e})=>n[e]).map(({code:e})=>e);return t.length>0?t.join("+"):""}var Ze={paused:!1,showChunkBorders:!1,enableDebugOverlay:!1,debugWasmPerf:!1,debugModelVariant:void 0,futuristicReveal:!1,wasmMesher:!0,mesherWorkers:1,addChunksBatchWaitTime:200,_experimentalSmoothChunkLoading:!0,_renderByChunks:!1,autoLowerRenderDistance:!1,disableMesherConversionCache:!1,dedicatedChangeWorker:!1,shadingTheme:"high-contrast",cardinalLight:"default",dayCycle:!0,smoothLighting:!0,enableLighting:!0,starfield:!0,defaultSkybox:!0,renderEntities:!0,extraBlockRenderers:!0,foreground:!0,fov:75,volume:1,showHand:!1,viewBobbing:!1,handRenderer:"vanilla",renderEars:!0,highlightBlockColor:"blue",fetchPlayerSkins:!0,skinTexturesProxy:void 0,vrSupport:!0,vrPageGameRendering:!0,clipWorldBelowY:void 0,isPlayground:!1,instantCameraUpdate:!1,isRaining:!1,moduleStates:{}},_2={fpsLimit:void 0,sceneBackground:"lightblue",timeoutRendering:!1},Ul=(n={})=>y2({...Ze,...n}),Qt=()=>({reactive:y2({world:{chunksLoaded:new Set,heightmaps:new Map,allChunksLoaded:!1,mesherWork:!1,instabilityFactors:vi(),intersectMedia:null},renderer:"...",preventEscapeMenu:!1}),nonReactive:{fps:0,worstRenderTime:0,avgRenderTime:0,world:{chunksLoaded:new Set,chunksTotalNumber:0},renderer:{timeline:{live:[],frozen:[],lastSecond:[]}}}});x();R();M();k();import{proxy as k6}from"valtio";var ui=()=>k6({playerSkin:void 0,inWater:!1,waterBreathing:!1,backgroundColor:[0,0,0],ambientLight:0,directionalLight:0,eyeHeight:0,gameMode:void 0,lookingAtBlock:void 0,diggingBlock:void 0,movementState:"NOT_MOVING",onGround:!0,sneaking:!1,flying:!1,sprinting:!1,walkDist:0,prevWalkDist:0,bob:0,prevBob:0,itemUsageTicks:0,username:"",onlineMode:!1,cardinalLight:"default",lightingDisabled:!1,shouldHideHand:!1,heldItemMain:void 0,heldItemOff:void 0,perspective:"first_person",onFire:!1,cameraSpectatingEntity:void 0,team:void 0}),w2=n=>({isSpectator(){return n.gameMode==="spectator"},isSpectatingEntity(){return n.cameraSpectatingEntity!==void 0&&n.gameMode==="spectator"},isThirdPerson(){return this.isSpectatingEntity()?!1:n.perspective==="third_person_back"||n.perspective==="third_person_front"}}),A2=()=>({reactive:ui()});x();R();M();k();import{Vec3 as V6}from"vec3";import{proxy as M2}from"valtio";x();R();M();k();x();R();M();k();x();R();M();k();x();R();M();k();var Q5={},E2=!1;function M6(){if(E2)return Q5;E2=!0;var n=typeof Reflect=="object"?Reflect:null,t=n&&typeof n.apply=="function"?n.apply:function(C,H,P){return Function.prototype.apply.call(C,H,P)},e;n&&typeof n.ownKeys=="function"?e=n.ownKeys:Object.getOwnPropertySymbols?e=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:e=function(C){return Object.getOwnPropertyNames(C)};function i(S){}var r=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}Q5=s,Q5.once=_,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(S){if(typeof S!="number"||S<0||r(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");o=S}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||r(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function v(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}s.prototype.getMaxListeners=function(){return v(this)},s.prototype.emit=function(C){for(var H=[],P=1;P<arguments.length;P++)H.push(arguments[P]);var I=C==="error",N=this._events;if(N!==void 0)I=I&&N.error===void 0;else if(!I)return!1;if(I){var O;if(H.length>0&&(O=H[0]),O instanceof Error)throw O;var j=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw j.context=O,j}var q=N[C];if(q===void 0)return!1;if(typeof q=="function")t(q,this,H);else for(var $=q.length,e0=g(q,$),P=0;P<$;++P)t(e0[P],this,H);return!0};function l(S,C,H,P){var I,N,O;if(a(H),N=S._events,N===void 0?(N=S._events=Object.create(null),S._eventsCount=0):(N.newListener!==void 0&&(S.emit("newListener",C,H.listener?H.listener:H),N=S._events),O=N[C]),O===void 0)O=N[C]=H,++S._eventsCount;else if(typeof O=="function"?O=N[C]=P?[H,O]:[O,H]:P?O.unshift(H):O.push(H),I=v(S),I>0&&O.length>I&&!O.warned){O.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=S,j.type=C,j.count=O.length}return S}s.prototype.addListener=function(C,H){return l(this,C,H,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,H){return l(this,C,H,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(S,C,H){var P={fired:!1,wrapFn:void 0,target:S,type:C,listener:H},I=c.bind(P);return I.listener=H,P.wrapFn=I,I}s.prototype.once=function(C,H){return a(H),this.on(C,d(this,C,H)),this},s.prototype.prependOnceListener=function(C,H){return a(H),this.prependListener(C,d(this,C,H)),this},s.prototype.removeListener=function(C,H){var P,I,N,O,j;if(a(H),I=this._events,I===void 0)return this;if(P=I[C],P===void 0)return this;if(P===H||P.listener===H)--this._eventsCount===0?this._events=Object.create(null):(delete I[C],I.removeListener&&this.emit("removeListener",C,P.listener||H));else if(typeof P!="function"){for(N=-1,O=P.length-1;O>=0;O--)if(P[O]===H||P[O].listener===H){j=P[O].listener,N=O;break}if(N<0)return this;N===0?P.shift():b(P,N),P.length===1&&(I[C]=P[0]),I.removeListener!==void 0&&this.emit("removeListener",C,j||H)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var H,P,I;if(P=this._events,P===void 0)return this;if(P.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):P[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete P[C]),this;if(arguments.length===0){var N=Object.keys(P),O;for(I=0;I<N.length;++I)O=N[I],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(H=P[C],typeof H=="function")this.removeListener(C,H);else if(H!==void 0)for(I=H.length-1;I>=0;I--)this.removeListener(C,H[I]);return this};function f(S,C,H){var P=S._events;if(P===void 0)return[];var I=P[C];return I===void 0?[]:typeof I=="function"?H?[I.listener||I]:[I]:H?A(I):g(I,I.length)}s.prototype.listeners=function(C){return f(this,C,!0)},s.prototype.rawListeners=function(C){return f(this,C,!1)},s.listenerCount=function(S,C){return typeof S.listenerCount=="function"?S.listenerCount(C):m.call(S,C)},s.prototype.listenerCount=m;function m(S){var C=this._events;if(C!==void 0){var H=C[S];if(typeof H=="function")return 1;if(H!==void 0)return H.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]};function g(S,C){for(var H=new Array(C),P=0;P<C;++P)H[P]=S[P];return H}function b(S,C){for(;C+1<S.length;C++)S[C]=S[C+1];S.pop()}function A(S){for(var C=new Array(S.length),H=0;H<C.length;++H)C[H]=S[H].listener||S[H];return C}function _(S,C){return new Promise(function(H,P){function I(O){S.removeListener(C,N),P(O)}function N(){typeof S.removeListener=="function"&&S.removeListener("error",I),H([].slice.call(arguments))}T(S,C,N,{once:!0}),C!=="error"&&w(S,I,{once:!0})})}function w(S,C,H){typeof S.on=="function"&&T(S,"error",C,H)}function T(S,C,H,P){if(typeof S.on=="function")P.once?S.once(C,H):S.on(C,H);else if(typeof S.addEventListener=="function")S.addEventListener(C,function I(N){P.once&&S.removeEventListener(C,I),H(N)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Q5}var K5=M6();K5.once;K5.once=function(n,t){return new Promise((e,i)=>{function r(...o){s!==void 0&&n.removeListener("error",s),e(o)}let s;t!=="error"&&(s=o=>{n.removeListener(name,r),i(o)},n.once("error",s)),n.once(t,r)})};K5.on=function(n,t){let e=[],i=[],r=null,s=!1,o={async next(){let l=e.shift();if(l)return createIterResult(l,!1);if(r){let c=Promise.reject(r);return r=null,c}return s?createIterResult(void 0,!0):new Promise((c,d)=>i.push({resolve:c,reject:d}))},async return(){n.removeListener(t,a),n.removeListener("error",v),s=!0;for(let l of i)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){r=l,n.removeListener(t,a),n.removeListener("error",v)},[Symbol.asyncIterator](){return this}};return n.on(t,a),n.on("error",v),o;function a(...l){let c=i.shift();c?c.resolve(createIterResult(l,!1)):e.push(l)}function v(l){s=!0;let c=i.shift();c?c.reject(l):r=l,o.return()}};var{EventEmitter:Kt,defaultMaxListeners:ic,init:rc,listenerCount:nc,on:sc,once:oc}=K5;import{Vec3 as Jt}from"vec3";x();R();M();k();function Xe(n){let t=n*2+1;if(t<=0)return[];let e=[],i=0,r=0,s=0,o=-1;for(let a=0;a<t*t;a++){if(Math.abs(i)<=t/2&&Math.abs(r)<=t/2&&e.push([i,r]),i===r||i<0&&i===-r||i>0&&i===1-r){let v=s;s=-o,o=v}i+=s,r+=o}return e}var pe=n=>[Math.floor(n.x/16),Math.floor(n.z/16)],T6=n=>[Math.floor(n.x/16),Math.floor(n.y/16),Math.floor(n.z/16)],x2=async(n,t,e,i=1)=>{for(let r=0;r<n.length;r+=i)t&&await new Promise(s=>setTimeout(s,t)),await e(n[r],r)},$e=class $e extends Kt{static restoreTransferred(t,e){let i=new $e;return e&&e.addEventListener("message",({data:r})=>{r.class===$e.restorerName&&r.type==="event"&&i.emit(r.eventName,...r.args)}),i}};u($e,"restorerName","WorldViewWorker");var qt=$e,Zt=class extends Kt{constructor(e,i,r=new Jt(0,0,0)){super();this.world=e;this.viewDistance=i;u(this,"spiralNumber",0);u(this,"gotPanicLastTime",!1);u(this,"panicChunksReload",()=>{});u(this,"loadedChunks",{});u(this,"inLoading",!1);u(this,"chunkReceiveTimes",[]);u(this,"lastChunkReceiveTime",0);u(this,"lastChunkReceiveTimeAvg",0);u(this,"panicTimeout");u(this,"lastPos");u(this,"eventListeners",{});u(this,"debugChunksInfo",{});u(this,"waitingSpiralChunksLoad",{});u(this,"addWaitTime",1);u(this,"keepChunksDistance",0);u(this,"isPlayground",!1);u(this,"allowPositionUpdate",!0);u(this,"lastBiomeId",null);u(this,"lastPosCheck",null);this.lastPos=new Jt(0,0,0).update(r)}prepareForTransfer(e){if(e){let i=this.emit.bind(this);this.emit=(r,...s)=>{i(r,...s),e.postMessage({class:qt.restorerName,type:"event",eventName:r,args:s})}}return{__restorer:qt.restorerName}}setBlockStateId(e,i){let r=this.world.setBlockStateId(e,i);if(r&&typeof r.then=="function")throw new Error("setBlockStateId returned promise (not supported)");this.emit("blockUpdate",{pos:e,stateId:i})}updateViewDistance(e){this.viewDistance=e,this.emit("renderDistance",e)}async init(e,i){this.updateViewDistance(this.viewDistance),this.emit("chunkPosUpdate",{pos:e}),i?.time?.timeOfDay!==void 0&&this.emit("time",i.time.timeOfDay),i?.entity&&this.emit("playerEntity",i.entity),this.emitterGotConnected(i);let[r,s]=pe(e),o=Xe(this.viewDistance).map(([a,v])=>new Jt((r+a)*16,0,(s+v)*16));this.lastPos.update(e),await this._loadChunks(o,e)}chunkProgress(){if(this.panicTimeout&&clearTimeout(this.panicTimeout),this.chunkReceiveTimes.length>=5){let e=this.chunkReceiveTimes.reduce((r,s)=>r+s,0)/this.chunkReceiveTimes.length;this.lastChunkReceiveTimeAvg=e;let i=e*2+1e3;this.panicTimeout&&clearTimeout(this.panicTimeout),this.panicTimeout=setTimeout(()=>{!this.gotPanicLastTime&&this.inLoading&&(this.gotPanicLastTime=!0,this.panicChunksReload())},i)}}async _loadChunks(e,i){this.spiralNumber++;let{spiralNumber:r}=this;for(let o of Object.keys(this.waitingSpiralChunksLoad))this.waitingSpiralChunksLoad[o](!1),delete this.waitingSpiralChunksLoad[o];let s=!0;this.inLoading=!0,await x2(e,this.addWaitTime,async o=>{!s||this.loadedChunks[`${o.x},${o.z}`]||(this.world.getColumnAt(o)||(s=await new Promise(a=>{this.waitingSpiralChunksLoad[`${o.x},${o.z}`]=a})),s&&(await this.loadChunk(o,void 0,`spiral ${r} from ${i.x},${i.z}`),this.chunkProgress()))}),this.panicTimeout&&clearTimeout(this.panicTimeout),this.inLoading=!1,this.gotPanicLastTime=!1,this.chunkReceiveTimes=[],this.lastChunkReceiveTime=0}async loadChunk(e,i=!1,r="spiral"){var l,c;let[s,o]=pe(this.lastPos),a=Math.abs(s-Math.floor(e.x/16)),v=Math.abs(o-Math.floor(e.z/16));if(a<=this.viewDistance&&v<=this.viewDistance){let d=await this.world.getColumnAt(e.y!==void 0?e:new Jt(e.x,0,e.z));if(d){let f=d.toJson(),m={minY:d.minY??0,worldHeight:d.worldHeight??256};this.emit("loadChunk",{x:e.x,z:e.z,chunk:f,blockEntities:d.blockEntities,worldConfig:m,isLightUpdate:i}),this.loadedChunks[`${e.x},${e.z}`]=!0,(l=this.debugChunksInfo)[c=`${e.x},${e.z}`]??(l[c]={loads:[]}),this.debugChunksInfo[`${e.x},${e.z}`].loads.push({dataLength:f.length,reason:r,time:Date.now()})}else this.isPlayground&&this.emit("markAsLoaded",{x:e.x,z:e.z})}}unloadAllChunks(){for(let e of Object.keys(this.loadedChunks)){let[i,r]=e.split(",").map(Number);this.unloadChunk({x:i,z:r})}}unloadChunk(e){this.emit("unloadChunk",{x:e.x,z:e.z}),delete this.loadedChunks[`${e.x},${e.z}`],delete this.debugChunksInfo[`${e.x},${e.z}`]}emitterGotConnected(e){typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope||!e||this.emit("blockEntities",new Proxy({},{get(r,s,o){if(typeof s!="string")return;let[a,v,l]=s.split(",").map(Number);return e.world.getBlock(new Jt(a,v,l))?.entity}}))}updateBiome(e){try{if(!this.world.getBiome)return;let i=this.world.getBiome(e);i!==this.lastBiomeId&&(this.lastBiomeId=i,this.emit("biomeReset"))}catch{}}async updatePosition(e,i=!1){if(!this.allowPositionUpdate)return;let r=e.floored();if(!i&&this.lastPosCheck&&this.lastPosCheck.equals(r))return;this.lastPosCheck=r,this.updateBiome(e);let[s,o]=pe(this.lastPos),[a,v]=pe(e);if(s!==a||o!==v||i){this.emit("chunkPosUpdate",{pos:e});let l=[],c=i?this.viewDistance:this.viewDistance+this.keepChunksDistance;for(let f of Object.keys(this.loadedChunks)){let[m,g]=f.split(",").map(Number),b=new Jt(m,0,g),[A,_]=pe(b),w=Math.abs(a-A),T=Math.abs(v-_);(w>c||T>c)&&l.push(b)}for(let f of l)this.unloadChunk(f);let d=Xe(this.viewDistance).map(([f,m])=>{let g=new Jt((a+f)*16,0,(v+m)*16);if(!this.loadedChunks[`${g.x},${g.z}`])return g}).filter(f=>!!f);this.lastPos.update(e),this._loadChunks(d,e)}else this.emit("chunkPosUpdate",{pos:e}),this.lastPos.update(e)}};x();R();M();k();x();R();M();k();import R2 from"minecraft-data";import S6 from"mc-assets/dist/blocksAtlases.json";import C6 from"mc-assets/dist/itemsAtlases.json";import B6 from"mc-assets/dist/itemDefinitions.json";import P6 from"mc-assets/dist/blocksAtlasLatest.png";import I6 from"mc-assets/dist/blocksAtlasLegacy.png";import H6 from"mc-assets/dist/itemsAtlasLatest.png";import O6 from"mc-assets/dist/itemsAtlasLegacy.png";import z6 from"mc-assets/dist/textureReplacements/christmas";import{AtlasParser as J5}from"mc-assets/dist/atlasParser";import D6 from"mc-assets/dist/worldBlockProvider";import{ItemsRenderer as F6}from"mc-assets/dist/itemsRenderer";import{getLoadedItemDefinitionsStore as L6}from"mc-assets";var ge=class{constructor(t){u(this,"sourceItemDefinitionsJson",B6);u(this,"itemsDefinitionsStore",L6(this.sourceItemDefinitionsJson));u(this,"allReady",!1);u(this,"itemsAtlasImage");u(this,"blocksAtlasImage");u(this,"blocksAtlasJson");u(this,"customBlockStates");u(this,"customModels");u(this,"customItemModelNames",{});u(this,"customTextures",{});u(this,"guiAtlas",null);u(this,"guiAtlasVersion",0);u(this,"itemsRenderer");u(this,"worldBlockProvider");u(this,"blockstatesModels",null);u(this,"version");u(this,"texturesVersion");u(this,"mcData");t&&(Object.assign(this,t),this.mcData=R2(this.version))}prepareForTransfer(){let t={};for(let e in this)Object.prototype.hasOwnProperty.call(this,e)&&typeof this[e]!="function"&&(e==="itemsRenderer"||e==="worldBlockProvider"||e==="mcData"||(t[e]=this[e]));return t.customTextures={},t}},U6="1.21.4",Tt=class Tt extends Kt{constructor(){super(...arguments);u(this,"sourceBlockStatesModels",null);u(this,"sourceBlocksAtlases",S6);u(this,"sourceItemsAtlases",C6);u(this,"currentResources");u(this,"itemsAtlasParser");u(this,"blocksAtlasParser");u(this,"currentConfig");u(this,"abortController",new AbortController);u(this,"_promiseAssetsReadyResolvers",Promise.withResolvers())}static restoreTransferred(e,i){let r=new Tt,s=o=>{r.currentResources=new ge(o)};return s(e.currentResources),i&&i.addEventListener("message",({data:o})=>{o.class===Tt.restorerName&&(o.type==="newResources"&&s(o.currentResources),o.type==="event"&&r.emit(o.eventName,...o.args))}),r}prepareForTransfer(e){if(e){let i=this.emit.bind(this);this.emit=(r,...s)=>{i(r,...s),e.postMessage({class:Tt.restorerName,type:"event",eventName:r,args:s}),(r==="assetsTexturesUpdated"||r==="assetsInventoryReady")&&e.postMessage({class:Tt.restorerName,type:"newResources",currentResources:this.currentResources?.prepareForTransfer()})}}return{__restorer:Tt.restorerName,currentResources:this.currentResources?.prepareForTransfer()}}get promiseAssetsReady(){return this._promiseAssetsReadyResolvers.promise}async loadSourceData(e=this.currentConfig?.version){if(!e)throw new Error("No version loaded");this.sourceBlockStatesModels??(this.sourceBlockStatesModels=(await import("mc-assets/dist/blockStatesModels.json")).default)}resetResources(){this.currentResources=new ge}async updateAssetsData(e,i=!1){if(!this.currentConfig)throw new Error("No config loaded");this._promiseAssetsReadyResolvers=Promise.withResolvers();let r=new AbortController;if(await this.loadSourceData(this.currentConfig.version),r.signal.aborted)return;let s=this.currentResources??new ge;s.version=this.currentConfig.version,s.texturesVersion=this.currentConfig.texturesVersion??s.version,s.mcData=R2(s.version),s.blockstatesModels={blockstates:{},models:{}},s.blockstatesModels.blockstates.latest={...this.sourceBlockStatesModels.blockstates.latest,...s.customBlockStates},s.blockstatesModels.models.latest={...this.sourceBlockStatesModels.models.latest,...s.customModels},await Promise.all([this.recreateBlockAtlas(s),this.recreateItemsAtlas(s)]),!r.signal.aborted&&(s.version&&s.blockstatesModels&&this.itemsAtlasParser&&this.blocksAtlasParser&&(s.itemsRenderer=new F6(s.version,s.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser)),!r.signal.aborted&&(this.currentResources=s,s.allReady=!0,i||this.emit("assetsTexturesUpdated"),this.currentConfig.noInventoryGui?this._promiseAssetsReadyResolvers.resolve():(this.emit("assetsInventoryStarted"),this.generateGuiTextures().then(()=>{r.signal.aborted||(i||this.emit("assetsInventoryReady"),this._promiseAssetsReadyResolvers.resolve())}))))}async recreateBlockAtlas(e=this.currentResources){let i={},r=new Date;(r.getMonth()===11&&r.getDate()>=24||r.getMonth()===0&&r.getDate()<=6)&&Object.assign(i,z6);let s=new J5(this.sourceBlocksAtlases,P6,I6),o=Object.keys(e.customTextures.blocks?.textures??{}),{atlas:a,canvas:v}=await s.makeNewAtlas(e.texturesVersion,l=>{if(this.currentConfig.includeOnlyBlocks&&!this.currentConfig.includeOnlyBlocks.includes(l))return!1;let c=e.customTextures.blocks?.textures[l];return i[l]??c},void 0,void 0,o,{needHorizontalIndexes:!!this.currentConfig.includeOnlyBlocks});this.blocksAtlasParser=new J5({latest:a},v.toDataURL()),e.blocksAtlasImage=await createImageBitmap(v),e.blocksAtlasJson=this.blocksAtlasParser.atlas.latest,e.worldBlockProvider=D6(e.blockstatesModels,this.blocksAtlasParser.atlas,U6)}async recreateItemsAtlas(e=this.currentResources){let i=new J5(this.sourceItemsAtlases,H6,O6),r=Object.keys(e.customTextures.items?.textures??{}),{atlas:s,canvas:o}=await i.makeNewAtlas(e.texturesVersion,a=>{let v=e.customTextures.items?.textures[a];if(v)return v},e.customTextures.items?.tileSize,void 0,r);this.itemsAtlasParser=new J5({latest:s},o.toDataURL()),e.itemsAtlasImage=await createImageBitmap(o)}async generateGuiTextures(){}async downloadDebugAtlas(e=!1){if(!this.currentResources)throw new Error("No resources loaded");let s=await(e?this.itemsAtlasParser:this.blocksAtlasParser).createDebugImage(!0),o=document.createElement("a");o.href=s,o.download=`atlas-debug-${e?"items":"blocks"}.png`,o.click()}destroy(){this.abortController.abort(),this.currentResources=void 0,this.abortController=new AbortController}};u(Tt,"restorerName","ResourcesManager");var lt=Tt;x();R();M();k();var nt=class extends Error{constructor(e,i){super(e);u(this,"failure");this.name="MesherWorkerPreloadError",this.failure=i}};function G6(n){return!n||typeof n!="object"?!1:n.type==="mc-web-pong"?!0:Array.isArray(n)?n.some(t=>t&&typeof t=="object"&&t.type==="mc-web-pong"):!1}var N6=45e3,W6=1e4;async function k2(n){if(D.env.SINGLE_FILE_BUILD)return;let t=n?.fetchTimeoutMs??N6,e=n?.pingTimeoutMs??W6,i=n?.script??"mesher.js",r=new URL(i,document.baseURI).href,s;try{let d=new AbortController,f=window.setTimeout(()=>d.abort(),t);try{s=await fetch(r,{credentials:"same-origin",cache:"force-cache",signal:d.signal})}finally{clearTimeout(f)}}catch(d){let f=d;throw f?.name==="AbortError"?new nt(`Mesher script fetch timed out after ${t}ms (${r}).`,{phase:"fetch",code:"timeout"}):new nt(`Mesher script fetch failed (network): ${f?.message??d}. URL: ${r}`,{phase:"fetch",code:"network",detail:String(f?.message??d)})}if(!s.ok)throw new nt(`Mesher script HTTP ${s.status} ${s.statusText}: ${r}`,{phase:"fetch",code:"bad-status",status:s.status});let o=s.headers.get("content-type")??"",a=await s.arrayBuffer();if(a.byteLength===0)throw new nt(`Mesher script response was empty: ${r}`,{phase:"fetch",code:"invalid-body",hint:"empty"});let v=Math.min(1024,a.byteLength),l=new TextDecoder().decode(a.slice(0,v)).trimStart();if(l.startsWith("<!DOCTYPE")||l.startsWith("<html")||l.startsWith("<HTML"))throw new nt(`Mesher URL returned HTML (wrong path, redirect, or SPA fallback), not JavaScript: ${r}`,{phase:"fetch",code:"invalid-body",hint:"html"});o.length>0&&/javascript|ecmascript/i.test(o);let c;try{c=new Worker(r)}catch(d){let f=d instanceof Error?d.message:String(d);throw new nt(`Could not construct Worker for mesher (${r}): ${f}`,{phase:"worker",code:"construct-failed",message:f})}await new Promise((d,f)=>{let m=!1,g=window.setTimeout(()=>{m||(m=!0,b(),f(new nt(`Mesher worker did not reply with mc-web-pong within ${e}ms (wrong script, SW stale cache, worker blocked, or COEP/CORP). URL: ${r}`,{phase:"ping",code:"timeout"})))},e),b=()=>{clearTimeout(g);let C=c;c=void 0,C&&(C.removeEventListener("message",w),C.removeEventListener("error",T),C.removeEventListener("messageerror",S),C.terminate())},A=()=>{m||(m=!0,b(),d())},_=C=>{m||(m=!0,b(),f(C))};function w(C){G6(C.data)&&A()}function T(C){_(new nt(`Mesher worker script failed to load or threw during startup: ${C.message||"unknown"} @ ${r}`,{phase:"worker",code:"script-error",message:C.message}))}function S(){_(new nt(`Mesher worker message channel error (structured clone / deserialization). URL: ${r}`,{phase:"ping",code:"messageerror"}))}c.addEventListener("message",w),c.addEventListener("error",T),c.addEventListener("messageerror",S);try{c.postMessage({type:"mc-web-ping",t:performance.now(),workerIndex:0})}catch(C){let H=C instanceof Error?C.message:String(C);_(new nt(`Failed to post mc-web-ping to mesher worker: ${H}`,{phase:"ping",code:"post-failed",detail:H}))}})}var T2=class{constructor(t={},e=new lt){this.resourcesManager=e;u(this,"waitBackendLoadPromises",[]);u(this,"onWorldStart");u(this,"onBeforeWorldStart");u(this,"worldView");u(this,"config");u(this,"menuBackgroundOptions");u(this,"inWorldRenderingConfig");u(this,"backend");u(this,"backendLoader");u(this,"currentState");u(this,"currentDisplay",null);u(this,"playerState",{reactive:ui()});u(this,"rendererState");u(this,"nonReactiveState");u(this,"worldReady");u(this,"resolveWorldReady");u(this,"lastCamUpdate",0);u(this,"getRendererOptions");this.config={..._2,...t.config},this.menuBackgroundOptions={...t.config?.menuBackground,...t.menuBackground},this.inWorldRenderingConfig=M2({...Ze,...t.rendererConfig});let i=Qt();this.rendererState=i.reactive,this.nonReactiveState=i.nonReactive,this.initWorldReadyPromise()}initWorldReadyPromise(){let{promise:t,resolve:e}=Promise.withResolvers();this.worldReady=t,this.resolveWorldReady=e}preloadWorkers(){let t=this.inWorldRenderingConfig.wasmMesher?"mesherWasm.js":"mesher.js";return k2({script:t})}bindRendererOptions(t){this.getRendererOptions=t}async loadBackend(t){this.backend&&this.disconnectBackend(),await Promise.all(this.waitBackendLoadPromises),this.waitBackendLoadPromises=[],this.backendLoader=t;let e={config:this.config,getRendererOptions:this.getRendererOptions,callbacks:{displayCriticalError:r=>{},setRendererSpecificSettings:(r,s)=>{},fireCustomEvent:(r,...s)=>{}},rendererSpecificSettings:{}},i=t(e);if(this.backend=await Promise.resolve(i),this.currentState)if(this.currentState.method==="startMenuBackground")this.startMenuBackground(...this.currentState.args);else{let{method:r,args:s}=this.currentState;this.backend[r](...s)}}async startWorld(t,e,i=this.playerState.reactive,r){if(this.currentDisplay==="world")throw new Error("World already started");this.currentDisplay="world";let s=r??new V6(0,64,0);this.worldView=new Zt(t,e,s),this.worldView.isPlayground=this.inWorldRenderingConfig.isPlayground;let o={version:this.resourcesManager?.currentConfig?.version??"1.20.4",worldView:this.worldView,inWorldRenderingConfig:this.inWorldRenderingConfig,playerStateReactive:i,rendererState:this.rendererState,nonReactiveState:this.nonReactiveState,resourcesManager:this.resourcesManager};this.onBeforeWorldStart?.();let a;if(this.backend){let v=this.backend.startWorld(o);v&&typeof v.then=="function"&&(a=v)}return this.currentState={method:"startWorld",args:[o]},await a,this.resolveWorldReady(),this.onWorldStart?.(),!!a}startMenuBackground(t){if(this.currentDisplay==="menu")return;let e={...this.menuBackgroundOptions,...t,resourcesManager:t?.resourcesManager??this.resourcesManager};this.backend&&(this.currentDisplay="menu",this.backend.startMenuBackground(e)),this.currentState={method:"startMenuBackground",args:[e]}}resetBackend(t=!1){this.disconnectBackend(t),this.backendLoader&&this.loadBackend(this.backendLoader)}disconnectBackend(t=!1){t&&(this.currentState=void 0,this.currentDisplay=null,this.worldView=void 0),this.backend&&(this.backend.disconnect(),this.backend=void 0),this.currentDisplay=null,this.initWorldReadyPromise(),this.rendererState=M2(Qt().reactive),this.nonReactiveState=Qt().nonReactive}updateCamera(t,e,i){this.backend?.updateCamera(t,e,i)}setRendering(t){this.backend?.setRendering(t)}async startWithBot(t,e){await this.startWorld(t.world,e),this.worldView&&typeof this.worldView.listenToBot=="function"&&this.worldView.listenToBot(t)}destroyAll(){this.disconnectBackend(!0),this.resourcesManager&&typeof this.resourcesManager.destroy=="function"&&this.resourcesManager.destroy()}get utils(){let t=this.backend;return{async waitingForChunks(){if(!t?.worldState?.allChunksLoaded)return new Promise(e=>{let i=setInterval(()=>{t?.worldState?.allChunksLoaded&&(clearInterval(i),e())},100)})}}}destroy(){this.disconnectBackend(!0)}};x();R();M();k();import{subscribe as $6}from"valtio/vanilla";x();R();M();k();var dt={mode:"futuristic",minecraftTextures:!0,futuristicScene:"light",futuristicCamera:"dive",futuristicBlockGroup:"stainedGlass",futuristicCameraSpeedPercent:80,futuristicBlockSpeedPercent:40},bt=n=>n/100,t5={camera:bt(dt.futuristicCameraSpeedPercent),block:bt(dt.futuristicBlockSpeedPercent)};x();R();M();k();x();R();M();k();x();R();M();k();x();R();M();k();function fi(n,t,e,i,r){let s=n.getImageData(t,e,i,r);for(let o=0;o<i;o++)for(let a=0;a<r;a++){let v=(o+a*i)*4;if(s.data[v+3]!==255)return!0}return!1}function q5(n){return n/64}function S2(n,t,e){if(e){if(fi(n,0,0,t,t))return}else if(fi(n,0,0,t,t/2))return;let i=q5(t),r=(s,o,a,v)=>n.clearRect(s*i,o*i,a*i,v*i);r(40,0,8,8),r(48,0,8,8),r(32,8,8,8),r(40,8,8,8),r(48,8,8,8),r(56,8,8,8),e&&(r(4,32,4,4),r(8,32,4,4),r(0,36,4,12),r(4,36,4,12),r(8,36,4,12),r(12,36,4,12),r(20,32,8,4),r(28,32,8,4),r(16,36,4,12),r(20,36,8,12),r(28,36,4,12),r(32,36,8,12),r(44,32,4,4),r(48,32,4,4),r(40,36,4,12),r(44,36,4,12),r(48,36,4,12),r(52,36,12,12),r(4,48,4,4),r(8,48,4,4),r(0,52,4,12),r(4,52,4,12),r(8,52,4,12),r(12,52,4,12),r(52,48,4,4),r(56,48,4,4),r(48,52,4,12),r(52,52,4,12),r(56,52,4,12),r(60,52,4,12))}function j6(n,t){n.save(),n.scale(-1,1);let e=q5(t),i=(r,s,o,a,v,l)=>n.drawImage(n.canvas,r*e,s*e,o*e,a*e,-v*e,l*e,-o*e,a*e);i(4,16,4,4,20,48),i(8,16,4,4,24,48),i(0,20,4,12,24,52),i(4,20,4,12,20,52),i(8,20,4,12,16,52),i(12,20,4,12,28,52),i(44,16,4,4,36,48),i(48,16,4,4,40,48),i(40,20,4,12,40,52),i(44,20,4,12,36,52),i(48,20,4,12,32,52),i(52,20,4,12,44,52),n.restore()}function hi(n,t){let e=!1;if(t.width!==t.height)if(t.width===2*t.height)e=!0;else throw new Error(`Bad skin size: ${t.width}x${t.height}`);let i=n.getContext("2d",{willReadFrequently:!0});if(e){let r=t.width;n.width=r,n.height=r,i.clearRect(0,0,r,r),i.drawImage(t,0,0,r,r/2),j6(i,r),S2(i,n.width,!1)}else n.width=t.width,n.height=t.height,i.clearRect(0,0,t.width,t.height),i.drawImage(t,0,0,n.width,n.height),S2(i,n.width,!0)}function Y6(n){if(n.width===2*n.height)return n.width/64;if(n.width*17===n.height*22)return n.width/22;if(n.width*11===n.height*23)return n.width/46;throw new Error(`Bad cape size: ${n.width}x${n.height}`)}function mi(n,t){let e=Y6(t);n.width=64*e,n.height=32*e;let i=n.getContext("2d",{willReadFrequently:!0});i.clearRect(0,0,n.width,n.height),i.drawImage(t,0,0,t.width,t.height)}function Q6(n,t,e,i,r){let s=n.getImageData(t,e,i,r);for(let o=0;o<i;o++)for(let a=0;a<r;a++){let v=(o+a*i)*4;if(!(s.data[v+0]===0&&s.data[v+1]===0&&s.data[v+2]===0&&s.data[v+3]===255))return!1}return!0}function K6(n,t,e,i,r){let s=n.getImageData(t,e,i,r);for(let o=0;o<i;o++)for(let a=0;a<r;a++){let v=(o+a*i)*4;if(!(s.data[v+0]===255&&s.data[v+1]===255&&s.data[v+2]===255&&s.data[v+3]===255))return!1}return!0}function pi(n){let t=q5(n.width),e=n.getContext("2d",{willReadFrequently:!0}),i=(a,v,l,c)=>fi(e,a*t,v*t,l*t,c*t),r=(a,v,l,c)=>Q6(e,a*t,v*t,l*t,c*t),s=(a,v,l,c)=>K6(e,a*t,v*t,l*t,c*t);return i(50,16,2,4)||i(54,20,2,12)||i(42,48,2,4)||i(46,52,2,12)||r(50,16,2,4)&&r(54,20,2,12)&&r(42,48,2,4)&&r(46,52,2,12)||s(50,16,2,4)&&s(54,20,2,12)&&s(42,48,2,4)&&s(46,52,2,12)?"slim":"default"}function gi(n,t){if(t.width!==t.height&&t.width!==2*t.height)throw new Error(`Bad skin size: ${t.width}x${t.height}`);let e=q5(t.width),i=14*e,r=7*e;n.width=i,n.height=r;let s=n.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,i,r),s.drawImage(t,24*e,0,i,r,0,0,i,r)}x();R();M();k();import Z6 from"mc-assets/dist/other-textures/latest/entity/player/wide/steve.png";x();R();M();k();import*as yt from"three";x();R();M();k();var J6=()=>{if(typeof OffscreenCanvas>"u")return!1;try{let n=new OffscreenCanvas(1,1);return(n.getContext("webgl2")||n.getContext("webgl"))!==null}catch{return!1}},q6=J6(),W0=(n,t)=>{if(q6)return new OffscreenCanvas(n,t);let e=document.createElement("canvas");return e.width=n,e.height=t,e};async function Z5(n){let e=await(await fetch(n)).blob();return createImageBitmap(e)}var x0=(n,t=!1)=>{n instanceof yt.Mesh&&(n.geometry?.dispose?.(),n.material?.dispose?.()),n.children&&n.children.forEach(e=>x0(e,t)),t&&n instanceof yt.Mesh&&n.material?.map?.dispose?.()},bi={},C2={},X5=n=>{let t=new yt.Texture,e=Z5(n).then(i=>{let r=new OffscreenCanvas(i.width,i.height);return r.getContext("2d").drawImage(i,0,0),t.source.data=r,t.needsUpdate=!0,t});return{texture:t,promise:e}},St=async n=>X5(n).texture,e5=n=>{let t=W0(n.width,n.height);t.getContext("2d").drawImage(n,0,0);let i=new yt.Texture(t);return i.magFilter=yt.NearestFilter,i.minFilter=yt.NearestFilter,i};async function $5(n,t,e){if(!bi[n]){let{promise:r,resolve:s}=Promise.withResolvers(),o=X5(n);bi[n]=o.texture,o.promise.then(s),C2[n]=r}t(bi[n]),C2[n].then(()=>{e?.()})}var ut=Z6,_u=St(ut),B2={apiEnabled:!0},t1=n=>{Object.assign(B2,n)};async function Ct(n,t){if(!B2.apiEnabled||t==="cape")return;let e=`https://playerdb.co/api/player/minecraft/${n}`,i=await fetch(e);return i.ok?(await i.json()).data.player.skin_texture:void 0}async function Xt(n){n.startsWith("data:")||(n=await X6(n.replace("http://","https://")));let t=await Z5(n),e=W0(64,64);return hi(e,t),{canvas:e,image:t}}var X6=async n=>{let e=await(await fetch(n,{})).arrayBuffer();return`data:image/png;base64,${F.from(e).toString("base64")}`};function Su(n){return{mode:n.menuBackgroundMode,useMinecraftTextures:n.menuBackgroundMinecraftTextures,futuristicScene:n.menuBackgroundFuturisticScene,futuristicCamera:n.menuBackgroundFuturisticCamera,futuristicBlockGroup:n.menuBackgroundFuturisticBlockGroup,futuristicCameraSpeed:bt(n.menuBackgroundFuturisticCameraSpeed),futuristicBlockSpeed:bt(n.menuBackgroundFuturisticBlockSpeed)}}function ta(n,t){let e=n.futuristic;e&&(e.setScene?.(t.menuBackgroundFuturisticScene),e.setCamera?.(t.menuBackgroundFuturisticCamera),e.setBlockGroup?.(t.menuBackgroundFuturisticBlockGroup),e.setCameraSpeed?.(bt(t.menuBackgroundFuturisticCameraSpeed)),e.setBlockSpeed?.(bt(t.menuBackgroundFuturisticBlockSpeed)))}function ea(n){return n.rendererMesher!=="legacy-js"}function ia(n,t,e){let i=n.inWorldRenderingConfig,r=t.rendererMeshersCountOverride,s=o=>{i.mesherWorkers=r??o};switch(t.rendererWorldPerformance){case"low-energy":s(1),i.dedicatedChangeWorker=!1;break;case"normal":s(2),i.dedicatedChangeWorker=!e;break;case"maximum":s(Math.max(3,Math.min(navigator.hardwareConcurrency??0,8))),i.dedicatedChangeWorker=!e;break}}function ra(n,t,e){let i=t.backgroundRendering,r=t.frameLimit;e?n.config.fpsLimit=r||void 0:i==="5fps"?n.config.fpsLimit=5:i==="20fps"?n.config.fpsLimit=20:n.config.fpsLimit=void 0}function na(n,t,e){let{renderDebug:i}=t;i==="none"||e.isCypress?n.config.statsVisible=0:i==="basic"?n.config.statsVisible=1:i==="advanced"&&(n.config.statsVisible=2)}function sa(n,t,e={}){let i=n.inWorldRenderingConfig,r=ea(t);i.showChunkBorders=t.showChunkBorders,i.futuristicReveal=t.rendererFuturisticReveal,ia(n,t,r),i.renderEntities=t.renderEntities,na(n,t,e),ra(n,t,e.windowFocused!==!1),i.vrSupport=t.vrSupport,i.vrPageGameRendering=t.vrPageGameRendering,i.enableDebugOverlay=t.rendererPerfDebugOverlay,i.clipWorldBelowY=t.clipWorldBelowY,i.extraBlockRenderers=!t.disableBlockEntityTextures,i.fetchPlayerSkins=t.loadPlayerSkins,i.highlightBlockColor=t.highlightBlockColor,i.wasmMesher=r,i.disableMesherConversionCache=!!e.isSafari,t1({apiEnabled:t.loadPlayerSkins}),i.smoothLighting=t.smoothLighting,i.shadingTheme=t.vanillaLook?"vanilla":"high-contrast",i.starfield=t.starfieldRendering,i.defaultSkybox=t.defaultSkybox}function Cu(n,t,e){t.keepChunksDistance=e.keepChunksDistance;let i=n.inWorldRenderingConfig;i.renderEars=e.renderEars,i.showHand=e.showHand,i.viewBobbing=e.viewBobbing,i.dayCycle=e.dayCycleAndLighting}function Bu(n,t,e={}){n.bindRendererOptions(()=>t);let i=e.getWindowFocused?.()??!0,r=()=>{let s=t;if(sa(n,s,{isSafari:e.isSafari,isCypress:e.isCypress,windowFocused:i}),n.currentDisplay==="menu"){let o=n.backend?.getMenuBackground?.();o&&ta(o,s)}};return r(),e.onRegisterFocusHandlers?.({onFocus:()=>{i=!0,r()},onBlur:()=>{i=!1,r()}}),$6(t,r)}function Pu(n,t,e){n.inWorldRenderingConfig.enableLighting=!e||t}x();R();M();k();import{proxy as oa}from"valtio";var P2=()=>oa({playerSkin:void 0,inWater:!1,waterBreathing:!1,backgroundColor:[0,0,0],ambientLight:0,directionalLight:0,eyeHeight:0,gameMode:void 0,lookingAtBlock:void 0,diggingBlock:void 0,movementState:"NOT_MOVING",onGround:!0,sneaking:!1,flying:!1,sprinting:!1,walkDist:0,prevWalkDist:0,bob:0,prevBob:0,itemUsageTicks:0,username:"",onlineMode:!1,cardinalLight:"default",lightingDisabled:!1,shouldHideHand:!1,heldItemMain:void 0,heldItemOff:void 0,perspective:"first_person",onFire:!1,cameraSpectatingEntity:void 0,team:void 0}),aa=n=>({isSpectator(){return n.gameMode==="spectator"},isSpectatingEntity(){return n.cameraSpectatingEntity!==void 0&&n.gameMode==="spectator"},isThirdPerson(){return this.isSpectatingEntity()?!1:n.perspective==="third_person_back"||n.perspective==="third_person_front"}}),va=()=>({reactive:P2()}),I2=(n,t,e)=>({...t,"minecraft:date":new Date});x();R();M();k();x();R();M();k();import*as D5 from"three";import{Vec3 as S9}from"vec3";x();R();M();k();import{proxy as la,getVersion as O2,subscribe as z2}from"valtio";import{Vec3 as D2}from"vec3";function F2(n,t){let e=t??globalThis;return e.addEventListener("message",i=>{let{type:r,args:s,msgId:o}=i.data;if(n[r]){let a=n[r](...s);a instanceof Promise&&a.then(v=>{e.postMessage({type:"result",msgId:o,args:[v]})})}}),null}var L2=(n,t=!0)=>{let e=0;return new Proxy({},{get(i,r){return r==="transfer"?(...s)=>new Proxy({},{get(o,a){return(...v)=>{n.postMessage({type:a,args:v},s)}}}):(...s)=>{let o=e++,a=t?s.filter(v=>v instanceof ArrayBuffer||v instanceof MessagePort||typeof ImageBitmap<"u"&&v instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&v instanceof OffscreenCanvas||typeof ImageData<"u"&&v instanceof ImageData):[];return n.postMessage({type:r,msgId:o,args:s},a),{then(v){let l=({data:c})=>{c.type==="result"&&c.msgId===o&&(v(c.args[0]),n.removeEventListener("message",l))};n.addEventListener("message",l)}}}}})};var U2=(n,t,e,i)=>{try{e.postMessage({type:"sync",syncId:n,value:e1(t)}),i5.toWorker++,globalThis.debugSyncMessagesOutgoing??(globalThis.debugSyncMessagesOutgoing=0),globalThis.debugSyncMessagesOutgoing++}catch{r5(t)}},i5={toWorker:0,fromWorker:0};typeof window<"u"&&setInterval(()=>{globalThis.debugWorkerSyncStats={...i5},i5.toWorker=0,i5.fromWorker=0},1e3);var ca=()=>Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15),H2=(n,t,e,i,r)=>{if(!n.__syncToWorker&&!n.__syncFromWorker&&!i)return;let s=ca();if(n.__syncId=s,n.__syncToWorker||i){let o=()=>{U2(s,t,e,`toWorker:${r}`)};i&&z2(t,o);let a=n.__syncToWorkerInterval??0;a>0&&setInterval(o,a)}t.__syncFromWorker&&e.addEventListener("message",o=>{o.data.type==="sync"&&o.data.syncId===s&&(i5.fromWorker++,Object.assign(t,o.data.value))})},e1=n=>{if(O2(n)===void 0)return n;if(Array.isArray(n))return n.map(e1);if(typeof n=="object"&&n!==null){let t={};for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=e1(n[e]));return t}return n},i1=(n,t,e=!0,i=!0,r=!1)=>{var a,v;let s=n,o={};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){if(e&&typeof n[l]=="function")continue;if(n[l]instanceof Date||n[l]instanceof RegExp||n[l]instanceof Map||n[l]instanceof WeakMap||n[l]instanceof WeakSet,n[l]instanceof Set){o[l]=[...n[l]],o[l].__restorer="Set";continue}if(n[l]instanceof D2){o[l]={x:n[l].x,y:n[l].y,z:n[l].z},o[l].__restorer="Vec3";continue}if(o[l]=n[l],typeof n[l]=="object"&&n[l]!==null){if(n[l].prepareForTransfer){o[l]=n[l].prepareForTransfer(t);continue}let c=O2(n[l])!==void 0;o[l]=c?e1(n[l]):n[l];let d=n[l].__syncToWorker!==!1&&!r&&c&&!n[l].__syncFromWorker;if((a=o[l]).__syncToWorker??(a.__syncToWorker=d),c&&((v=o[l]).__valtio??(v.__valtio=!0)),o[l].__syncToWorker&&c){H2(o[l],s[l],t,!0,l);continue}H2(o[l],s[l],t,!1,l),o[l]=i1(o[l],t,e,!1,c)}}return o},r5=(n,t=[])=>{for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e)){if(!n[e])continue;typeof n[e]=="object"&&n[e]!==null&&r5(n[e],[...t,e]);try{structuredClone(n[e])}catch{}}},da=(n,t,e)=>{if(!n.__syncId)return;let i=n.__syncId;if(n.__syncToWorker&&t.addEventListener("message",r=>{r.data.type==="sync"&&r.data.syncId===i&&Object.assign(n,r.data.value)}),n.__syncFromWorker){let r=()=>{U2(i,n,t,`fromWorker:${e}`)};n.__valtio&&z2(n,r);let s=n.__syncFromWorkerInterval??0;s>0&&setInterval(r,s)}},ua=[{restorerName:"Set",restoreTransferred(n,t){return new Set(n)}},{restorerName:"Vec3",restoreTransferred(n,t){return new D2(n.x,n.y,n.z)}}];var r1=(n,t,e,i=!0)=>{let r=[...ua,...t];for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){if(!n[s])continue;if(typeof n[s]=="object"&&n[s]!==null&&r1(n[s],r,e,i),n[s].__restorer){let o=r.find(a=>a.restorerName?a.restorerName===n[s].__restorer:a.name===n[s].__restorer);if(o)n[s]=o.restoreTransferred(n[s],e);else{let a=new Error(`Restorer ${n[s].__restorer} not found`);if(typeof i=="function")i(a);else if(i)throw a}}n[s].__valtio&&(n[s]=la(n[s])),da(n[s],e,s)}return n};x();R();M();k();var n1=class{constructor(t){this.nonReactiveState=t;u(this,"events",[]);u(this,"frozenEvents",[]);u(this,"lastSecondEvents",[]);u(this,"currentFrameStartTime",null);u(this,"lastInteractionTime",0);u(this,"lastSecondUpdateTime",0);u(this,"timeWindowMs",5e3);u(this,"lastSecondWindowMs",1e3);u(this,"maxEvents",500);u(this,"lastSecondUpdateInterval",1e3);this.nonReactiveState.renderer||(this.nonReactiveState.renderer={timeline:{live:[],frozen:[],lastSecond:[]}}),this.nonReactiveState.renderer.timeline||(this.nonReactiveState.renderer.timeline={live:[],frozen:[],lastSecond:[]}),setInterval(()=>{this.updateLastSecondTimeline()},this.lastSecondUpdateInterval)}markFrameStart(){this.currentFrameStartTime=performance.now(),this.addEvent({type:"frameStart",timestamp:this.currentFrameStartTime})}markFrameEnd(){if(!this.currentFrameStartTime)return;let t=performance.now(),e=t-this.currentFrameStartTime;this.addEvent({type:"frameEnd",timestamp:t,duration:e}),this.currentFrameStartTime=null}markCameraUpdate(t){if(!t)return;let e=performance.now();this.lastInteractionTime=e,this.addEvent({type:"cameraUpdate",timestamp:e}),this.frozenEvents=[...this.events],this.trimEvents(this.frozenEvents),this.syncFrozenEvents()}markFrameDisplay(){this.addEvent({type:"frameDisplay",timestamp:performance.now()})}addEvent(t){this.events.push(t),this.lastSecondEvents.push(t),this.trimEvents(this.events),this.trimLastSecondEvents(),this.syncLiveEvents()}trimEvents(t){let i=performance.now()-this.timeWindowMs;for(;t.length>0&&t[0].timestamp<i;)t.shift();t.length>this.maxEvents&&t.splice(0,t.length-this.maxEvents)}trimLastSecondEvents(){let e=performance.now()-this.lastSecondWindowMs;for(;this.lastSecondEvents.length>0&&this.lastSecondEvents[0].timestamp<e;)this.lastSecondEvents.shift()}updateLastSecondTimeline(){let t=performance.now();t-this.lastSecondUpdateTime<this.lastSecondUpdateInterval||(this.lastSecondUpdateTime=t,this.trimLastSecondEvents(),this.syncLastSecondEvents())}syncLiveEvents(){this.nonReactiveState.renderer.timeline.live=[...this.events]}syncFrozenEvents(){this.nonReactiveState.renderer.timeline.frozen=[...this.frozenEvents]}syncLastSecondEvents(){this.nonReactiveState.renderer.timeline.lastSecond=[...this.lastSecondEvents]}clear(){this.events=[],this.frozenEvents=[],this.lastSecondEvents=[],this.syncLiveEvents(),this.syncFrozenEvents(),this.syncLastSecondEvents()}};x();R();M();k();import*as Q from"three";import{Vec3 as Ft}from"vec3";import lv from"prismarine-chat";x();R();M();k();var I0=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return this.None(n)},Out:function(n){return this.None(n)},InOut:function(n){return this.None(n)}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var t=1.70158;return n===1?1:n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return n===0?0:--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}}),Bounce:Object.freeze({In:function(n){return 1-I0.Bounce.Out(1-n)},Out:function(n){return n<.36363636363636365?7.5625*n*n:n<.7272727272727273?7.5625*(n-=.5454545454545454)*n+.75:n<.9090909090909091?7.5625*(n-=.8181818181818182)*n+.9375:7.5625*(n-=.9545454545454546)*n+.984375},InOut:function(n){return n<.5?I0.Bounce.In(n*2)*.5:I0.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return Math.pow(t,n)},Out:function(t){return 1-Math.pow(1-t,n)},InOut:function(t){return t<.5?Math.pow(t*2,n)/2:(1-Math.pow(2-t*2,n))/2+.5}}}}),n5=function(){return performance.now()},ye=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},n.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},n.prototype.update=function(t,e){t===void 0&&(t=n5()),e===void 0&&(e=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var s=this._tweens[i[r]],o=!e;s&&s.update(t,o)===!1&&!e&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),be={Linear:function(n,t){var e=n.length-1,i=e*t,r=Math.floor(i),s=be.Utils.Linear;return t<0?s(n[0],n[1],i):t>1?s(n[e],n[e-1],e-i):s(n[r],n[r+1>e?e:r+1],i-r)},Bezier:function(n,t){for(var e=0,i=n.length-1,r=Math.pow,s=be.Utils.Bernstein,o=0;o<=i;o++)e+=r(1-t,i-o)*r(t,o)*n[o]*s(i,o);return e},CatmullRom:function(n,t){var e=n.length-1,i=e*t,r=Math.floor(i),s=be.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(r=Math.floor(i=e*(1+t))),s(n[(r-1+e)%e],n[r],n[(r+1)%e],n[(r+2)%e],i-r)):t<0?n[0]-(s(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(s(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):s(n[r?r-1:0],n[r],n[e<r+1?e:r+1],n[e<r+2?e:r+2],i-r)},Utils:{Linear:function(n,t,e){return(t-n)*e+n},Bernstein:function(n,t){var e=be.Utils.Factorial;return e(n)/e(t)/e(n-t)},Factorial:function(){var n=[1];return function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}}(),CatmullRom:function(n,t,e,i,r){var s=(e-n)*.5,o=(i-t)*.5,a=r*r,v=r*a;return(2*t-2*e+s+o)*v+(-3*t+3*e-2*s-o)*a+s*r+t}}},G2=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),yi=new ye,O0=function(){function n(t,e){e===void 0&&(e=yi),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=I0.Linear.None,this._interpolationFunction=be.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=G2.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e,this},n.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},n.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},n.prototype.start=function(t,e){if(t===void 0&&(t=n5()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var s in this._valuesEnd)r[s]=this._valuesEnd[s];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},n.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},n.prototype._setupProperties=function(t,e,i,r,s){for(var o in i){var a=t[o],v=Array.isArray(a),l=v?"array":typeof a,c=!v&&Array.isArray(i[o]);if(!(l==="undefined"||l==="function")){if(c){var d=i[o];if(d.length===0)continue;for(var f=[a],m=0,g=d.length;m<g;m+=1){var b=this._handleRelativeValue(a,d[m]);if(isNaN(b)){c=!1;break}f.push(b)}c&&(i[o]=f)}if((l==="object"||v)&&a&&!c){e[o]=v?[]:{};var A=a;for(var _ in A)e[o][_]=A[_];r[o]=v?[]:{};var d=i[o];if(!this._isDynamic){var w={};for(var _ in d)w[_]=d[_];i[o]=d=w}this._setupProperties(A,e[o],d,r[o],s)}else(typeof e[o]>"u"||s)&&(e[o]=a),v||(e[o]*=1),c?r[o]=i[o].slice().reverse():r[o]=e[o]||0}}},n.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},n.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},n.prototype.pause=function(t){return t===void 0&&(t=n5()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},n.prototype.resume=function(t){return t===void 0&&(t=n5()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},n.prototype.group=function(t){return t===void 0&&(t=yi),this._group=t,this},n.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},n.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},n.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},n.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},n.prototype.easing=function(t){return t===void 0&&(t=I0.Linear.None),this._easingFunction=t,this},n.prototype.interpolation=function(t){return t===void 0&&(t=be.Linear),this._interpolationFunction=t,this},n.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},n.prototype.onStart=function(t){return this._onStartCallback=t,this},n.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},n.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},n.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},n.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},n.prototype.onStop=function(t){return this._onStopCallback=t,this},n.prototype.update=function(t,e){if(t===void 0&&(t=n5()),e===void 0&&(e=!0),this._isPaused)return!0;var i,r,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>s)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),r=(t-this._startTime)/this._duration,r=this._duration===0||r>1?1:r;var o=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,v=this._chainedTweens.length;a<v;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(t,e,i,r){for(var s in i)if(e[s]!==void 0){var o=e[s]||0,a=i[s],v=Array.isArray(t[s]),l=Array.isArray(a),c=!v&&l;c?t[s]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[s],o,a,r):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[s]=o+(a-o)*r))}},n.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},n.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},n}();var mf=G2.nextId,ft=yi,pf=ft.getAll.bind(ft),gf=ft.removeAll.bind(ft),bf=ft.add.bind(ft),yf=ft.remove.bind(ft),N2=ft.update.bind(ft);x();R();M();k();var fa=(n,t)=>{try{return JSON.parse(n)}catch{return null}},ha={black:"#000000",dark_blue:"#0000AA",dark_green:"#00AA00",dark_aqua:"#00AAAA",dark_red:"#AA0000",dark_purple:"#AA00AA",gold:"#FFAA00",gray:"#AAAAAA",dark_gray:"#555555",blue:"#5555FF",green:"#55FF55",aqua:"#55FFFF",red:"#FF5555",light_purple:"#FF55FF",yellow:"#FFFF55",white:"#FFFFFF"},s1=(n,t,e,i=s=>{},r=(s,o)=>W0(s,o))=>{let a=[16,9],v=a[0]-a[1],l=v/16,c="front_text"in n?n.front_text.messages:[n.Text1,n.Text2,n.Text3,n.Text4];if(!c.some(g=>g!=="null"))return;let d=r(16*40,v*40),f=d.getContext("2d");i(f);let m=("front_text"in n?n.front_text.color:n.Color)||"black";for(let[g,b]of c.slice(0,4).entries())b!=="null"&&_i(b,e,d,64,m,64*(g+1)+(t?0:-8));return d},_i=(n,t,e,i,r,s=0)=>{let o=!1,a=typeof n=="string"&&(n?.startsWith("{")||n?.startsWith('"'))?fa(n??'""',"sign text"):n;if(!a||typeof a!="object"&&typeof a!="string")return;let v=e.getContext("2d");if(!v)throw new Error("Could not get 2d context");v.imageSmoothingEnabled=!1,v.font=`${i}px mojangles`;let l=new t(a),c=[],d=!1,f="",m=s,g=[],b=(T,S)=>{T.text!==null&&T.text!==void 0&&T.text;let C=T.text===null||T.text===void 0?void 0:String(T.text),H={color:T.color??S?.color,underlined:T.underlined??S?.underlined,strikethrough:T.strikethrough??S?.strikethrough,bold:T.bold??S?.bold,italic:T.italic??S?.italic};if(d=d||H.underlined||H.strikethrough||!1,C?.includes(`
|
|
14
|
+
`))for(let P of C.split(`
|
|
15
|
+
`))A(P,H),m+=i,f="";else C&&A(C,H);if(T.extra)for(let P of T.extra)b(P,H)},A=(T,S)=>{o||(o=T.trim()!==""),f+=T,g[m]=v.measureText(f).width;let C=S.color??r;C.startsWith("#")||(C=ha[C.toLowerCase()]||C),c.push({fontStyle:`${S.bold?"bold":""} ${S.italic?"italic":""}`,fillStyle:C,underlineStyle:S.underlined??!1,strikeStyle:S.strikethrough??!1,offset:m,text:T})};if(b(l),!d&&!l.toString().trim())return;let _=0,w=0;for(let{fillStyle:T,fontStyle:S,underlineStyle:C,strikeStyle:H,offset:P,text:I}of c){w!==P&&(_=0),w=P,v.fillStyle=T,v.textRendering="optimizeLegibility",v.font=`${S} ${i}px mojangles`;let N=g[P]??v.measureText(I).width,O=(e.width-N)/2+_;v.fillText(I,O,P),H&&(v.lineWidth=i/8,v.strokeStyle=T,v.beginPath(),v.moveTo(O,P-v.lineWidth*2.5),v.lineTo(O+v.measureText(I).width,P-v.lineWidth*2.5),v.stroke()),C&&(v.lineWidth=i/8,v.strokeStyle=T,v.beginPath(),v.moveTo(O,P+v.lineWidth),v.lineTo(O+v.measureText(I).width,P+v.lineWidth),v.stroke()),_+=v.measureText(I).width}return o};x();R();M();k();function _e(n){let t=Math.floor(n.x/16),e=Math.floor(n.z/16);return[t,e]}function wi(n){let t=Math.floor(n.x/16),e=Math.floor(n.y/16),i=Math.floor(n.z/16);return[t,e,i]}x();R();M();k();import{Vec3 as d5}from"vec3";import{subscribeKey as Ii}from"valtio/utils";import{proxy as Aa,subscribe as Ea}from"valtio";x();R();M();k();var s5={blocks:"blocksArray",blockCollisionShapes:"blockCollisionShapes",biomes:"biomesArray"};x();R();M();k();var W2=16;var V2=(n,t)=>t?`${n}:${t}`:String(n);x();R();M();k();x();R();M();k();var Mi=Ke(j2(),1);import*as f1 from"three";x();R();M();k();x();R();M();k();var o1=class{constructor(t,e,i){this.name=t,this.fg=e,this.bg=i,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement("canvas"),this.canvas.width=90*this.PR,this.canvas.height=48*this.PR,this.canvas.style.width="90px",this.canvas.style.position="absolute",this.canvas.style.height="48px",this.canvas.style.cssText="width:90px;height:48px",this.context=this.canvas.getContext("2d"),this.context&&(this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(t,e,i,r,s=0){let o=1/0,a=0;this.context&&(o=Math.min(o,t),a=Math.max(i,t),r=Math.max(r,e),this.context.fillStyle=this.bg,this.context.globalAlpha=1,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(t.toFixed(s)+" "+this.name+" ("+o.toFixed(s)+"-"+parseFloat(a.toFixed(s))+")",this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT),this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,(1-e/r)*this.GRAPH_HEIGHT))}};var Y2=class a1{constructor({logsPerSecond:t=20,samplesLog:e=100,samplesGraph:i=10,precision:r=2,minimal:s=!1,horizontal:o=!0,mode:a=0}={}){this.mode=a,this.horizontal=o,this.container=document.createElement("div"),this.container.style.cssText="position:fixed;top:0;left:0;opacity:0.9;z-index:10000;",s&&(this.container.style.cssText+="cursor:pointer"),this.gl=null,this.query=null,this.minimal=s,this.beginTime=(performance||Date).now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.frames=0,this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.queryCreated=!1,this.fpsPanel=this.addPanel(new a1.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new a1.Panel("CPU","#0f0","#020"),1),this.gpuPanel=null,this.samplesLog=e,this.samplesGraph=i,this.precision=r,this.logsPerSecond=t,this.minimal?(this.container.addEventListener("click",v=>{v.preventDefault(),this.showPanel(++this.mode%this.container.children.length)},!1),this.mode=a,this.showPanel(this.mode)):window.addEventListener("resize",()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2)})}resizePanel(t,e){t.canvas.style.position="absolute",this.minimal?t.canvas.style.display="none":(t.canvas.style.display="block",this.horizontal?(t.canvas.style.top="0px",t.canvas.style.left=e*t.WIDTH/t.PR+"px"):(t.canvas.style.left="0px",t.canvas.style.top=e*t.HEIGHT/t.PR+"px"))}addPanel(t,e){return t.canvas&&(this.container.appendChild(t.canvas),this.resizePanel(t,e)),t}showPanel(t){for(let e=0;e<this.container.children.length;e++){let i=this.container.children[e];i.style.display=e===t?"block":"none"}this.mode=t}init(t){if(t){if(t instanceof WebGL2RenderingContext)this.gl=t;else if(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas){if(this.gl=t.getContext("webgl2"),!this.gl)return}else return;this.ext=this.gl.getExtension("EXT_disjoint_timer_query_webgl2"),this.ext&&(this.gpuPanel=this.addPanel(new a1.Panel("GPU","#ff0","#220"),2))}}begin(){if(this.beginProfiling("cpu-started"),!(!this.gl||!this.ext)){if(this.query){let t=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT_AVAILABLE);if(this.disjoint=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT),t&&!this.disjoint){this.ns=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT);let e=this.ns*1e-6;(t||this.disjoint)&&(this.gl.deleteQuery(this.query),this.query=null),t&&this.addToAverage(e,this.averageGpu)}}this.query||(this.queryCreated=!0,this.query=this.gl.createQuery(),this.query&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.query))}}end(){this.beginTime=this.endInternal(),this.endProfiling("cpu-started","cpu-finished","cpu-duration",this.averageCpu),!(!this.gl||!this.ext)&&this.queryCreated&&this.gl.getQuery(this.ext.TIME_ELAPSED_EXT,this.gl.CURRENT_QUERY)&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT)}endInternal(){this.frames++;let t=(performance||Date).now();if(t>=this.prevCpuTime+1e3/this.logsPerSecond&&(this.updatePanel(this.msPanel,this.averageCpu),this.updatePanel(this.gpuPanel,this.averageGpu),this.prevCpuTime=t),t>=this.prevTime+1e3){let e=this.frames*1e3/(t-this.prevTime);this.fpsPanel.update(e,e,100,100,0),this.prevTime=t,this.frames=0}return t}addToAverage(t,e){e.logs.push(t),e.logs.length>this.samplesLog&&e.logs.shift(),e.graph.push(t),e.graph.length>this.samplesGraph&&e.graph.shift()}beginProfiling(t){window.performance&&window.performance.mark(t)}endProfiling(t,e,i,r){if(window.performance&&e){window.performance.mark(e);let s=performance.measure(i,t,e);this.addToAverage(s.duration,r)}}updatePanel(t,e){if(e.logs.length>0){let i=0,r=.01;for(let a=0;a<e.logs.length;a++)i+=e.logs[a],e.logs[a]>r&&(r=e.logs[a]);let s=0,o=.01;for(let a=0;a<e.graph.length;a++)s+=e.graph[a],e.graph[a]>o&&(o=e.graph[a]);t&&t.update(i/Math.min(e.logs.length,this.samplesLog),s/Math.min(e.graph.length,this.samplesGraph),r,o,this.precision)}}};Y2.Panel=o1;var Q2=Y2;x();R();M();k();x();R();M();k();import*as V from"three";x();R();M();k();var we="1.21.4";x();R();M();k();function $t(n,t){n.aspect=t.width/t.height,n.updateProjectionMatrix()}var o5=["galaxy","nether","end","cyber","light"],a5=["cruise","barrel","dive","orbit","snake"],c1={galaxy:"Galaxy",nether:"Nether",end:"The End",cyber:"Cyber",light:"Light Space"},d1={cruise:"Cruise",barrel:"Barrel",dive:"Dive",orbit:"Orbit",snake:"Snake"},K2=.1,Ri={mixed:["white_wool","cyan_wool","blue_wool","purple_wool","white_stained_glass","cyan_stained_glass","blue_stained_glass","purple_stained_glass","glowstone","sea_lantern","amethyst_block","copper_block","gold_block","diamond_block"],stainedGlass:["white_stained_glass","orange_stained_glass","magenta_stained_glass","light_blue_stained_glass","yellow_stained_glass","lime_stained_glass","pink_stained_glass","gray_stained_glass","light_gray_stained_glass","cyan_stained_glass","purple_stained_glass","blue_stained_glass","brown_stained_glass","green_stained_glass","red_stained_glass","black_stained_glass"],wool:["white_wool","orange_wool","magenta_wool","light_blue_wool","yellow_wool","lime_wool","pink_wool","gray_wool","light_gray_wool","cyan_wool","purple_wool","blue_wool","brown_wool","green_wool","red_wool","black_wool"],construction:["copper_block","exposed_copper","weathered_copper","oxidized_copper","cut_copper","exposed_cut_copper","weathered_cut_copper","oxidized_cut_copper","iron_block","gold_block","diamond_block","emerald_block","netherite_block","lapis_block","redstone_block","coal_block","quartz_block","amethyst_block","bricks","stone_bricks","deepslate_bricks","polished_blackstone"],glow:["glowstone","sea_lantern","shroomlight","ochre_froglight","verdant_froglight","pearlescent_froglight","redstone_lamp","beacon"],world:["grass_block","podzol","mycelium","dirt","coarse_dirt","rooted_dirt","mud","clay","stone","cobblestone","mossy_cobblestone","deepslate","cobbled_deepslate","tuff","calcite","sand","red_sand","gravel","snow_block","coal_ore","deepslate_coal_ore","iron_ore","deepslate_iron_ore","copper_ore","deepslate_copper_ore","gold_ore","deepslate_gold_ore","diamond_ore","deepslate_diamond_ore","emerald_ore","deepslate_emerald_ore","lapis_ore","deepslate_lapis_ore","redstone_ore","deepslate_redstone_ore","nether_gold_ore","ancient_debris","oak_log","birch_log","spruce_log","jungle_log","acacia_log","dark_oak_log","mangrove_log","cherry_log","netherrack","soul_sand","basalt","end_stone"]},v5=["mixed","stainedGlass","wool","construction","glow","world"],u1={mixed:"Mixed",stainedGlass:"Stained glass",wool:"Wool",construction:"Construction",glow:"Glow",world:"World (grass & ores)"},J2={galaxy:{bg:132114,fog:132114,fogD:.011,blocks:[61695,54527,47359,59647,2280703,43263],emit:[13158,8789,6724],nebula:[4403,1114146,4386],galFn:n=>new V.Color(n*.05,n*.2,n),ambient:264216,dir:3368703,pt1:43775,pt2:16729343,name:"GALAXY"},nether:{bg:917760,fog:917760,fogD:.016,blocks:[16720384,16737792,16750848,13373696,16729122,16755200],emit:[2230272,1114112,3346688],nebula:[1704960,851968,1705984],galFn:n=>new V.Color(n,n*.15,0),ambient:1573376,dir:16724736,pt1:16729088,pt2:16755200,name:"NETHER"},end:{bg:0,fog:0,fogD:.009,blocks:[7807658,11158732,5570679,14527231,3342421,12299007],emit:[655381,1572901,327696],nebula:[524312,851989,262158],galFn:n=>new V.Color(n*.4,0,n),ambient:393232,dir:10040319,pt1:11158783,pt2:4456618,name:"THE END"},cyber:{bg:2566,fog:2566,fogD:.01,blocks:[65535,65416,11206400,52479,6749952,65518],emit:[8721,6656,6690],nebula:[6674,5120,4634],galFn:n=>new V.Color(0,n,n*.6),ambient:6669,dir:65450,pt1:65484,pt2:4521728,name:"CYBER"},light:{bg:8951984,fog:7899296,fogD:.006,gradientBg:{top:14214392,mid:10531016,bottom:6846608,radial:!0},blocks:[15266559,13691135,12114175,10537208,8960240,7383272,10012927,12640511,15792383,7909608,14216447,14739711],emit:[6854864,8958176,11061488,12638456],nebula:[9480392,11059424,12637420,14215416,7901360],galFn:n=>{let t=new V.Color;return n<.4?t.lerpColors(new V.Color(16054527),new V.Color(14215423),n/.4):n<.75?t.lerpColors(new V.Color(14215423),new V.Color(11061488),(n-.4)/.35):t.lerpColors(new V.Color(11061488),new V.Color(9482464),(n-.75)/.25),t},ambient:7899296,dir:13688040,pt1:11061503,pt2:13162751,name:"LIGHT",starColor:15266047,starOpacity:.5,galaxyOpacity:.7,nebulaOpacity:.32,edgeLineColor:10010856,blockOpacity:[.42,.56]}},ma={cruise:{pos:(n,t,e)=>({x:Math.sin(n*.28)*18+Math.cos(n*.11)*7+t*10,y:Math.sin(n*.19)*6+Math.cos(n*.31)*3+e*6,z:0}),look:(n,t,e)=>({x:Math.sin((n+.18)*.28)*18+t*8,y:Math.sin((n+.18)*.19)*6+e*4,z:-25}),roll:(n,t=0)=>t*.05+Math.sin(n*.22)*.015,spd:.18},barrel:{pos:(n,t,e)=>{let r=n*2.4;return{x:Math.cos(r)*10+t*4,y:Math.sin(r)*10+e*4,z:Math.sin(n*.4)*8}},look:n=>({x:Math.sin(n*.5)*5,y:Math.cos(n*.5)*5,z:-30}),roll:n=>n*2.4+Math.PI*.5,spd:.24},dive:{pos:(n,t,e)=>({x:Math.sin(n*.6)*30+t*8,y:Math.cos(n*.4)*18+e*6,z:Math.sin(n*.3)*12}),look:(n,t,e)=>({x:Math.sin(n*.6+.2)*30+t*6,y:Math.cos(n*.4+.2)*18-8+e*4,z:-35}),roll:(n,t=0)=>t*.08+Math.sin(n*.6)*.12,spd:.3},orbit:{pos:(n,t,e)=>({x:Math.cos(n*.5)*20+t*5,y:Math.sin(n*.25)*10+e*5,z:Math.sin(n*.5)*20}),look:()=>({x:0,y:0,z:-60}),roll:n=>Math.sin(n*.5)*.08,spd:.15},snake:{pos:(n,t,e)=>({x:Math.sin(n*1.1)*22+Math.sin(n*.37)*8+t*10,y:Math.sin(n*.7)*10+t*4+e*8,z:0}),look:(n,t,e)=>{let i=n+.12;return{x:Math.sin(i*1.1)*22+Math.sin(i*.37)*8+t*8,y:Math.sin(i*.7)*10+e*6,z:-22}},roll:(n,t=0)=>t*.1+Math.sin(n*1.1)*.06,spd:.22}},pa={cruise:1,barrel:1.6,dive:2.2,orbit:.7,snake:1.4},ga=250,v1=1e4,l1=3e3,Ae=n=>n[Math.floor(Math.random()*n.length)],xi=n=>"#"+n.toString(16).padStart(6,"0"),q2=n=>{if(typeof document>"u")return null;let t=document.createElement("canvas");t.width=4,t.height=512;let e=t.getContext("2d");if(!e)return null;let i=t.width,r=t.height,s=n.radial?e.createRadialGradient(i/2,r*.32,0,i/2,r*.32,r*.85):e.createLinearGradient(0,0,0,r);s.addColorStop(0,xi(n.top)),n.mid!=null&&s.addColorStop(.45,xi(n.mid)),s.addColorStop(1,xi(n.bottom)),e.fillStyle=s,e.fillRect(0,0,i,r);let o=new V.CanvasTexture(t);return o.needsUpdate=!0,o},te=class{constructor(t,e={},i){this.documentRenderer=t;this.abortSignal=i;u(this,"scene");u(this,"camera");u(this,"ambient");u(this,"dir");u(this,"pt1");u(this,"pt2");u(this,"blocks",[]);u(this,"bGroup",new V.Group);u(this,"galaxy");u(this,"nebula");u(this,"stars");u(this,"galGeo");u(this,"nebGeo");u(this,"bGeo",new V.BoxGeometry(1,1,1));u(this,"eGeo",new V.EdgesGeometry(this.bGeo));u(this,"curScene");u(this,"curCam");u(this,"blockGroup");u(this,"cameraSpeed");u(this,"blockSpeed");u(this,"camT",0);u(this,"mx",0);u(this,"my",0);u(this,"tmx",0);u(this,"tmy",0);u(this,"transitioning",!1);u(this,"useMinecraftTextures",!1);u(this,"resourcesManager");u(this,"atlasTexture",null);u(this,"blockMaterialPool",new Map);u(this,"gradientSky",null);u(this,"gradientSkyTexture",null);u(this,"disposed",!1);u(this,"animTime",0);let r=dt;this.curScene=e.initialScene??r.futuristicScene,this.curCam=e.initialCamera??r.futuristicCamera,this.blockGroup=e.initialBlockGroup??r.futuristicBlockGroup,this.cameraSpeed=e.initialCameraSpeed??t5.camera,this.blockSpeed=e.initialBlockSpeed??t5.block,this.useMinecraftTextures=e.useMinecraftTextures??r.minecraftTextures,this.resourcesManager=e.resourcesManager;let s=J2[this.curScene];this.scene=new V.Scene,this.scene.fog=new V.FogExp2(s.fog,s.fogD),this.applyScenePalette(s),this.camera=new V.PerspectiveCamera(80,this.documentRenderer.canvas.width/this.documentRenderer.canvas.height,.1,700),this.ambient=new V.AmbientLight(s.ambient,2.5),this.scene.add(this.ambient),this.dir=new V.DirectionalLight(s.dir,4),this.dir.position.set(1,1,0),this.scene.add(this.dir),this.pt1=new V.PointLight(s.pt1,5,100),this.scene.add(this.pt1),this.pt2=new V.PointLight(s.pt2,4,80),this.pt2.position.set(30,20,-30),this.scene.add(this.pt2);for(let f=0;f<ga;f++)this.spawnBlock(s,!0);if(!this.useMinecraftTextures){let f=s.edgeLineColor??62975;for(let m=0;m<40;m++){let g=new V.LineBasicMaterial({color:f,transparent:!0,opacity:.25});Ae(this.blocks).mesh.add(new V.LineSegments(this.eGeo,g))}}this.scene.add(this.bGroup);let o=new V.BufferGeometry,a=new Float32Array(5e3*3);for(let f=0;f<5e3*3;f++)a[f]=(Math.random()-.5)*500;o.setAttribute("position",new V.BufferAttribute(a,3)),this.stars=new V.Points(o,new V.PointsMaterial({color:s.starColor??16777215,size:.3,transparent:!0,opacity:s.starOpacity??.7,sizeAttenuation:!0})),this.scene.add(this.stars),this.galGeo=new V.BufferGeometry;let v=new Float32Array(v1*3),l=new Float32Array(v1*3);for(let f=0;f<v1;f++){let m=f%3,g=Math.random(),b=m/3*Math.PI*2+g*Math.PI*5,A=g*90+Math.random()*10,_=(1-g)*18;v[f*3]=Math.cos(b)*A+(Math.random()-.5)*_,v[f*3+1]=(Math.random()-.5)*7,v[f*3+2]=Math.sin(b)*A+(Math.random()-.5)*_-180;let w=.2+g*.8,T=s.galFn(w);l[f*3]=T.r,l[f*3+1]=T.g,l[f*3+2]=T.b}this.galGeo.setAttribute("position",new V.BufferAttribute(v,3)),this.galGeo.setAttribute("color",new V.BufferAttribute(l,3)),this.galaxy=new V.Points(this.galGeo,new V.PointsMaterial({size:.9,vertexColors:!0,transparent:!0,opacity:s.galaxyOpacity??.55,sizeAttenuation:!0})),this.scene.add(this.galaxy),this.nebGeo=new V.BufferGeometry;let c=new Float32Array(l1*3),d=new Float32Array(l1*3);for(let f=0;f<l1;f++){let m=25+Math.random()*110,g=Math.random()*Math.PI*2,b=(Math.random()-.5)*Math.PI*.5;c[f*3]=m*Math.cos(g)*Math.cos(b),c[f*3+1]=m*Math.sin(b)*.6,c[f*3+2]=m*Math.sin(g)*Math.cos(b)-80;let A=new V.Color(Ae(s.nebula));d[f*3]=A.r,d[f*3+1]=A.g,d[f*3+2]=A.b}this.nebGeo.setAttribute("position",new V.BufferAttribute(c,3)),this.nebGeo.setAttribute("color",new V.BufferAttribute(d,3)),this.nebula=new V.Points(this.nebGeo,new V.PointsMaterial({size:3,vertexColors:!0,transparent:!0,opacity:s.nebulaOpacity??.3,sizeAttenuation:!0})),this.scene.add(this.nebula),this.addBackgroundTextPlane(),this.setupMouseTracking()}async init(){if(this.useMinecraftTextures)try{await this.loadMinecraftTextures()}catch{this.useMinecraftTextures=!1}}applyScenePalette(t){if(this.documentRenderer.renderer.setClearColor(t.bg),t.gradientBg)if(this.scene.background=null,this.gradientSky){if(this.gradientSky.visible=!0,this.gradientSkyTexture&&t.gradientBg){let s=q2(t.gradientBg);s&&(this.gradientSkyTexture.dispose(),this.gradientSkyTexture=s,this.gradientSky.material.map=s,this.gradientSky.material.needsUpdate=!0)}}else{let s=q2(t.gradientBg);s?(this.gradientSkyTexture=s,this.gradientSky=new V.Mesh(new V.PlaneGeometry(900,700),new V.MeshBasicMaterial({map:s,depthWrite:!1,side:V.DoubleSide})),this.gradientSky.position.set(0,0,-280),this.gradientSky.renderOrder=-1e3,this.scene.add(this.gradientSky)):this.scene.background=new V.Color(t.bg)}else this.scene.background=new V.Color(t.bg),this.gradientSky&&(this.gradientSky.visible=!1);this.scene.fog instanceof V.FogExp2&&(this.scene.fog.color.set(t.fog),this.scene.fog.density=t.fogD);let e=this.stars?.material;e&&(e.color.set(t.starColor??16777215),e.opacity=t.starOpacity??.7);let i=this.galaxy?.material;i&&(i.opacity=t.galaxyOpacity??.55);let r=this.nebula?.material;r&&(r.opacity=t.nebulaOpacity??.3)}setupMouseTracking(){let t=i=>{let r=typeof window<"u"?window.innerWidth:this.documentRenderer.canvas.width,s=typeof window<"u"?window.innerHeight:this.documentRenderer.canvas.height;this.tmx=(i.clientX/r-.5)*2,this.tmy=-(i.clientY/s-.5)*2};(typeof document<"u"?document:void 0)?.addEventListener("mousemove",t,{signal:this.abortSignal})}addBackgroundTextPlane(){let i=typeof document<"u"?document.createElement("canvas"):null;if(!i)return;i.width=2048,i.height=768;let r=i.getContext("2d");if(!r)return;r.clearRect(0,0,2048,768),r.save(),r.font="bold 560px Orbitron, sans-serif",r.textAlign="center",r.textBaseline="middle",r.shadowColor="rgba(0,200,255,0.35)",r.shadowBlur=80,r.fillStyle="rgba(255,255,255,0.055)",r.fillText("V2",2048*.28,768*.5),r.restore(),r.save(),r.font="bold 148px Orbitron, sans-serif",r.textAlign="center",r.textBaseline="middle",r.shadowColor="rgba(0,200,255,0.2)",r.shadowBlur=40,r.fillStyle="rgba(255,255,255,0.038)",r.fillText("by ZARDOY",2048*.72,768*.52),r.restore();let s=new V.CanvasTexture(i),o=new V.Mesh(new V.PlaneGeometry(280,105),new V.MeshBasicMaterial({map:s,transparent:!0,opacity:1,depthWrite:!1,side:V.DoubleSide,blending:V.AdditiveBlending}));o.position.set(8,4,-320),this.scene.add(o)}spawnBlock(t,e,i){let r=this.createBlockMaterial(t,i),s=new V.Mesh(this.bGeo,r),o=.3+Math.random()*3;s.scale.setScalar(o),s.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,e?-(Math.random()*140):-155-Math.random()*30),s.rotation.set(Math.random()*Math.PI*2,Math.random()*Math.PI*2,Math.random()*Math.PI*2);let a={mesh:s,spd:.04+Math.random()*.12,dx:(Math.random()-.5)*.012,dy:(Math.random()-.5)*.008,rx:(Math.random()-.5)*.012,ry:(Math.random()-.5)*.012,rz:(Math.random()-.5)*.01,minecraftBlockName:i};this.blocks.push(a),this.bGroup.add(s)}createBlockMaterial(t,e){if(this.useMinecraftTextures&&e){let s=this.blockMaterialPool.get(e);if(s)return s.clone()}let[i,r]=t.blockOpacity??[.32,.46];return new V.MeshBasicMaterial({color:Ae(t.blocks),transparent:!0,opacity:i+Math.random()*(r-i),depthWrite:!1,blending:V.AdditiveBlending})}removeBlockEdgeLines(){for(let t of this.blocks){let e=t.mesh.children.filter(i=>i instanceof V.LineSegments);for(let i of e){t.mesh.remove(i),i.geometry?.dispose();let r=i.material;Array.isArray(r)?r.forEach(s=>s.dispose()):r.dispose()}}}async ensureMcDataLoaded(){let t=globalThis._LOAD_MC_DATA;t&&await t()}resolveBlockAtlasUv(t,e,i){let r=s=>{let o=e[s];return o?{u:o.u,v:o.v,su:o.su??i.suSv,sv:o.sv??i.suSv}:null};if(e[t])return r(t);for(let s of["_top","_side","_front","_0"]){let o=r(`${t}${s}`);if(o)return o}for(let s of Object.keys(e))if(s.startsWith(t))return r(s);return null}async loadMinecraftTextures(){await this.ensureMcDataLoaded();let t=this.resourcesManager??new lt;!t.currentResources?.blocksAtlasImage&&(t.currentConfig={...t.currentConfig,version:we,noInventoryGui:!0},await t.updateAssetsData?.({}));let i=t.currentResources;if(!i?.blocksAtlasImage||!i.blocksAtlasJson)throw new Error("Block atlas not available");let r=i.blocksAtlasJson,s=r.textures;this.atlasTexture=e5(i.blocksAtlasImage),this.atlasTexture.flipY=!1,this.atlasTexture.needsUpdate=!0;for(let o of Ri[this.blockGroup]){let a=this.resolveBlockAtlasUv(o,s,r);if(!a)continue;let v=this.atlasTexture.clone();v.flipY=!1,v.offset.set(a.u,a.v),v.repeat.set(a.su,a.sv),v.needsUpdate=!0;let l=o.includes("glass"),c=new V.MeshBasicMaterial({map:v,side:V.DoubleSide,transparent:l,opacity:l?.85:1,alphaTest:l?.08:0,depthWrite:!0,toneMapped:!1});this.blockMaterialPool.set(o,c)}if(this.blockMaterialPool.size===0)throw new Error("No block textures resolved from atlas (check block names vs atlas keys)");this.removeBlockEdgeLines();for(let o of this.blocks){let a=Ae([...this.blockMaterialPool.keys()]);o.minecraftBlockName=a,o.mesh.material=this.blockMaterialPool.get(a).clone()}}setScene(t){if(!o5.includes(t)||t===this.curScene||this.transitioning)return;this.transitioning=!0,this.curScene=t;let e=J2[t];setTimeout(()=>{if(this.disposed)return;this.applyScenePalette(e),this.ambient.color.set(e.ambient),this.dir.color.set(e.dir),this.pt1.color.set(e.pt1),this.pt2.color.set(e.pt2);for(let s of this.blocks)this.useMinecraftTextures&&s.minecraftBlockName||s.mesh.material instanceof V.MeshBasicMaterial&&s.mesh.material.color.set(Ae(e.blocks));let i=this.nebGeo.attributes.color;for(let s=0;s<l1;s++){let o=new V.Color(Ae(e.nebula));i.setXYZ(s,o.r,o.g,o.b)}i.needsUpdate=!0;let r=this.galGeo.attributes.color;for(let s=0;s<v1;s++){let o=.2+Math.random()*.8,a=e.galFn(o);r.setXYZ(s,a.r,a.g,a.b)}r.needsUpdate=!0,this.transitioning=!1},150)}setCamera(t){a5.includes(t)&&(this.curCam=t)}setCameraSpeed(t){this.cameraSpeed=Math.max(0,t)}setBlockSpeed(t){this.blockSpeed=Math.max(0,t)}async setBlockGroup(t){if(v5.includes(t)&&t!==this.blockGroup&&(this.blockGroup=t,!(!this.useMinecraftTextures||this.disposed))){for(let e of this.blockMaterialPool.values())e.map?.dispose(),e.dispose();this.blockMaterialPool.clear();try{await this.loadMinecraftTextures()}catch{}}}getSceneId(){return this.curScene}getCameraId(){return this.curCam}getBlockGroupId(){return this.blockGroup}update(t,e){e&&$t(this.camera,this.documentRenderer.canvas);let i=ma[this.curCam],r=this.cameraSpeed,s=this.blockSpeed;this.camT+=t*i.spd*r,this.mx+=(this.tmx-this.mx)*.05,this.my+=(this.tmy-this.my)*.05;let o=this.mx*K2,a=this.my*K2,v=i.pos(this.camT,o,a),l=i.look(this.camT,o,a);this.camera.position.set(v.x,v.y,v.z),this.camera.lookAt(l.x,l.y,l.z),this.camera.rotation.z=i.roll(this.camT,o);let c=pa[this.curCam]*s;this.animTime+=t*1e3*s;for(let d of this.blocks){if(d.mesh.position.z+=d.spd*c*60*t,d.mesh.position.x+=d.dx*60*t*s,d.mesh.position.y+=d.dy*60*t*s,d.mesh.rotation.x+=d.rx*c,d.mesh.rotation.y+=d.ry*c,d.mesh.rotation.z+=d.rz,!this.useMinecraftTextures&&d.mesh.material instanceof V.MeshBasicMaterial){let f=d.mesh.userData.baseOpacity??.38;d.mesh.userData.baseOpacity==null&&(d.mesh.userData.baseOpacity=f);let m=.88+Math.abs(Math.sin(this.animTime*8e-4+d.mesh.position.x*.3))*.12;d.mesh.material.opacity=f*m}d.mesh.position.z>this.camera.position.z+15&&d.mesh.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,this.camera.position.z-155-Math.random()*30)}this.pt1.position.set(Math.sin(this.camT*.8)*25+this.camera.position.x,Math.cos(this.camT*.6)*12+this.camera.position.y,this.camera.position.z-18),this.pt2.position.set(Math.cos(this.camT*.5)*20+this.camera.position.x,Math.sin(this.camT*.9)*15+this.camera.position.y,this.camera.position.z-30),this.galaxy.rotation.y+=t*.006*s,this.nebula.rotation.y-=t*.003*s,this.stars.rotation.y+=t*4e-4*s}dispose(){this.disposed=!0,this.scene.clear(),this.bGeo.dispose(),this.eGeo.dispose(),this.galGeo.dispose(),this.nebGeo.dispose(),this.gradientSkyTexture?.dispose(),this.atlasTexture?.dispose();for(let t of this.blockMaterialPool.values())t.map?.dispose(),t.dispose();this.blockMaterialPool.clear()}};function ki(n){if(n==="high-performance")return"high-performance";if(n==="low-power")return"low-power"}var ee=dt,Z2={rendererWorldPerformance:"normal",rendererMeshersCountOverride:null,starfieldRendering:!0,defaultSkybox:!0,menuBackgroundMode:ee.mode,menuBackgroundMinecraftTextures:ee.minecraftTextures,menuBackgroundFuturisticScene:ee.futuristicScene,menuBackgroundFuturisticCamera:ee.futuristicCamera,menuBackgroundFuturisticBlockGroup:ee.futuristicBlockGroup,menuBackgroundFuturisticCameraSpeed:ee.futuristicCameraSpeedPercent,menuBackgroundFuturisticBlockSpeed:ee.futuristicBlockSpeedPercent,rendererFuturisticReveal:!1,rendererPerfDebugOverlay:!1,disableBlockEntityTextures:!1,rendererMesher:"wasm",showChunkBorders:!1,renderEntities:!0,renderDebug:"basic",frameLimit:!1,backgroundRendering:"20fps",vanillaLook:!1,smoothLighting:!0,newVersionsLighting:!1,vrSupport:!0,vrPageGameRendering:!1,clipWorldBelowY:void 0,highlightBlockColor:"auto",loadPlayerSkins:!0,renderEars:!0,showHand:!0,viewBobbing:!0,dayCycleAndLighting:!0,keepChunksDistance:1,gpuPreference:"default"};var X2={menuBackgroundMode:{possibleValues:[["classic","Classic"],["futuristic","Futuristic"]],requiresRestart:!0},menuBackgroundMinecraftTextures:{text:"Minecraft block textures",tooltip:"Use block atlas on futuristic menu cubes (loads assets on menu)"},menuBackgroundFuturisticScene:{possibleValues:o5.map(n=>[n,c1[n]])},menuBackgroundFuturisticCamera:{possibleValues:a5.map(n=>[n,d1[n]])},menuBackgroundFuturisticBlockGroup:{possibleValues:v5.map(n=>[n,u1[n]]),text:"Block pool",tooltip:"Block set for textured menu cubes (requires Minecraft textures)"},menuBackgroundFuturisticCameraSpeed:{text:"Camera speed",tooltip:"Orbit / fly-through camera path speed. 0 freezes the path; mouse parallax still works.",min:0,max:200,unit:"%"},menuBackgroundFuturisticBlockSpeed:{text:"Block speed",tooltip:"Floating blocks and sky rotation. Independent of camera path speed.",min:0,max:200,unit:"%"},rendererWorldPerformance:{text:"World performance",tooltip:"Background workers for chunk geometry. Reload to apply.",requiresRestart:!0,possibleValues:[["low-energy","Low Energy"],["normal","Normal"],["maximum","Maximum"]]},starfieldRendering:{text:"Starfield"},defaultSkybox:{text:"Default skybox"},rendererFuturisticReveal:{text:"Futuristic world reveal"},rendererPerfDebugOverlay:{text:"Performance debug overlay"},disableBlockEntityTextures:{text:"Disable block entity textures",tooltip:"Skips signs, banners, heads, maps, etc."},rendererMesher:{possibleValues:[["wasm","WASM"],["legacy-js","Legacy JS"]],text:"Mesher pipeline",tooltip:"WASM is faster. Use JS if WASM is not working. Requires reload.",requiresRestart:!0},showChunkBorders:{text:"Chunk borders"},renderEntities:{text:"Render entities"},renderDebug:{possibleValues:["advanced","basic","none"]},frameLimit:{text:"Frame limit",tooltip:"false = VSync / unlimited when focused"},backgroundRendering:{text:"Background FPS limit",possibleValues:[["full","NO"],["5fps","5 FPS"],["20fps","20 FPS"]]},vanillaLook:{text:"Vanilla shading",tooltip:"On: Minecraft-style face shading. Off: higher-contrast client shading."},smoothLighting:{},newVersionsLighting:{text:"Lighting in newer versions"},vrSupport:{text:"VR support",tooltip:"Shows VR entry; does not force VR on."},vrPageGameRendering:{text:"VR page game rendering"},clipWorldBelowY:{text:"Clip world below Y"},highlightBlockColor:{possibleValues:[["auto","Auto"],["blue","Blue"],["classic","Classic"]]},loadPlayerSkins:{},renderEars:{tooltip:"Deadmau5 ears when the skin texture includes them"},showHand:{},viewBobbing:{},dayCycleAndLighting:{text:"Day cycle"},keepChunksDistance:{text:"Keep chunks distance",tooltip:"Extra distance before unloading chunks",max:5,unit:""},gpuPreference:{text:"GPU preference",tooltip:"WebGL power preference. Requires reload / backend restart to apply.",requiresRestart:!0,possibleValues:[["default","Auto"],["high-performance","Dedicated"],["low-power","Low power"]]}},$2=[{title:"World rendering",keys:["rendererWorldPerformance","starfieldRendering","defaultSkybox","disableBlockEntityTextures","showChunkBorders","renderEntities","smoothLighting","vanillaLook","newVersionsLighting","dayCycleAndLighting","loadPlayerSkins","renderEars","showHand","viewBobbing","keepChunksDistance","highlightBlockColor","clipWorldBelowY"]},{title:"Frame pacing",keys:["frameLimit","backgroundRendering","renderDebug","gpuPreference"]},{title:"VR",keys:["vrSupport","vrPageGameRendering"]},{title:"Menu background",keys:["menuBackgroundMode","menuBackgroundMinecraftTextures","menuBackgroundFuturisticScene","menuBackgroundFuturisticCamera","menuBackgroundFuturisticBlockGroup","menuBackgroundFuturisticCameraSpeed","menuBackgroundFuturisticBlockSpeed"]},{title:"Mesher",keys:["rendererMesher"]},{title:"Renderer debug",keys:["rendererFuturisticReveal","rendererPerfDebugOverlay"]}];var R0=typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope,Ti=class{constructor(t,e=0){this.canvas=t;u(this,"stats");u(this,"stats2");u(this,"statsGl");u(this,"total",0);u(this,"denseMode");this.stats=new Mi.default,this.stats2=new Mi.default,this.statsGl=new Q2({minimal:!0}),this.stats2.showPanel(2),this.denseMode=typeof D<"u"&&!0||typeof window<"u"&&window.innerHeight<500,this.initStats(),this.setVisibility(e)}addStat(t,e=80){t.style.position="absolute",this.denseMode&&(t.style.height="12px"),t.style.overflow="hidden",t.style.left="",t.style.top="0",t.style.right=`${this.total}px`,t.style.width="80px",t.style.zIndex="1",t.style.opacity="0.8";let i=document.getElementById("corner-indicator-stats"),r=i??document.body;i&&(t.style.position="relative"),r.appendChild(t),this.total+=e}initStats(){let t=this.stats2.dom.children.length===3;this.addStat(this.stats.dom),t&&this.addStat(this.stats2.dom),this.statsGl.init(this.canvas),this.statsGl.container.style.display="flex",this.statsGl.container.style.justifyContent="flex-end";let e=0;for(let i of this.statsGl.container.children){let r=i;e++===0&&(r.style.display="none"),r.style.position=""}}setVisibility(t){t>0?(this.stats.dom.style.display="block",this.stats2.dom.style.display=t>=2?"block":"none",this.statsGl.container.style.display=t>=2?"block":"none"):(this.stats.dom.style.display="none",this.stats2.dom.style.display="none",this.statsGl.container.style.display="none")}markStart(){this.stats.begin(),this.stats2.begin(),this.statsGl.begin()}markEnd(){this.stats.end(),this.stats2.end(),this.statsGl.end()}dispose(){this.stats.dom.remove(),this.stats2.dom.remove(),this.statsGl.container.remove()}},l5=class{constructor(t,e,i){this.initOptions=t;this.externalCanvas=e;u(this,"canvas");u(this,"renderer");u(this,"animationFrameId");u(this,"timeoutId");u(this,"lastRenderTime",0);u(this,"previousCanvasWidth",0);u(this,"previousCanvasHeight",0);u(this,"currentWidth",0);u(this,"currentHeight",0);u(this,"pendingResize",!1);u(this,"renderedFps",0);u(this,"fpsInterval");u(this,"stats");u(this,"paused",!1);u(this,"disconnected",!1);u(this,"preRender",()=>{});u(this,"render",t=>{});u(this,"postRender",()=>{});u(this,"sizeChanged",()=>{});u(this,"droppedFpsPercentage",0);u(this,"config");u(this,"onRender",[]);u(this,"inWorldRenderingConfig");u(this,"nonReactiveState");this.config=t.config,e?this.canvas=e:this.addToPage();try{let s=t.getRendererOptions?.()?.gpuPreference??"default";this.renderer=new f1.WebGLRenderer({canvas:this.canvas,preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0,powerPreference:ki(s)})}catch(s){throw t.callbacks.displayCriticalError(new Error(`Failed to create WebGL context, not possible to render (restart browser): ${s.message}`)),s}this.renderer.useLegacyLights=!0,this.renderer.outputColorSpace=f1.LinearSRGBColorSpace,e||(this.updatePixelRatio(),this.setupResizeListener()),this.sizeUpdated(),this.previousCanvasWidth=this.canvas.width,this.previousCanvasHeight=this.canvas.height;let r="WebGL2RenderingContext"in globalThis;!e&&r&&!R0&&(this.stats=new Ti(this.canvas,this.config.statsVisible)),this.setupFpsTracking(),this.startRenderLoop()}setupResizeListener(){if(typeof window>"u")return;let t,e=()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.pendingResize=!0},16)};window.addEventListener("resize",e,{passive:!0})}updatePixelRatio(){if(typeof window>"u")return;let t=window.devicePixelRatio||1;this.renderer.capabilities.isWebGL2||(t=1),this.renderer.setPixelRatio(t)}sizeUpdated(){this.renderer.setSize(this.currentWidth,this.currentHeight,!1)}addToPage(){this.canvas=t3(),this.updateCanvasSize()}updateSizeExternal(t,e,i){this.currentWidth=t,this.currentHeight=e,this.renderer.setPixelRatio(i),this.sizeUpdated()}updateCanvasSize(){if(this.externalCanvas||typeof document>"u")return;let t=document.body.offsetWidth,e=document.body.offsetHeight;this.currentWidth!==t&&(this.currentWidth=t),this.currentHeight!==e&&(this.currentHeight=e)}setupFpsTracking(){let t=0;this.fpsInterval=setInterval(()=>{t>0&&(this.droppedFpsPercentage=this.renderedFps/t),t=Math.max(this.renderedFps,t),this.nonReactiveState&&(this.nonReactiveState.fps=this.renderedFps),this.renderedFps=0},1e3)}startRenderLoop(){let t=()=>{if(this.disconnected)return;if(this.config.timeoutRendering){let r=1e3/(this.config.fpsLimit?Math.min(this.config.fpsLimit,60):60);this.timeoutId=setTimeout(t,r)}else this.animationFrameId=requestAnimationFrame(t);if(this.paused||this.renderer.xr.isPresenting&&!this.inWorldRenderingConfig?.vrPageGameRendering)return;if(!this.config.timeoutRendering&&this.config.fpsLimit){let i=performance.now(),r=i-this.lastRenderTime,s=1e3/this.config.fpsLimit;if(r<s)return;this.lastRenderTime=i-r%s}let e=!1;this.pendingResize&&(this.updateCanvasSize(),this.pendingResize=!1),(this.previousCanvasWidth!==this.currentWidth||this.previousCanvasHeight!==this.currentHeight)&&(this.previousCanvasWidth=this.currentWidth,this.previousCanvasHeight=this.currentHeight,this.sizeUpdated(),e=!0),this.frameRender(e),this.config.statsVisible!==void 0&&this.stats?.setVisibility(this.config.statsVisible)};t()}frameRender(t){this.preRender(),this.stats?.markStart(),N2(),globalThis.freezeRender||this.render(t);for(let e of this.onRender)e(t);this.renderedFps++,this.stats?.markEnd(),this.postRender()}setPaused(t){this.paused=t}dispose(){this.disconnected=!0,this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.timeoutId&&clearTimeout(this.timeoutId),this.canvas instanceof HTMLCanvasElement&&this.canvas.remove(),clearInterval(this.fpsInterval),this.stats?.dispose(),this.renderer.dispose()}};function t3(){let n=document.createElement("canvas");return n.id="viewer-canvas",document.body.appendChild(n),n}var Si=()=>{let n=t3(),t=n.transferControlToOffscreen(),e=!1,i=(o,a)=>{},r={width:0,height:0},s=()=>{e||((r.width!==window.innerWidth||r.height!==window.innerHeight)&&(i(window.innerWidth,window.innerHeight),r={width:window.innerWidth,height:window.innerHeight}),requestAnimationFrame(s))};return requestAnimationFrame(s),{canvas:t,destroy(){e=!0,n.remove()},onSizeChanged(o){i=o},get size(){return{width:window.innerWidth,height:window.innerHeight}}}};var e3=0,_t={},Ci=40,c5="mc-renderer-debug-overlay",Ee=(n,t=80,e=e3,i=Ci,r)=>{if(R0)return{updateText(){},setVisibility(){}};let s=document.createElement("div");return s.style.position="fixed",s.style.top=`${i??Ci}px`,s.style.right=`${e}px`,s.style.backgroundColor="rgba(0, 0, 0, 0.7)",s.style.color="white",s.style.padding="2px",s.style.fontFamily="monospace",s.style.fontSize="12px",r?.className?s.className=r.className:s.style.zIndex="100",s.style.pointerEvents="none",document.body.appendChild(s),_t[n]=s,i===void 0&&e===e3&&(Ci+=20),{updateText(o){s.innerText!==o&&(s.innerText=o)},setVisibility(o){s.style.display=o?"block":"none"}}};var Bi=(n,t)=>{R0||!_t[n]||(_t[n].innerText=t)},i3=n=>{if(!R0)for(let t in _t)_t[t].style.display=n?"block":"none"},r3=()=>{if(!R0)for(let n in _t)ba(n)},ba=n=>{R0||!_t[n]||(_t[n].remove(),delete _t[n])};x();R();M();k();var ya=n=>{let t=n%24e3/24e3-.25;return t<0&&(t+=1),t>1&&(t-=1),t+(1-Math.cos(t*Math.PI))/2},_a=n=>{let t=(n%24e3+24e3)%24e3,e=ya(t),r=Math.cos(e*Math.PI*2)*.5+.5,s=Math.round(4+r*11);return Math.max(4,Math.min(15,s))},Pi=n=>{let t=(n%24e3+24e3)%24e3;if(t>=0&&t<12e3)return 15;if(t>=12e3&&t<13e3){let e=(t-12e3)/1e3;return Math.round(15-e*11)}else{if(t>=13e3&&t<23e3)return 4;{let e=(t-23e3)/1e3;return Math.round(4+e*11)}}},wa=()=>{let n=[{ticks:0,label:"6:00 AM (sunrise)"},{ticks:6e3,label:"12:00 PM (noon)"},{ticks:12e3,label:"6:00 PM (sunset starts)"},{ticks:12500,label:"6:30 PM (sunset mid)"},{ticks:13e3,label:"7:00 PM (night begins)"},{ticks:18e3,label:"12:00 AM (midnight)"},{ticks:19e3,label:"1:00 AM"},{ticks:23e3,label:"5:00 AM (dawn begins)"},{ticks:23500,label:"5:30 AM (dawn mid)"}];for(let{ticks:t,label:e}of n){let i=_a(t),r=Pi(t)}};typeof window<"u"&&(window.debugSkyLight=wa);function u5(n,t){return(n%t+t)%t}var wt=class wt{constructor(t,e,i){this.resourcesManager=t;this.displayOptions=e;this.initOptions=i;u(this,"worldReadyResolvers",Promise.withResolvers());u(this,"worldReadyPromise",this.worldReadyResolvers.promise);u(this,"timeOfTheDay",0);u(this,"worldSizeParams",{minY:0,worldHeight:256});u(this,"reactiveDebugParams",Aa({stopRendering:!1,chunksRenderAboveOverride:void 0,chunksRenderAboveEnabled:!1,chunksRenderBelowOverride:void 0,chunksRenderBelowEnabled:!1,chunksRenderDistanceOverride:void 0,chunksRenderDistanceEnabled:!1,disableEntities:!1}));u(this,"active",!1);u(this,"loadedChunks",{});u(this,"finishedChunks",{});u(this,"finishedSections",{});u(this,"sectionsWaiting",new Map);u(this,"queuedChunks",new Set);u(this,"queuedFunctions",[]);u(this,"renderUpdateEmitter",new Kt);u(this,"customTexturesDataUrl");u(this,"workers",[]);u(this,"viewerChunkPosition");u(this,"lastViewerChunkGridX");u(this,"lastViewerChunkGridZ");u(this,"lastCamUpdate",0);u(this,"droppedFpsPercentage",0);u(this,"initialChunkLoadWasStartedIn");u(this,"initialChunksLoad",!0);u(this,"enableChunksLoadDelay",!1);u(this,"texturesVersion");u(this,"viewDistance",-1);u(this,"onRenderDistanceChanged");u(this,"chunksLength",0);u(this,"allChunksFinished",!1);u(this,"messageQueue",[]);u(this,"isProcessingQueue",!1);u(this,"ONMESSAGE_TIME_LIMIT",30);u(this,"handleResize",()=>{});u(this,"highestBlocksByChunks",new Map);u(this,"blockEntities",{});u(this,"workersProcessAverageTime",0);u(this,"workersProcessAverageTimeCount",0);u(this,"maxWorkersProcessTime",0);u(this,"workersPreAverageTime",0);u(this,"workersWasmAverageTime",0);u(this,"workersPostAverageTime",0);u(this,"workersPhaseSampleCount",0);u(this,"workersPreTargetConvertAverageTime",0);u(this,"workersPreNeighborConvertAverageTime",0);u(this,"workersPreNeighborCountAverage",0);u(this,"workersPreTypedArrayBuildAverageTime",0);u(this,"workersPreOtherAverageTime",0);u(this,"workersPreCacheHitsTotal",0);u(this,"workersPreCacheMissesTotal",0);u(this,"geometryReceiveCount",{});u(this,"allLoadedIn");u(this,"onWorldSwitched",[]);u(this,"renderTimeMax",0);u(this,"renderTimeAvg",0);u(this,"renderTimeAvgCount",0);u(this,"edgeChunks",{});u(this,"lastAddChunk",null);u(this,"neighborChunkUpdates",!0);u(this,"lastChunkDistance",0);u(this,"debugStopGeometryUpdate",!1);u(this,"protocolCustomBlocks",new Map);u(this,"heightmapDebounceTimers",new Map);u(this,"sectionDirtyCount",new Map);u(this,"sectionDirtyTimers",new Map);u(this,"sectionDirtyPendingArgs",new Map);u(this,"blockStateModelInfo",new Map);u(this,"worldBlockProvider");u(this,"soundSystem");u(this,"worldRendererConfig");u(this,"playerStateReactive");u(this,"playerStateUtils");u(this,"reactiveState");u(this,"mesherLogReader");u(this,"forceCallFromMesherReplayer",!1);u(this,"stopMesherMessagesProcessing",!1);u(this,"abortController",new AbortController);u(this,"lastRendered",0);u(this,"renderingActive",!0);u(this,"geometryReceiveCountPerSec",0);u(this,"mesherLogger",{contents:[],active:new URL(location.href).searchParams.get("mesherlog")==="true"});u(this,"currentRenderedFrames",0);u(this,"fpsAverage",0);u(this,"lastFps",0);u(this,"fpsWorst");u(this,"fpsSamples",0);u(this,"backendInfoReport","-");u(this,"chunksFullInfo","-");u(this,"workerCustomHandleTime",0);u(this,"queueAwaited",!1);u(this,"toWorkerMessagesQueue",{});this.snapshotInitialValues(),this.worldRendererConfig=e.inWorldRenderingConfig,this.playerStateReactive=e.playerStateReactive,this.playerStateUtils=w2(this.playerStateReactive),this.reactiveState=e.rendererState,this.renderUpdateEmitter.on("update",()=>{let o=Object.keys(this.finishedChunks).length;Bi("loaded-chunks",`${o}/${this.chunksLength} chunks (${this.lastChunkDistance}/${this.viewDistance})`)}),Ee("downloaded-chunks",100,140,20,{className:c5}),this.connect(this.displayOptions.worldView);let r=setInterval(()=>{this.geometryReceiveCountPerSec=Object.values(this.geometryReceiveCount).reduce((o,a)=>o+a,0),this.geometryReceiveCount={},i3(this.displayAdvancedStats),this.updateChunksStats()},500),s=setInterval(()=>{this.fpsUpdate()},1e3);this.abortController.signal.addEventListener("abort",()=>{clearInterval(r),clearInterval(s)})}anyModuleRequiresHeightmap(){return!1}get version(){return this.displayOptions.version}get displayAdvancedStats(){return(this.initOptions.config.statsVisible??0)>1}fpsUpdate(){this.fpsSamples++,this.fpsAverage=(this.fpsAverage*(this.fpsSamples-1)+this.currentRenderedFrames)/this.fpsSamples,this.fpsWorst===void 0?this.fpsWorst=this.currentRenderedFrames:this.fpsWorst=Math.min(this.fpsWorst,this.currentRenderedFrames),this.lastFps=this.currentRenderedFrames,this.displayOptions.nonReactiveState.fps=this.currentRenderedFrames,this.displayOptions.nonReactiveState.worstRenderTime=this.renderTimeMax,this.displayOptions.nonReactiveState.avgRenderTime=this.renderTimeAvg,this.currentRenderedFrames=0}logWorkerWork(t){this.mesherLogger.active&&this.mesherLogger.contents.push(typeof t=="function"?t():t)}async init(){if(this.active)throw new Error("WorldRendererCommon is already initialized");await Promise.all([this.resetWorkers(),(async()=>{this.resourcesManager.currentResources?.allReady&&await this.updateAssetsData()})()]),this.resourcesManager.on("assetsTexturesUpdated",async()=>{this.active&&await this.updateAssetsData()}),this.watchReactivePlayerState(),this.watchReactiveConfig(),this.worldReadyResolvers.resolve()}snapshotInitialValues(){}wasChunkSentToWorker(t){return this.loadedChunks[t]}async getHighestBlocks(t){return this.highestBlocksByChunks.get(t)}updateCustomBlock(t,e,i){if(this.protocolCustomBlocks.set(t,{...this.protocolCustomBlocks.get(t),[e]:i}),this.logWorkerWork(()=>`-> updateCustomBlock ${t} ${e} ${i} ${this.wasChunkSentToWorker(t)}`),this.wasChunkSentToWorker(t)){let[r,s,o]=e.split(",").map(Number);this.setBlockStateId(new d5(r,s,o),void 0)}}async getBlockInfo(t,e){let r=`${Math.floor(t.x/16)*16},${Math.floor(t.z/16)*16}`,s=this.protocolCustomBlocks.get(r)?.[`${t.x},${t.y},${t.z}`],o=V2(e,s),a=this.blockStateModelInfo.get(o);return{customBlockName:s,modelInfo:a}}initWorkers(t=this.worldRendererConfig.mesherWorkers){for(let e=0;e<t+0;e++){let i=xa(r=>{Array.isArray(r)?this.messageQueue.push(...r):this.messageQueue.push(r),this.processMessageQueue("worker")},this.worldRendererConfig.wasmMesher?"mesherWasm.js":"mesher.js");this.workers.push(i)}}onReactivePlayerStateUpdated(t,e,i=!0){return i&&e(this.playerStateReactive[t]),Ii(this.playerStateReactive,t,e)}onReactiveConfigUpdated(t,e){e(this.worldRendererConfig[t]),t==="*"?Ea(this.worldRendererConfig,e):Ii(this.worldRendererConfig,t,e)}onReactiveDebugUpdated(t,e){e(this.reactiveDebugParams[t]),Ii(this.reactiveDebugParams,t,e)}watchReactivePlayerState(){this.onReactivePlayerStateUpdated("backgroundColor",t=>{this.changeBackgroundColor(t)}),this.onReactivePlayerStateUpdated("cardinalLight",t=>{this.changeCardinalLight(t)})}watchReactiveConfig(){this.onReactiveConfigUpdated("fetchPlayerSkins",t=>{t1({apiEnabled:t})})}async processMessageQueue(t){if(this.isProcessingQueue||this.messageQueue.length===0)return;if(this.logWorkerWork(`# ${t} processing queue`),this.lastRendered&&performance.now()-this.lastRendered>this.ONMESSAGE_TIME_LIMIT&&this.worldRendererConfig._experimentalSmoothChunkLoading&&this.renderingActive){let r=performance.now();await new Promise(s=>{requestAnimationFrame(s)}),this.logWorkerWork(`# processing got delayed by ${performance.now()-r}ms`)}this.isProcessingQueue=!0;let e=performance.now(),i=0;for(;this.messageQueue.length>0;){let r=this.stopMesherMessagesProcessing;if(!r){let s=this.messageQueue.shift();this.handleMessage(s),i++}if(r||performance.now()-e>this.ONMESSAGE_TIME_LIMIT&&this.renderingActive&&this.worldRendererConfig._experimentalSmoothChunkLoading){if(this.messageQueue.length>0){requestAnimationFrame(async()=>{this.isProcessingQueue=!1,this.processMessageQueue("queue-delay")});return}break}}this.isProcessingQueue=!1}handleMessage(t){var i,r;let e=t;if(this.active){if(this.mesherLogReader?.workerMessageReceived(e.type,e),e.type!=="geometry"||!this.debugStopGeometryUpdate){let s=performance.now();this.handleWorkerMessage(e),this.workerCustomHandleTime+=performance.now()-s}if(e.type==="geometry"){this.logWorkerWork(()=>`-> ${e.workerIndex} geometry ${e.key} ${JSON.stringify({dataSize:JSON.stringify(e).length})}`),(i=this.geometryReceiveCount)[r=e.workerIndex]??(i[r]=0),this.geometryReceiveCount[e.workerIndex]++;let s=e.key.split(",").map(Number);this.lastChunkDistance=Math.max(...this.getDistance(new d5(s[0],0,s[2])))}if(e.type==="sectionFinished"){if(this.logWorkerWork(`<- ${e.workerIndex} sectionFinished ${e.key} ${JSON.stringify({processTime:e.processTime})}`),!this.sectionsWaiting.has(e.key))throw new Error(`sectionFinished event for non-outstanding section ${e.key}`);this.sectionsWaiting.set(e.key,this.sectionsWaiting.get(e.key)-1),this.sectionsWaiting.get(e.key)===0&&(this.sectionsWaiting.delete(e.key),this.finishedSections[e.key]=!0);let s=e.key.split(",").map(Number),o=`${s[0]},${s[2]}`;if(this.loadedChunks[o]){let a=!0,v=this.getSectionHeight();for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=v)if(!this.finishedSections[`${s[0]},${l},${s[2]}`]){a=!1;break}if(a){this.finishedChunks[o]=!0;let l=16;this.reactiveState.world.chunksLoaded.add(`${Math.floor(s[0]/l)},${Math.floor(s[2]/l)}`),this.renderUpdateEmitter.emit("chunkFinished",`${s[0]},${s[2]}`),this.checkAllFinished()}}if(this.renderUpdateEmitter.emit("update"),e.processTime&&(this.workersProcessAverageTimeCount++,this.workersProcessAverageTime=(this.workersProcessAverageTime*(this.workersProcessAverageTimeCount-1)+e.processTime)/this.workersProcessAverageTimeCount,this.maxWorkersProcessTime=Math.max(this.maxWorkersProcessTime,e.processTime)),typeof e.pre=="number"&&typeof e.wasm=="number"&&typeof e.post=="number"&&(e.pre>0||e.wasm>0||e.post>0)){let a=++this.workersPhaseSampleCount;this.workersPreAverageTime=(this.workersPreAverageTime*(a-1)+e.pre)/a,this.workersWasmAverageTime=(this.workersWasmAverageTime*(a-1)+e.wasm)/a,this.workersPostAverageTime=(this.workersPostAverageTime*(a-1)+e.post)/a;let v=typeof e.preTargetConvert=="number"?e.preTargetConvert:0,l=typeof e.preNeighborConvert=="number"?e.preNeighborConvert:0,c=typeof e.preNeighborCount=="number"?e.preNeighborCount:0,d=typeof e.preTypedArrayBuild=="number"?e.preTypedArrayBuild:0,f=typeof e.preOther=="number"?e.preOther:0,m=typeof e.preCacheHits=="number"?e.preCacheHits:0,g=typeof e.preCacheMisses=="number"?e.preCacheMisses:0;if(this.workersPreTargetConvertAverageTime=(this.workersPreTargetConvertAverageTime*(a-1)+v)/a,this.workersPreNeighborConvertAverageTime=(this.workersPreNeighborConvertAverageTime*(a-1)+l)/a,this.workersPreNeighborCountAverage=(this.workersPreNeighborCountAverage*(a-1)+c)/a,this.workersPreTypedArrayBuildAverageTime=(this.workersPreTypedArrayBuildAverageTime*(a-1)+d)/a,this.workersPreOtherAverageTime=(this.workersPreOtherAverageTime*(a-1)+f)/a,this.workersPreCacheHitsTotal+=m,this.workersPreCacheMissesTotal+=g,this.worldRendererConfig.debugWasmPerf&&a%wt.PHASE_PERF_LOG_INTERVAL===0){let b=this.workersPreAverageTime+this.workersWasmAverageTime+this.workersPostAverageTime,A=b>0?this.workersPreAverageTime/b*100:0,_=b>0?this.workersWasmAverageTime/b*100:0,w=b>0?this.workersPostAverageTime/b*100:0,T=this.workersPreAverageTime,S=T>0?this.workersPreTargetConvertAverageTime/T*100:0,C=T>0?this.workersPreNeighborConvertAverageTime/T*100:0,H=T>0?this.workersPreTypedArrayBuildAverageTime/T*100:0,P=T>0?this.workersPreOtherAverageTime/T*100:0,I=this.workersPreNeighborCountAverage,N=I>0?this.workersPreNeighborConvertAverageTime/I:0,O=this.workersPreCacheHitsTotal+this.workersPreCacheMissesTotal,j=O>0?this.workersPreCacheHitsTotal/O*100:0}}}if(e.type==="blockStateModelInfo")for(let[s,o]of Object.entries(e.info))this.blockStateModelInfo.set(s,o);e.type==="heightmap"&&this.reactiveState.world.heightmaps.set(e.key,new Int16Array(e.heightmap))}}downloadMesherLog(){let t=document.createElement("a");t.href="data:text/plain;charset=utf-8,"+encodeURIComponent(this.mesherLogger.contents.join(`
|
|
16
|
+
`)),t.download="mesher.log",t.click()}checkAllFinished(){this.sectionsWaiting.size===0&&(this.reactiveState.world.mesherWork=!1),Object.keys(this.finishedChunks).length>=this.chunksLength&&(this.allChunksLoaded?.(),this.allChunksFinished=!0,this.allLoadedIn??(this.allLoadedIn=Date.now()-this.initialChunkLoadWasStartedIn)),this.updateChunksStats()}changeHandSwingingState(t,e){}updateViewerPosition(t){this.viewerChunkPosition=t;for(let[r,s]of Object.entries(this.loadedChunks))s&&this.updatePosDataChunk?.(r);let e=Math.floor(t.x/16),i=Math.floor(t.z/16);(e!==this.lastViewerChunkGridX||i!==this.lastViewerChunkGridZ)&&(this.lastViewerChunkGridX=e,this.lastViewerChunkGridZ=i,this.onViewerChunkPositionChanged())}onViewerChunkPositionChanged(){}sendWorkers(t){for(let e of this.workers)e.postMessage(t)}getDistance(t){let[e,i]=_e(this.viewerChunkPosition),r=16,s=Math.abs(e-Math.floor(t.x/r)),o=Math.abs(i-Math.floor(t.z/r));return[s,o]}resetWorld(){for(let t of this.workers)t.terminate();this.workers=[]}async resetWorkers(){this.resetWorld(),typeof document<"u"&&document?.readyState==="loading"&&await new Promise(t=>{document.addEventListener("DOMContentLoaded",t)}),this.initWorkers(),this.active=!0,this.sendMesherMcData()}getMesherConfig(){let t=this.timeOfTheDay,e=t<0||t>24e3?15:Pi(t);return{version:this.version,enableLighting:this.worldRendererConfig.enableLighting,skyLight:e,smoothLighting:this.worldRendererConfig.smoothLighting,shadingTheme:this.worldRendererConfig.shadingTheme,cardinalLight:this.worldRendererConfig.cardinalLight,outputFormat:this.outputFormat,debugModelVariant:this.worldRendererConfig.debugModelVariant,clipWorldBelowY:this.worldRendererConfig.clipWorldBelowY,disableBlockEntityTextures:!this.worldRendererConfig.extraBlockRenderers,worldMinY:this.worldMinYRender,worldMaxY:this.worldMinYRender+this.worldSizeParams.worldHeight,disableConversionCache:this.worldRendererConfig.disableMesherConversionCache,computeWireframeEdges:this.worldRendererConfig.futuristicReveal===!0}}sendMesherMcData(){let t=this.resourcesManager.currentResources.mcData;Hi(this.workers,this.version,s5,t),this.logWorkerWork("# mcData sent")}async updateAssetsData(){let t=this.resourcesManager.currentResources;if(this.workers.length===0)throw new Error("workers not initialized yet");for(let[e,i]of this.workers.entries()){let{blockstatesModels:r}=t;i.postMessage({type:"mesherData",workerIndex:e,blocksAtlas:{latest:t.blocksAtlasJson},blockstatesModels:r,config:this.getMesherConfig()})}this.logWorkerWork("# mesherData sent")}getSectionHeight(){return W2}get worldMinYRender(){let t=this.getSectionHeight();return Math.floor(Math.max(this.worldSizeParams.minY,this.worldRendererConfig.clipWorldBelowY??-1/0)/t)*t}updateChunksStats(){let t=Object.keys(this.finishedChunks);this.displayOptions.nonReactiveState.world.chunksLoaded=new Set(t),this.displayOptions.nonReactiveState.world.chunksTotalNumber=this.chunksLength,this.reactiveState.world.allChunksLoaded=this.allChunksFinished;let e=`Q: ${this.messageQueue.length} ${Object.keys(this.loadedChunks).length}/${Object.keys(this.finishedChunks).length}/${this.chunksLength} chunks (${this.workers.length}:${this.workersProcessAverageTime.toFixed(0)}ms/${this.geometryReceiveCountPerSec}ss/${this.allLoadedIn?.toFixed(1)??"-"}s)`;this.chunksFullInfo=e,Bi("downloaded-chunks",e)}addColumn(t,e,i,r){if(!this.active)return;if(this.workers.length===0)throw new Error("workers not initialized yet");this.initialChunksLoad=!1,this.initialChunkLoadWasStartedIn??(this.initialChunkLoadWasStartedIn=Date.now()),this.loadedChunks[`${t},${e}`]=!0,this.updateChunksStats();let s=`${t},${e}`,o=this.protocolCustomBlocks.get(s);for(let l of this.workers)l.postMessage({type:"chunk",x:t,z:e,chunk:i,customBlockModels:o||void 0});this.worldRendererConfig.wasmMesher||this.workers[0].postMessage({type:"getHeightmap",x:t,z:e}),this.logWorkerWork(()=>`-> chunk ${JSON.stringify({x:t,z:e,chunkLength:i.length,customBlockModelsLength:o?Object.keys(o).length:0})}`),this.mesherLogReader?.chunkReceived(t,e,i.length);let a=this.getSectionHeight(),v=16;for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=a){let c=new d5(t,l,e);this.setSectionDirty(c),this.neighborChunkUpdates&&(!r||this.worldRendererConfig.smoothLighting)&&(this.setSectionDirty(c.offset(-v,0,0)),this.setSectionDirty(c.offset(v,0,0)),this.setSectionDirty(c.offset(0,0,-v)),this.setSectionDirty(c.offset(0,0,v)))}}markAsLoaded(t,e){this.loadedChunks[`${t},${e}`]=!0,this.finishedChunks[`${t},${e}`]=!0,this.logWorkerWork(`-> markAsLoaded ${JSON.stringify({x:t,z:e})}`),this.renderUpdateEmitter.emit("chunkFinished",`${t},${e}`),this.checkAllFinished()}removeColumn(t,e){delete this.loadedChunks[`${t},${e}`];let i=`${t},${e}`,r=this.heightmapDebounceTimers.get(i);r&&(clearTimeout(r),this.heightmapDebounceTimers.delete(i));for(let[o,a]of this.sectionDirtyTimers)o.startsWith(`${t},`)&&o.endsWith(`,${e}`)&&(clearTimeout(a),this.sectionDirtyTimers.delete(o),this.sectionDirtyCount.delete(o),this.sectionDirtyPendingArgs.delete(o));for(let o of this.workers)o.postMessage({type:"unloadChunk",x:t,z:e});this.logWorkerWork(`-> unloadChunk ${JSON.stringify({x:t,z:e})}`),delete this.finishedChunks[`${t},${e}`],this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,Object.keys(this.finishedChunks).length===0&&(this.allLoadedIn=void 0,this.initialChunkLoadWasStartedIn=void 0);let s=this.getSectionHeight();for(let o=this.worldSizeParams.minY;o<this.worldSizeParams.worldHeight;o+=s)this.setSectionDirty(new d5(t,o,e),!1),delete this.finishedSections[`${t},${o},${e}`];this.highestBlocksByChunks.delete(`${t},${e}`),this.reactiveState.world.heightmaps.delete(`${Math.floor(t/16)},${Math.floor(e/16)}`),this.updateChunksStats(),Object.keys(this.loadedChunks).length===0&&(this.mesherLogger.contents=[],this.logWorkerWork("# all chunks unloaded. New log started"),this.mesherLogReader?.maybeStartReplay())}setBlockStateId(t,e,i=!0){(async()=>{let o=Math.floor(t.x/16)*16,a=Math.floor(t.z/16)*16;this.queuedChunks.has(`${o},${a}`)&&await new Promise(v=>{this.queuedFunctions.push(()=>{v()})}),this.loadedChunks[`${o},${a}`],this.setBlockStateIdInner(t,e,i)})()}updateEntity(t,e=!1){}lightUpdate(t,e){}connect(t){let e=t;e.on("entity",r=>{this.updateEntity(r,!1)}),e.on("entityMoved",r=>{this.updateEntity(r,!0)}),e.on("playerEntity",r=>{this.updatePlayerEntity?.(r)});let i=null;e.on("loadChunk",({x:r,z:s,chunk:o,worldConfig:a,isLightUpdate:v})=>{this.worldSizeParams=a,this.queuedChunks.add(`${r},${s}`);let l=[r,s,o,v];i||(i={data:[],timeout:setTimeout(()=>{for(let c of i.data)this.queuedChunks.delete(`${c[0]},${c[1]}`),this.addColumn(...c);for(let c of this.queuedFunctions)c();this.queuedFunctions=[],i=null},this.worldRendererConfig.addChunksBatchWaitTime)}),i.data.push(l)}),e.on("blockEntities",r=>{this.blockEntities=r}),e.on("unloadChunk",({x:r,z:s})=>{this.removeColumn(r,s)}),e.on("blockUpdate",({pos:r,stateId:s})=>{this.setBlockStateId(new d5(r.x,r.y,r.z),s)}),e.on("chunkPosUpdate",({pos:r})=>{this.updateViewerPosition(r)}),e.on("end",()=>{this.worldStop?.()}),e.on("renderDistance",r=>{this.viewDistance=r,this.chunksLength=r===0?1:Xe(r).length,this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,this.onRenderDistanceChanged?.(r)}),e.on("markAsLoaded",({x:r,z:s})=>{this.markAsLoaded(r,s)}),e.on("updateLight",({pos:r})=>{this.lightUpdate(r.x,r.z)}),e.on("onWorldSwitch",()=>{for(let r of this.onWorldSwitched)try{r()}catch(s){setTimeout(()=>{throw s},0)}}),e.on("time",r=>{this.worldRendererConfig.dayCycle&&(this.timeUpdated?.(r),this.timeOfTheDay=r)}),e.on("biomeUpdate",({biome:r})=>{this.biomeUpdated?.(r)}),e.on("biomeReset",()=>{this.biomeReset?.()})}setBlockStateIdInner(t,e,i=!0){let s=`${Math.floor(t.x/16)*16},${Math.floor(t.z/16)*16}`,o=`${t.x},${t.y},${t.z}`,a=this.protocolCustomBlocks.get(s)||{};for(let v of this.workers)v.postMessage({type:"blockUpdate",pos:t,stateId:e,customBlockModels:a});if(this.anyModuleRequiresHeightmap()){let v=Math.floor(t.x/16)*16,l=Math.floor(t.z/16)*16,c=`${v},${l}`;if(!this.worldRendererConfig.wasmMesher){let d=this.heightmapDebounceTimers.get(c);d&&clearTimeout(d),this.heightmapDebounceTimers.set(c,setTimeout(()=>{this.heightmapDebounceTimers.delete(c),this.workers[0]?.postMessage({type:"getHeightmap",x:v,z:l})},100))}}if(this.logWorkerWork(`-> blockUpdate ${JSON.stringify({pos:t,stateId:e,customBlockModels:a})}`),this.setSectionDirty(t,!0,!0),this.neighborChunkUpdates){let l=this.getSectionHeight();t.x&15||this.setSectionDirty(t.offset(-16,0,0),!0,!0),(t.x&15)===15&&this.setSectionDirty(t.offset(16,0,0),!0,!0),t.y&l-1||this.setSectionDirty(t.offset(0,-l,0),!0,!0),(t.y&l-1)===l-1&&this.setSectionDirty(t.offset(0,l,0),!0,!0),t.z&15||this.setSectionDirty(t.offset(0,0,-16),!0,!0),(t.z&15)===15&&this.setSectionDirty(t.offset(0,0,16),!0,!0),i&&(!(t.x&15)&&!(t.z&15)&&this.setSectionDirty(t.offset(-16,0,-16),!0,!0),(t.x&15)===15&&!(t.z&15)&&this.setSectionDirty(t.offset(16,0,-16),!0,!0),!(t.x&15)&&(t.z&15)===15&&this.setSectionDirty(t.offset(-16,0,16),!0,!0),(t.x&15)===15&&(t.z&15)===15&&this.setSectionDirty(t.offset(16,0,16),!0,!0),!(t.x&15)&&!(t.y&l-1)&&this.setSectionDirty(t.offset(-16,-l,0),!0,!0),(t.x&15)===15&&!(t.y&l-1)&&this.setSectionDirty(t.offset(16,-l,0),!0,!0),!(t.z&15)&&!(t.y&l-1)&&this.setSectionDirty(t.offset(0,-l,-16),!0,!0),(t.z&15)===15&&!(t.y&l-1)&&this.setSectionDirty(t.offset(0,-l,16),!0,!0),!(t.y&l-1)&&!(t.x&15)&&!(t.z&15)&&this.setSectionDirty(t.offset(-16,-l,-16),!0,!0),!(t.y&l-1)&&(t.x&15)===15&&!(t.z&15)&&this.setSectionDirty(t.offset(16,-l,-16),!0,!0),!(t.y&l-1)&&!(t.x&15)&&(t.z&15)===15&&this.setSectionDirty(t.offset(-16,-l,16),!0,!0),!(t.y&l-1)&&(t.x&15)===15&&(t.z&15)===15&&this.setSectionDirty(t.offset(16,-l,16),!0,!0))}}getWorkerNumber(t,e=!1){let r=this.getSectionHeight();if(this.worldRendererConfig.dedicatedChangeWorker&&this.workers.length>1){if(this.worldRendererConfig.wasmMesher)return u5(Math.floor(t.x/16)+Math.floor(t.z/16),this.workers.length);if(e){let a=`${Math.floor(t.x/16)*16},${Math.floor(t.y/r)*r},${Math.floor(t.z/16)*16}`;if(this.sectionsWaiting.get(a)&&!this.finishedSections[a]){let l=this.workers.length-1;return u5(Math.floor(t.x/16)+Math.floor(t.y/r)+Math.floor(t.z/16),l)}return this.workers.length-1}let o=this.workers.length-1;return u5(Math.floor(t.x/16)+Math.floor(t.y/r)+Math.floor(t.z/16),o)}if(this.worldRendererConfig.wasmMesher)return u5(Math.floor(t.x/16)+Math.floor(t.z/16),this.workers.length);if(e){let o=`${Math.floor(t.x/16)*16},${Math.floor(t.y/r)*r},${Math.floor(t.z/16)*16}`;if(!(this.sectionsWaiting.get(o)&&!this.finishedSections[o]))return 0}return u5(Math.floor(t.x/16)+Math.floor(t.y/r)+Math.floor(t.z/16),this.workers.length)}async debugGetWorkerCustomBlockModel(t){let e=[];for(let i of this.workers)e.push(new Promise(r=>{i.addEventListener("message",s=>{s.data.type==="customBlockModel"&&r(s.data.customBlockModel)})})),i.postMessage({type:"getCustomBlockModel",pos:t});return Promise.all(e)}setSectionDirty(t,e=!0,i=!1){if(!this.forceCallFromMesherReplayer&&this.mesherLogReader)return;if(this.viewDistance===-1)throw new Error("viewDistance not set");let r=this.getDistance(t);if(!this.workers.length||r[0]>this.viewDistance||r[1]>this.viewDistance)return;if(!e){this._dispatchDirtyImmediate(t,e,i);return}let s=16,o=this.getSectionHeight(),a=`${Math.floor(t.x/s)*s},${Math.floor(t.y/o)*o},${Math.floor(t.z/s)*s}`,v=(this.sectionDirtyCount.get(a)??0)+1;this.sectionDirtyCount.set(a,v),v<=wt.GEOMETRY_THROTTLE_THRESHOLD?(this._dispatchDirtyImmediate(t,e,i),this.sectionDirtyTimers.has(a)||this.sectionDirtyTimers.set(a,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(a);this.sectionDirtyCount.delete(a),this.sectionDirtyTimers.delete(a),this.sectionDirtyPendingArgs.delete(a),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},wt.GEOMETRY_THROTTLE_DELAY))):(this.sectionDirtyPendingArgs.set(a,{pos:t,value:e,useChangeWorker:i}),this.sectionDirtyTimers.has(a)||this.sectionDirtyTimers.set(a,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(a);this.sectionDirtyCount.delete(a),this.sectionDirtyTimers.delete(a),this.sectionDirtyPendingArgs.delete(a),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},wt.GEOMETRY_THROTTLE_DELAY)))}_dispatchDirtyImmediate(t,e,i){var v;this.reactiveState.world.mesherWork=!0;let r=16,s=this.getSectionHeight(),o=`${Math.floor(t.x/r)*r},${Math.floor(t.y/s)*s},${Math.floor(t.z/r)*r}`;this.renderUpdateEmitter.emit("dirty",t,e);let a=this.getWorkerNumber(t,i&&(this.mesherLogger.active||this.worldRendererConfig.dedicatedChangeWorker));this.sectionsWaiting.set(o,(this.sectionsWaiting.get(o)??0)+1),this.forceCallFromMesherReplayer?this.workers[a].postMessage({type:"dirty",x:t.x,y:t.y,z:t.z,value:e,config:this.getMesherConfig()}):((v=this.toWorkerMessagesQueue)[a]??(v[a]=[]),this.toWorkerMessagesQueue[a].push({type:"dirty",x:t.x,y:t.y,z:t.z,value:e,config:this.getMesherConfig()}),this.dispatchMessages())}dispatchMessages(){this.queueAwaited||(this.queueAwaited=!0,setTimeout(()=>{for(let t in this.toWorkerMessagesQueue){let e=this.workers[Number(t)],i=this.toWorkerMessagesQueue[t];e.postMessage(i);for(let r of i)this.logWorkerWork(`-> ${t} dispatchMessages ${r.type} ${JSON.stringify({x:r.x,y:r.y,z:r.z,value:r.value})}`)}this.toWorkerMessagesQueue={},this.queueAwaited=!1}))}async waitForChunksToRender(){return new Promise((t,e)=>{if([...this.sectionsWaiting].length===0){t();return}let i=()=>{this.sectionsWaiting.size===0&&(this.renderUpdateEmitter.removeListener("update",i),t())};this.renderUpdateEmitter.on("update",i)})}async waitForChunkToLoad(t){return new Promise((e,i)=>{let s=`${Math.floor(t.x/16)*16},${Math.floor(t.z/16)*16}`;if(this.loadedChunks[s]){e();return}let o=()=>{this.loadedChunks[s]&&(this.renderUpdateEmitter.removeListener("update",o),e())};this.renderUpdateEmitter.on("update",o)})}destroy(){for(let t of this.heightmapDebounceTimers.values())clearTimeout(t);this.heightmapDebounceTimers.clear();for(let t of this.sectionDirtyTimers.values())clearTimeout(t);this.sectionDirtyTimers.clear(),this.sectionDirtyCount.clear(),this.sectionDirtyPendingArgs.clear();for(let t of this.workers)t.terminate();this.workers=[],this.soundSystem&&(this.soundSystem.destroy(),this.soundSystem=void 0),this.active=!1,this.loadedChunks={},this.finishedChunks={},this.finishedSections={},this.sectionsWaiting.clear(),this.queuedChunks.clear(),this.blockStateModelInfo.clear(),this.renderUpdateEmitter.removeAllListeners(),this.abortController.abort(),r3()}};u(wt,"PHASE_PERF_LOG_INTERVAL",64),u(wt,"GEOMETRY_THROTTLE_THRESHOLD",1),u(wt,"GEOMETRY_THROTTLE_DELAY",100);var h1=wt,xa=(n,t="mesher.js")=>{let e;if(D.env.SINGLE_FILE_BUILD){let i=document.getElementById("mesher-worker-code").textContent,r=new Blob([i],{type:"text/javascript"});e=new Worker(window.URL.createObjectURL(r))}else e=new Worker(t);return e.onmessage=({data:i})=>{n(i)},e.on&&e.on("message",i=>{e.onmessage({data:i})}),e},Hi=(n,t,e=s5,i)=>{let r={version:JSON.parse(JSON.stringify(i.version))};for(let[s,o]of Object.entries(e))r[s]=i[o];for(let s of n)s.postMessage({type:"mcData",mcData:r})};x();R();M();k();import{Vec3 as Ra}from"vec3";import*as it from"three";x();R();M();k();function m1(n,t){let e=t/180*Math.PI,i=Math.cos(e),r=Math.sin(e),s={x:0,y:1,z:2}[n],o=(s+1)%3,a=(s+2)%3,v=[[0,0,0],[0,0,0],[0,0,0]];return v[s][s]=1,v[o][o]=i,v[o][a]=-r,v[a][o]=+r,v[a][a]=i,v}function Oi(n,t){return t?[n[0]+t[0],n[1]+t[1],n[2]+t[2]]:n}function zi(n,t){return t?[n[0]-t[0],n[1]-t[1],n[2]-t[2]]:n}function xe(n,t){return n?[n[0][0]*t[0]+n[0][1]*t[1]+n[0][2]*t[2],n[1][0]*t[0]+n[1][1]*t[1]+n[1][2]*t[2],n[2][0]*t[0]+n[2][1]*t[1]+n[2][2]*t[2]]:t}function n3(n,t){let e=[[0,0,0],[0,0,0],[0,0,0]],i=n[0][0],r=n[1][0],s=n[2][0],o=n[0][1],a=n[1][1],v=n[2][1],l=n[0][2],c=n[1][2],d=n[2][2],f=t[0][0],m=t[1][0],g=t[2][0],b=t[0][1],A=t[1][1],_=t[2][1],w=t[0][2],T=t[1][2],S=t[2][2];return e[0][0]=i*f+r*b+s*w,e[1][0]=i*m+r*A+s*T,e[2][0]=i*g+r*_+s*S,e[0][1]=o*f+a*b+v*w,e[1][1]=o*m+a*A+v*T,e[2][1]=o*g+a*_+v*S,e[0][2]=l*f+c*b+d*w,e[1][2]=l*m+c*A+d*T,e[2][2]=l*g+c*_+d*S,e}var Di={up:{dir:[0,1,0],mask1:[1,1,0],mask2:[0,1,1],corners:[[0,1,1,0,1],[1,1,1,1,1],[0,1,0,0,0],[1,1,0,1,0]]},down:{dir:[0,-1,0],mask1:[1,1,0],mask2:[0,1,1],corners:[[1,0,1,0,1],[0,0,1,1,1],[1,0,0,0,0],[0,0,0,1,0]]},east:{dir:[1,0,0],mask1:[1,1,0],mask2:[1,0,1],corners:[[1,1,1,0,0],[1,0,1,0,1],[1,1,0,1,0],[1,0,0,1,1]]},west:{dir:[-1,0,0],mask1:[1,1,0],mask2:[1,0,1],corners:[[0,1,0,0,0],[0,0,0,0,1],[0,1,1,1,0],[0,0,1,1,1]]},north:{dir:[0,0,-1],mask1:[1,0,1],mask2:[0,1,1],corners:[[1,0,0,1,1],[0,0,0,0,1],[1,1,0,1,0],[0,1,0,0,0]]},south:{dir:[0,0,1],mask1:[1,0,1],mask2:[0,1,1],corners:[[0,0,1,0,1],[1,0,1,1,1],[0,1,1,0,0],[1,1,1,1,0]]}};function ka(n,t,e,i,r,s,o,a){let v=new Ra(0,0,0);for(let l in n.faces){let c=n.faces[l],{corners:d,mask1:f,mask2:m}=Di[l],g=xe(i,Di[l].dir);if(c.cullface&&a[l])continue;let b=n.from[0],A=n.from[1],_=n.from[2],w=n.to[0],T=n.to[1],S=n.to[2],C=c.texture,{u:H}=C,{v:P}=C,{su:I}=C,{sv:N}=C,O=Math.floor(e.positions.length/3),j=[1,1,1];c.tintindex!==void 0&&c.tintindex===0&&(j=[.5686274509803921,.7411764705882353,.34901960784313724]);let q=c.rotation||0,$=Math.cos(q*Math.PI/180),e0=-Math.sin(q*Math.PI/180),d0=null,l0=null;n.rotation&&(d0=m1(n.rotation.axis,n.rotation.angle),l0=zi(n.rotation.origin,xe(d0,n.rotation.origin)));let m0=[],p0=1;for(let w0 of d){let n0=[w0[0]?w:b,w0[1]?T:A,w0[2]?S:_];n0=Oi(xe(d0,n0),l0),n0=Oi(xe(i,n0),r),n0=n0.map(L0=>L0/16),e.positions.push(n0[0],n0[1],n0[2]),e.normals.push(...g);let Y=(w0[3]-.5)*$-(w0[4]-.5)*e0+.5,o0=(w0[3]-.5)*e0+(w0[4]-.5)*$+.5;e.uvs.push(Y*I+H,o0*N+P);let g0=1;t&&(g0=4/4*(15/15),m0.push(3)),e.colors.push(p0*j[0]*g0,p0*j[1]*g0,p0*j[2]*g0)}t&&m0[0]+m0[3]>=m0[1]+m0[2]?e.indices.push(O,O+3,O+2,O,O+1,O+3):e.indices.push(O,O+1,O+2,O+2,O+1,O+3)}}var Ma=(n,t,e,i,r=[],s={})=>{let l={sx:.5,sy:.5,sz:.5,positions:[],normals:[],colors:[],uvs:[],t_positions:[],t_normals:[],t_colors:[],t_uvs:[],indices:[],tiles:{}};for(let[d,f]of n.entries()){let m=f[r[d]]??f[0];if(!m)continue;let g=null,b=null;for(let _ of["x","y","z"])_ in m&&(g?g=n3(g,m1(_,-(m[_]??0))):g=m1(_,-(m[_]??0)));g&&(b=[8,8,8],b=zi(b,xe(g,b)));let A=m.ao??!0;for(let _ of m.elements??[])ka(_,A,l,g,b,t,e,s)}let c=l.positions.length/3;for(let d=0;d<l.t_positions.length/12;d++)l.indices.push(c,c+1,c+2,c+2,c+1,c+3,c,c+2,c+1,c+2,c+3,c+1),c+=4;return l.positions.push(...l.t_positions),l.normals.push(...l.t_normals),l.colors.push(...l.t_colors),l.uvs.push(...l.t_uvs),delete l.t_positions,delete l.t_normals,delete l.t_colors,delete l.t_uvs,l.positions=new Float32Array(l.positions),l.normals=new Float32Array(l.normals),l.colors=new Float32Array(l.colors),l.uvs=new Float32Array(l.uvs),l},Ta=(...n)=>{let e={geometry:Ma(...n)},i=new it.BufferGeometry;return i.setAttribute("position",new it.BufferAttribute(e.geometry.positions,3)),i.setAttribute("normal",new it.BufferAttribute(e.geometry.normals,3)),i.setAttribute("color",new it.BufferAttribute(e.geometry.colors,3)),i.setAttribute("uv",new it.BufferAttribute(e.geometry.uvs,2)),i.setIndex(e.geometry.indices),i.name="block-geometry",i},Fi=(n,...t)=>{let e=Ta(...t),i=new it.Mesh(e,n);i.position.set(-.5,-.5,-.5);let r=new it.Group;return r.add(i),r.rotation.set(0,-it.MathUtils.degToRad(90),0,"ZYX"),globalThis.mesh=r,r},s3=(n,t)=>{n.position.set(t.x+.5,t.y+.5,t.z+.5)};x();R();M();k();import*as G0 from"three";x();R();M();k();import gr from"prismarine-nbt";import*as W from"three";x();R();M();k();x();R();M();k();import{BoxGeometry as V0,DoubleSide as Vi,FrontSide as a3,Group as ot,Mesh as U0,MeshStandardMaterial as f5,Vector2 as p1}from"three";function ji(n,t,e,i,r,s,o,a){let v=(P,I,N,O)=>[new p1(P/o,1-O/a),new p1(N/o,1-O/a),new p1(N/o,1-I/a),new p1(P/o,1-I/a)],l=v(t+s,e,t+i+s,e+s),c=v(t+i+s,e,t+i*2+s,e+s),d=v(t,e+s,t+s,e+s+r),f=v(t+s,e+s,t+i+s,e+s+r),m=v(t+i+s,e+s,t+i+s*2,e+r+s),g=v(t+i+s*2,e+s,t+i*2+s*2,e+r+s),b=n.attributes.uv,A=[m[3],m[2],m[0],m[1]],_=[d[3],d[2],d[0],d[1]],w=[l[3],l[2],l[0],l[1]],T=[c[0],c[1],c[3],c[2]],S=[f[3],f[2],f[0],f[1]],C=[g[3],g[2],g[0],g[1]],H=[];for(let P of[A,_,w,T,S,C])for(let I of P)H.push(I.x,I.y);b.set(new Float32Array(H)),b.needsUpdate=!0}function st(n,t,e,i,r,s){ji(n,t,e,i,r,s,64,64)}function Li(n,t,e,i,r,s){ji(n,t,e,i,r,s,64,32)}var At=class extends ot{constructor(t,e){super(),Object.defineProperty(this,"innerLayer",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"outerLayer",{enumerable:!0,configurable:!0,writable:!0,value:e}),t.name="inner",e.name="outer"}},Ui=class extends ot{constructor(){super(),Object.defineProperty(this,"head",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightArm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftArm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightLeg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftLeg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelListeners",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slim",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"layer1Material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer1MaterialBiased",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer2Material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer2MaterialBiased",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.layer1Material=new f5({side:a3}),this.layer2Material=new f5({side:Vi,transparent:!0,alphaTest:1e-5}),this.layer1MaterialBiased=this.layer1Material.clone(),this.layer1MaterialBiased.polygonOffset=!0,this.layer1MaterialBiased.polygonOffsetFactor=1,this.layer1MaterialBiased.polygonOffsetUnits=1,this.layer2MaterialBiased=this.layer2Material.clone(),this.layer2MaterialBiased.polygonOffset=!0,this.layer2MaterialBiased.polygonOffsetFactor=1,this.layer2MaterialBiased.polygonOffsetUnits=1;let t=new V0(8,8,8);st(t,0,0,8,8,8);let e=new U0(t,this.layer1Material),i=new V0(9,9,9);st(i,32,0,8,8,8);let r=new U0(i,this.layer2Material);this.head=new At(e,r),this.head.name="head",this.head.add(e,r),e.position.y=4,r.position.y=4,this.add(this.head);let s=new V0(8,12,4);st(s,16,16,8,12,4);let o=new U0(s,this.layer1Material),a=new V0(8.5,12.5,4.5);st(a,16,32,8,12,4);let v=new U0(a,this.layer2Material);this.body=new At(o,v),this.body.name="body",this.body.add(o,v),this.body.position.y=-6,this.add(this.body);let l=new V0,c=new U0(l,this.layer1MaterialBiased);this.modelListeners.push(()=>{c.scale.x=this.slim?3:4,c.scale.y=12,c.scale.z=4,st(l,40,16,this.slim?3:4,12,4)});let d=new V0,f=new U0(d,this.layer2MaterialBiased);this.modelListeners.push(()=>{f.scale.x=this.slim?3.5:4.5,f.scale.y=12.5,f.scale.z=4.5,st(d,40,32,this.slim?3:4,12,4)});let m=new ot;m.add(c,f),this.modelListeners.push(()=>{m.position.x=this.slim?-.5:-1}),m.position.y=-4,this.rightArm=new At(c,f),this.rightArm.name="rightArm",this.rightArm.add(m),this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.add(this.rightArm);let g=new V0,b=new U0(g,this.layer1MaterialBiased);this.modelListeners.push(()=>{b.scale.x=this.slim?3:4,b.scale.y=12,b.scale.z=4,st(g,32,48,this.slim?3:4,12,4)});let A=new V0,_=new U0(A,this.layer2MaterialBiased);this.modelListeners.push(()=>{_.scale.x=this.slim?3.5:4.5,_.scale.y=12.5,_.scale.z=4.5,st(A,48,48,this.slim?3:4,12,4)});let w=new ot;w.add(b,_),this.modelListeners.push(()=>{w.position.x=this.slim?.5:1}),w.position.y=-4,this.leftArm=new At(b,_),this.leftArm.name="leftArm",this.leftArm.add(w),this.leftArm.position.x=5,this.leftArm.position.y=-2,this.add(this.leftArm);let T=new V0(4,12,4);st(T,0,16,4,12,4);let S=new U0(T,this.layer1MaterialBiased),C=new V0(4.5,12.5,4.5);st(C,0,32,4,12,4);let H=new U0(C,this.layer2MaterialBiased),P=new ot;P.add(S,H),P.position.y=-6,this.rightLeg=new At(S,H),this.rightLeg.name="rightLeg",this.rightLeg.add(P),this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.add(this.rightLeg);let I=new V0(4,12,4);st(I,16,48,4,12,4);let N=new U0(I,this.layer1MaterialBiased),O=new V0(4.5,12.5,4.5);st(O,0,48,4,12,4);let j=new U0(O,this.layer2MaterialBiased),q=new ot;q.add(N,j),q.position.y=-6,this.leftLeg=new At(N,j),this.leftLeg.name="leftLeg",this.leftLeg.add(q),this.leftLeg.position.x=1.9,this.leftLeg.position.y=-12,this.leftLeg.position.z=-.1,this.add(this.leftLeg),this.modelType="default"}get map(){return this._map}set map(t){this._map=t,this.layer1Material.map=t,this.layer1Material.needsUpdate=!0,this.layer1MaterialBiased.map=t,this.layer1MaterialBiased.needsUpdate=!0,this.layer2Material.map=t,this.layer2Material.needsUpdate=!0,this.layer2MaterialBiased.map=t,this.layer2MaterialBiased.needsUpdate=!0}get modelType(){return this.slim?"slim":"default"}set modelType(t){this.slim=t==="slim",this.modelListeners.forEach(e=>e())}getBodyParts(){return this.children.filter(t=>t instanceof At)}setInnerLayerVisible(t){this.getBodyParts().forEach(e=>e.innerLayer.visible=t)}setOuterLayerVisible(t){this.getBodyParts().forEach(e=>e.outerLayer.visible=t)}resetJoints(){this.head.rotation.set(0,0,0),this.leftArm.rotation.set(0,0,0),this.rightArm.rotation.set(0,0,0),this.leftLeg.rotation.set(0,0,0),this.rightLeg.rotation.set(0,0,0),this.body.rotation.set(0,0,0),this.head.position.y=0,this.body.position.y=-6,this.body.position.z=0,this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.rightArm.position.z=0,this.leftArm.position.x=5,this.leftArm.position.y=-2,this.leftArm.position.z=0,this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.leftLeg.position.x=1.9,this.leftLeg.position.y=-12,this.leftLeg.position.z=-.1}},Gi=class extends ot{constructor(){super(),Object.defineProperty(this,"cape",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new f5({side:Vi,transparent:!0,alphaTest:1e-5});let t=new V0(10,16,1);Li(t,0,0,10,16,1),this.cape=new U0(t,this.material),this.cape.position.y=-8,this.cape.position.z=.5,this.add(this.cape)}get map(){return this.material.map}set map(t){this.material.map=t,this.material.needsUpdate=!0}},Ni=class extends ot{constructor(){super(),Object.defineProperty(this,"leftWing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightWing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new f5({side:Vi,transparent:!0,alphaTest:1e-5});let t=new V0(12,22,4);Li(t,22,0,10,20,2);let e=new U0(t,this.material);e.position.x=-5,e.position.y=-10,e.position.z=-1,this.leftWing=new ot,this.leftWing.add(e),this.add(this.leftWing);let i=new V0(12,22,4);Li(i,22,0,10,20,2);let r=new U0(i,this.material);r.scale.x=-1,r.position.x=5,r.position.y=-10,r.position.z=-1,this.rightWing=new ot,this.rightWing.add(r),this.add(this.rightWing),this.leftWing.position.x=5,this.leftWing.rotation.x=.2617994,this.resetJoints()}resetJoints(){this.leftWing.rotation.y=.01,this.leftWing.rotation.z=.2617994,this.updateRightWing()}updateRightWing(){this.rightWing.position.x=-this.leftWing.position.x,this.rightWing.position.y=this.leftWing.position.y,this.rightWing.rotation.x=this.leftWing.rotation.x,this.rightWing.rotation.y=-this.leftWing.rotation.y,this.rightWing.rotation.z=-this.leftWing.rotation.z}get map(){return this.material.map}set map(t){this.material.map=t,this.material.needsUpdate=!0}},Wi=class extends ot{constructor(){super(),Object.defineProperty(this,"rightEar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftEar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new f5({side:a3});let t=new V0(8,8,4/3);ji(t,0,0,6,6,1,14,7),this.rightEar=new U0(t,this.material),this.rightEar.name="rightEar",this.rightEar.position.x=-6,this.add(this.rightEar),this.leftEar=new U0(t,this.material),this.leftEar.name="leftEar",this.leftEar.position.x=6,this.add(this.leftEar)}get map(){return this.material.map}set map(t){this.material.map=t,this.material.needsUpdate=!0}},o3=10.8*Math.PI/180,h5=class extends ot{constructor(){super(),Object.defineProperty(this,"skin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cape",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"elytra",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ears",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.skin=new Ui,this.skin.name="skin",this.skin.position.y=8,this.add(this.skin),this.cape=new Gi,this.cape.name="cape",this.cape.position.y=8,this.cape.position.z=-2,this.cape.rotation.x=o3,this.cape.rotation.y=Math.PI,this.add(this.cape),this.elytra=new Ni,this.elytra.name="elytra",this.elytra.position.y=8,this.elytra.position.z=-2,this.elytra.visible=!1,this.add(this.elytra),this.ears=new Wi,this.ears.name="ears",this.ears.position.y=10,this.ears.position.z=2/3,this.ears.visible=!1,this.skin.head.add(this.ears)}get backEquipment(){return this.cape.visible?"cape":this.elytra.visible?"elytra":null}set backEquipment(t){this.cape.visible=t==="cape",this.elytra.visible=t==="elytra"}resetJoints(){this.skin.resetJoints(),this.cape.rotation.x=o3,this.cape.position.y=8,this.cape.position.z=-2,this.elytra.position.y=8,this.elytra.position.z=-2,this.elytra.rotation.x=0,this.elytra.resetJoints()}};x();R();M();k();import{Color as fp,PointLight as hp,EquirectangularReflectionMapping as mp,Group as pp,NearestFilter as gp,PerspectiveCamera as bp,Scene as yp,Texture as _p,Vector2 as wp,WebGLRenderer as Ap,AmbientLight as Ep,CanvasTexture as xp,WebGLRenderTarget as Rp,FloatType as kp,DepthTexture as Mp,Clock as Tp,Object3D as Sp,ColorManagement as Cp}from"three";import{OrbitControls as Pp}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as Hp}from"three/examples/jsm/postprocessing/EffectComposer.js";import"three/examples/jsm/postprocessing/Pass.js";import{RenderPass as Fp}from"three/examples/jsm/postprocessing/RenderPass.js";import{ShaderPass as Up}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as Np}from"three/examples/jsm/shaders/FXAAShader.js";x();R();M();k();var g1=class{constructor(){Object.defineProperty(this,"speed",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"progress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"currentId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progress0",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"animationObjects",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}update(t,e){if(this.paused)return;let i=e*this.speed;this.animate(t,i),this.animationObjects.forEach((r,s)=>{let o=this.progress0.get(s);r(t,this.progress-o,s)}),this.progress+=i}addAnimation(t){let e=this.currentId++;return this.progress0.set(e,this.progress),this.animationObjects.set(e,t),e}removeAnimation(t){t!=null&&(this.animationObjects.delete(t),this.progress0.delete(t))}};x();R();M();k();import{CanvasTexture as Xm,NearestFilter as $m,Sprite as tp,SpriteMaterial as ep}from"three";x();R();M();k();var Sa=Object.defineProperty,Ca=(n,t,e)=>t in n?Sa(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,y0=(n,t,e)=>(Ca(n,typeof t!="symbol"?t+"":t,e),e);function Yi(n){let t=[n];if(n.extra&&n.extra.length!==0)for(let e of n.extra)t.push(...Yi(e));return t}var Z=class{constructor(n,t,e,i,r,s){this.key=n,this.value=t,this.name=e,this.code=i,this.cssForeground=r,this.cssBackground=s}applyToStyle(n){n[this.key]=this.value}matchStyle(n){return n[this.key]===this.value}static fromCode(n){let e="0123456789abcdefklmnor".indexOf(n);if(e)return this.list[e]}toString(){return`${Z.CONTROL_STRING}${this.code}`}},_0=Z;y0(_0,"CONTROL_STRING","\xA7");y0(_0,"BLACK",new Z("color","black","BLACK","0",{color:"#000000"},{color:"#000000"}));y0(_0,"DARK_BLUE",new Z("color","dark_blue","DARK_BLUE","1",{color:"#0000AA"},{color:"#00002A"}));y0(_0,"DARK_GREEN",new Z("color","dark_green","DARK_GREEN","2",{color:"#00AA00"},{color:"#002A00"}));y0(_0,"DARK_AQUA",new Z("color","dark_aqua","DARK_AQUA","3",{color:"#00AAAA"},{color:"#002A2A"}));y0(_0,"DARK_RED",new Z("color","dark_red","DARK_RED","4",{color:"#AA0000"},{color:"#2A0000"}));y0(_0,"DARK_PURPLE",new Z("color","dark_purple","DARK_PURPLE","5",{color:"#AA00AA"},{color:"#2A002A"}));y0(_0,"GOLD",new Z("color","gold","GOLD","6",{color:"#FFAA00"},{color:"#2A2A00"}));y0(_0,"GRAY",new Z("color","gray","GRAY","7",{color:"#AAAAAA"},{color:"#2A2A2A"}));y0(_0,"DARK_GRAY",new Z("color","dark_gray","DARK_GRAY","8",{color:"#555555"},{color:"#151515"}));y0(_0,"BLUE",new Z("color","blue","BLUE","9",{color:"#5555FF"},{color:"#15153F"}));y0(_0,"GREEN",new Z("color","green","GREEN","a",{color:"#55FF55"},{color:"#153F15"}));y0(_0,"AQUA",new Z("color","aqua","AQUA","b",{color:"#55FFFF"},{color:"#153F3F"}));y0(_0,"RED",new Z("color","red","RED","c",{color:"#FF5555"},{color:"#3F1515"}));y0(_0,"LIGHT_PURPLE",new Z("color","light_purple","LIGHT_PURPLE","d",{color:"#FF55FF"},{color:"#3F153F"}));y0(_0,"YELLOW",new Z("color","yellow","YELLOW","e",{color:"#FFFF55"},{color:"#3F3F15"}));y0(_0,"WHITE",new Z("color","white","WHITE","f",{color:"#FFFFFF"},{color:"#3F3F3F"}));y0(_0,"OBFUSCATED",new Z("obfuscated",!0,"OBFUSCATED","k",{}));y0(_0,"BOLD",new Z("bold",!0,"BOLD","l",{"font-weight":"bold"}));y0(_0,"STRIKETHROUGH",new Z("strikethrough",!0,"STRIKETHROUGH","m",{"text-decoration":"line-through"}));y0(_0,"UNDERLINE",new Z("underlined",!0,"UNDERLINE","n",{"text-decoration":"underline"}));y0(_0,"ITALIC",new Z("italic",!0,"ITALIC","o",{"font-style":"italic"}));y0(_0,"RESET",{name:"RESET",code:"r",applyToStyle(n){n.bold=!1,n.strikethrough=!1,n.underlined=!1,n.italic=!1,n.obfuscated=!1,n.color=void 0},matchStyle(n){return!1},cssBackground:{},cssForeground:{},toString(){return`${Z.CONTROL_STRING}r`}});y0(_0,"list",[Z.BLACK,Z.DARK_BLUE,Z.DARK_GREEN,Z.DARK_AQUA,Z.DARK_RED,Z.DARK_PURPLE,Z.GOLD,Z.GRAY,Z.DARK_GRAY,Z.BLUE,Z.GREEN,Z.AQUA,Z.RED,Z.LIGHT_PURPLE,Z.YELLOW,Z.WHITE,Z.OBFUSCATED,Z.BOLD,Z.STRIKETHROUGH,Z.UNDERLINE,Z.ITALIC,Z.RESET]);var R5=Ke(Qi(),1);Zi();var Zs=Ke(P3(),1);import Xs from"prismarine-chat";x();R();M();k();import*as S0 from"three";x();R();M();k();x();R();M();k();var Pt=class n{constructor(t,e,i,r,s="div"){this.parent=t,this.object=e,this.property=i,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.nextNameID}`,this.$widget=document.createElement(s),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",o=>o.stopPropagation()),this.domElement.addEventListener("keyup",o=>o.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(t){return this._name=t,this.$name.innerHTML=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled?this:(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t),this)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(t){let e=this.parent.add(this.object,this.property,t);return e.name(this._name),this.destroy(),e}min(t){return this}max(t){return this}step(t){return this}decimals(t){return this}listen(t=!0){return this._listening=t,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.object[this.property]=t,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},Xi=class extends Pt{constructor(t,e,i){super(t,e,i,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function $i(n){let t,e;return(t=n.match(/(#|0x)?([a-f0-9]{6})/i))?e=t[2]:(t=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?e=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(e=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),e?"#"+e:!1}var m7={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:$i,toHexString:$i},_5={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},p7={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,t,e=1){let i=_5.fromHexString(n);t[0]=(i>>16&255)/255*e,t[1]=(i>>8&255)/255*e,t[2]=(i&255)/255*e},toHexString([n,t,e],i=1){i=255/i;let r=n*i<<16^t*i<<8^e*i<<0;return _5.toHexString(r)}},g7={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,t,e=1){let i=_5.fromHexString(n);t.r=(i>>16&255)/255*e,t.g=(i>>8&255)/255*e,t.b=(i&255)/255*e},toHexString({r:n,g:t,b:e},i=1){i=255/i;let r=n*i<<16^t*i<<8^e*i<<0;return _5.toHexString(r)}},b7=[m7,_5,p7,g7];function y7(n){return b7.find(t=>t.match(n))}var tr=class extends Pt{constructor(t,e,i,r){super(t,e,i,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=y7(this.initialValue),this._rgbScale=r,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=$i(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){let e=this._format.fromHexString(t);this.setValue(e)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},y5=class extends Pt{constructor(t,e,i){super(t,e,i,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",r=>{r.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},er=class extends Pt{constructor(t,e,i,r,s,o){super(t,e,i,"number"),this._initInput(),this.min(r),this.max(s);let a=o!==void 0;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}decimals(t){return this._decimals=t,this.updateDisplay(),this}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,e=!0){return this._step=t,this._stepExplicit=e,this}updateDisplay(){let t=this.getValue();if(this._hasSlider){let e=(t-this._min)/(this._max-this._min);e=Math.max(0,Math.min(e,1)),this.$fill.style.width=e*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?t:t.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let e=()=>{let w=parseFloat(this.$input.value);isNaN(w)||(this._stepExplicit&&(w=this._snap(w)),this.setValue(this._clamp(w)))},i=w=>{let T=parseFloat(this.$input.value);isNaN(T)||(this._snapClampSetValue(T+w),this.$input.value=this.getValue())},r=w=>{w.key==="Enter"&&this.$input.blur(),w.code==="ArrowUp"&&(w.preventDefault(),i(this._step*this._arrowKeyMultiplier(w))),w.code==="ArrowDown"&&(w.preventDefault(),i(this._step*this._arrowKeyMultiplier(w)*-1))},s=w=>{this._inputFocused&&(w.preventDefault(),i(this._step*this._normalizeMouseWheel(w)))},o=!1,a,v,l,c,d,f=5,m=w=>{a=w.clientX,v=l=w.clientY,o=!0,c=this.getValue(),d=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",b)},g=w=>{if(o){let T=w.clientX-a,S=w.clientY-v;Math.abs(S)>f?(w.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(T)>f&&b()}if(!o){let T=w.clientY-l;d-=T*this._step*this._arrowKeyMultiplier(w),c+d>this._max?d=this._max-c:c+d<this._min&&(d=this._min-c),this._snapClampSetValue(c+d)}l=w.clientY},b=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",b)},A=()=>{this._inputFocused=!0},_=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",e),this.$input.addEventListener("keydown",r),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",m),this.$input.addEventListener("focus",A),this.$input.addEventListener("blur",_)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let t=(_,w,T,S,C)=>(_-w)/(T-w)*(C-S)+S,e=_=>{let w=this.$slider.getBoundingClientRect(),T=t(_,w.left,w.right,this._min,this._max);this._snapClampSetValue(T)},i=_=>{this._setDraggingStyle(!0),e(_.clientX),window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)},r=_=>{e(_.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s)},o=!1,a,v,l=_=>{_.preventDefault(),this._setDraggingStyle(!0),e(_.touches[0].clientX),o=!1},c=_=>{_.touches.length>1||(this._hasScrollBar?(a=_.touches[0].clientX,v=_.touches[0].clientY,o=!0):l(_),window.addEventListener("touchmove",d,{passive:!1}),window.addEventListener("touchend",f))},d=_=>{if(o){let w=_.touches[0].clientX-a,T=_.touches[0].clientY-v;Math.abs(w)>Math.abs(T)?l(_):(window.removeEventListener("touchmove",d),window.removeEventListener("touchend",f))}else _.preventDefault(),e(_.touches[0].clientX)},f=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",d),window.removeEventListener("touchend",f)},m=this._callOnFinishChange.bind(this),g=400,b,A=_=>{if(Math.abs(_.deltaX)<Math.abs(_.deltaY)&&this._hasScrollBar)return;_.preventDefault();let T=this._normalizeMouseWheel(_)*this._step;this._snapClampSetValue(this.getValue()+T),this.$input.value=this.getValue(),clearTimeout(b),b=setTimeout(m,g)};this.$slider.addEventListener("mousedown",i),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",A,{passive:!1})}_setDraggingStyle(t,e="horizontal"){this.$slider&&this.$slider.classList.toggle("active",t),document.body.classList.toggle("lil-gui-dragging",t),document.body.classList.toggle(`lil-gui-${e}`,t)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(t){let{deltaX:e,deltaY:i}=t;return Math.floor(t.deltaY)!==t.deltaY&&t.wheelDelta&&(e=0,i=-t.wheelDelta/120,i*=this._stepExplicit?1:10),e+-i}_arrowKeyMultiplier(t){let e=this._stepExplicit?1:10;return t.shiftKey?e*=10:t.altKey&&(e/=10),e}_snap(t){let e=Math.round(t/this._step)*this._step;return parseFloat(e.toPrecision(15))}_clamp(t){return t<this._min&&(t=this._min),t>this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){let t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},ir=class extends Pt{constructor(t,e,i,r){super(t,e,i,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(r)?r:Object.values(r),this._names=Array.isArray(r)?r:Object.keys(r),this._names.forEach(s=>{let o=document.createElement("option");o.innerHTML=s,this.$select.appendChild(o)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){let t=this.getValue(),e=this._values.indexOf(t);return this.$select.selectedIndex=e,this.$display.innerHTML=e===-1?t:this._names[e],this}},rr=class extends Pt{constructor(t,e,i){super(t,e,i,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",r=>{r.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},_7=`.lil-gui {
|
|
17
17
|
font-family: var(--font-family);
|
|
18
18
|
font-size: var(--font-size);
|
|
19
19
|
line-height: 1;
|
|
@@ -444,11 +444,11 @@ var v6=Object.create;var Ye=Object.defineProperty;var l6=Object.getOwnPropertyDe
|
|
|
444
444
|
@font-face {
|
|
445
445
|
font-family: "lil-gui";
|
|
446
446
|
src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRB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OZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");
|
|
447
|
-
}`;function c7(n){let t=document.createElement("style");t.innerHTML=n;let e=document.querySelector("head link[rel=stylesheet], head style");e?document.head.insertBefore(t,e):document.head.appendChild(t)}var k3=!1,tr=class n{constructor({parent:t,autoPlace:e=t===void 0,container:i,width:r,title:s="Controls",closeFolders:o=!1,injectStyles:a=!0,touchStyles:v=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",l=>{(l.code==="Enter"||l.code==="Space")&&(l.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),v&&this.domElement.classList.add("allow-touch-styles"),!k3&&a&&(c7(l7),k3=!0),i?i.appendChild(this.domElement):e&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=o}add(t,e,i,r,s){if(Object(i)===i)return new Xi(this,t,e,i);switch(typeof t[e]){case"number":return new Zi(this,t,e,i,r,s);case"boolean":return new Ki(this,t,e);case"string":return new $i(this,t,e);case"function":return new h5(this,t,e)}}addColor(t,e,i=1){return new qi(this,t,e,i)}addFolder(t){let e=new n({parent:this,title:t});return this.root._closeFolders&&e.close(),e}load(t,e=!0){return t.controllers&&this.controllers.forEach(i=>{i instanceof h5||i._name in t.controllers&&i.load(t.controllers[i._name])}),e&&t.folders&&this.folders.forEach(i=>{i._title in t.folders&&i.load(t.folders[i._title])}),this}save(t=!0){let e={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof h5)){if(i._name in e.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);e.controllers[i._name]=i.save()}}),t&&this.folders.forEach(i=>{if(i._title in e.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);e.folders[i._title]=i.save()}),e}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let e=this.$children.clientHeight;this.$children.style.height=e+"px",this.domElement.classList.add("transition");let i=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);let r=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=r+"px"})}),this}title(t){return this._title=t,this.$title.innerHTML=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(e=>{t=t.concat(e.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(e=>{t=t.concat(e.foldersRecursive())}),t}},er=tr;var At=class{constructor(t,e,i,r){u(this,"gui",null);u(this,"storageKey","");u(this,"target");u(this,"params",[]);u(this,"paramsMeta",{});u(this,"_visible",!1);u(this,"initialValues",{});u(this,"initialized",!1);if(!x0){this.gui=new er,this.storageKey=`debug_params_${t}`,this.target=e,this.paramsMeta=r??{},this.params=i??Object.keys(e);for(let s of this.params)this.initialValues[s]=e[s];this.gui.domElement.style.display="none"}}activate(){return x0?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return x0?!1:this._visible}set visible(t){x0||!this.gui||(this._visible=t,this.gui.domElement.style.display=t?"block":"none",this.saveVisibility())}loadSavedValues(){if(!x0)try{let t=localStorage.getItem(this.storageKey);if(t){let e=JSON.parse(t);for(let i of this.params)if(i in e){let r=e[i];r!==null&&(this.target[i]=r)}}}catch{}}saveValues(t=!1){if(!x0)try{let e={};for(let i of this.params)e[i]=this.target[i];t?localStorage.removeItem(this.storageKey):localStorage.setItem(this.storageKey,JSON.stringify(e))}catch{}}saveVisibility(){if(!x0)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch{}}setupControls(){if(!(x0||!this.gui)){this.gui.add(this,"visible").name("Show Controls"),this.gui.add({resetAll:()=>{if(this.gui){for(let t of this.params)this.target[t]=this.initialValues[t];this.saveValues(!0),this.gui.destroy(),this.gui=new er,this.setupControls()}}},"resetAll").name("Reset All Parameters");for(let t of this.params){let e=this.target[t],i=this.paramsMeta[t]??{};if(typeof e=="number"){let r=i.min??e-Math.abs(e*2),s=i.max??e+Math.abs(e*2),o=i.step??Math.abs(e)/100;this.gui.add(this.target,t,r,s,o).onChange(()=>this.saveValues())}else if(typeof e=="boolean")this.gui.add(this.target,t).onChange(()=>this.saveValues());else if(typeof e=="string"&&["x","y","z"].includes(t)){let r=i.min??-10,s=i.max??10,o=i.step??.1;this.gui.add(this.target,t,r,s,o).onChange(()=>this.saveValues())}else Array.isArray(e)&&this.gui.add(this.target,t,e).onChange(()=>this.saveValues())}}}save(){x0||(this.saveValues(),this.saveVisibility())}destroy(){x0||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};x();R();T();k();x();R();T();k();var g1=class{constructor(){u(this,"currentAnimation",null);u(this,"isAnimating",!1);u(this,"cancelRequested",!1);u(this,"completionCallbacks",[]);u(this,"currentCancelCallback",null)}async startAnimation(t,e){return this.isAnimating&&await this.cancelCurrentAnimation(),new Promise(i=>{this.isAnimating=!0,this.cancelRequested=!1,this.currentCancelCallback=e??null,this.currentAnimation=t(),this.completionCallbacks.push(()=>{this.isAnimating=!1,this.currentAnimation=null,i()})})}async cancelCurrentAnimation(){if(this.isAnimating){if(this.currentCancelCallback){let t=this.currentCancelCallback;this.currentCancelCallback=null,t()}return new Promise(t=>{this.cancelRequested=!0,this.completionCallbacks.push(()=>{t()})})}}animationCycleFinish(){this.cancelRequested&&this.forceFinish()}forceFinish(t=!0){if(!this.isAnimating)return;if(this.currentAnimation){for(let i of this.currentAnimation.getAll())i.stop();this.currentAnimation.removeAll(),this.currentAnimation=null}this.isAnimating=!1,this.cancelRequested=!1;let e=[...this.completionCallbacks];if(this.completionCallbacks=[],t)for(let i of e)i()}update(){this.currentAnimation&&this.currentAnimation.update()}get isActive(){return this.isAnimating}get shouldCancel(){return this.cancelRequested}};var d7={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},te=class{constructor(t,e,i){this.getState=t;this.setState=e;u(this,"animationController",new g1);u(this,"defaultState");u(this,"speeds");u(this,"currentStateName","");u(this,"transitioningToStateName","");this.speeds={...d7},i&&Object.assign(this.speeds,i),this.defaultState=this.getState()}calculateDuration(t){let e=0,i=this.getState();for(let[r,s]of Object.entries(t)){let o=i[r],a=Math.abs(s-o),v=this.getPropertySpeed(r),l=a/v*1e3;e=Math.max(e,l)}return Math.min(Math.max(e,200),2e3)}getPropertySpeed(t){return t in this.speeds?this.speeds[t]:t.toLowerCase().includes("rotation")?this.speeds.rotation:t.toLowerCase().includes("scale")?this.speeds.scale:t.toLowerCase()==="x"||t.toLowerCase()==="y"||t.toLowerCase()==="z"?this.speeds[t]:this.speeds.default}startTransition(t,e,i,r=I0.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=e??"";let o=this.getState(),a=this.calculateDuration(t);this.animationController.startAnimation(()=>{let v=new be;return new O0(o,v).to(t,a).easing(r).onUpdate(l=>{for(let c of Object.keys(l))this.setState(c,l[c])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",i?.()}).start(),v},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(t,e,i,r){this.startTransition(t,e,i,I0.Linear.None,r)}getCurrentValue(t){return this.getState()[t]}get isTransitioning(){return this.animationController.isActive}};x();R();T();k();import{subscribeKey as u7}from"valtio/utils";function b1(n,t,e,i,r){let s=0,o,a=async()=>{let v=++s,l=await n(t[e]);v===s?(o&&r?.(o),i(l),o=l):r?.(l)};return a(),u7(t,e,a)}x();R();T();k();var T3=Math.PI/180;function y1(n){let{walkDist:t,prevWalkDist:e,bob:i,prevBob:r,partialTick:s}=n,o=t-e,a=-(t+o*s),v=r+(i-r)*s,l=Math.sin(a*Math.PI),c=Math.cos(a*Math.PI);return{position:{x:l*v*.5,y:-Math.abs(c*v)},rotation:{x:Math.abs(Math.cos(a*Math.PI-.2)*v)*5*T3,z:l*v*3*T3}}}x();R();T();k();var _1=n=>({"minecraft:display_context":"firstperson","minecraft:use_duration":n.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!n.playerStateReactive.itemUsageTicks}),f7=()=>({"minecraft:display_context":"firstperson"}),Te=(n,t)=>{if(!t)return"empty";if(t.type==="hand")return"hand";let e=t.name??(t.id!==void 0?`#${t.id}`:"unknown");if(!n.resourcesManager.currentResources)return`${t.type}:${e}`;let i=n.getItemRenderData({...t.fullItem,itemId:t.id},f7());return`${t.type}:${e}:${i.modelName}`};var j0=new S0.Matrix4,M3=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function h7(n,t){let e=new S0.Matrix4,i=1,r=Math.sqrt(n),s=-.3*Math.sin(r*Math.PI),o=.4*Math.sin(r*2*Math.PI),a=-.4*Math.sin(n*Math.PI);return e.multiply(j0.makeTranslation(i*(s+.64),o-.6+t*-.6,a-.72)),e.multiply(j0.makeRotationY(i*45*Math.PI/180)),e.multiply(j0.makeRotationY(i*Math.sin(r*Math.PI)*70*Math.PI/180)),e.multiply(j0.makeRotationZ(i*Math.sin(n*n*Math.PI)*-20*Math.PI/180)),e.multiply(j0.makeTranslation(i*-1,3.6,3.5)),e.multiply(j0.makeRotationZ(i*120*Math.PI/180)),e.multiply(j0.makeRotationX(200*Math.PI/180)),e.multiply(j0.makeRotationY(i*-135*Math.PI/180)),e.multiply(j0.makeTranslation(i*5.6,0,0)),e.multiply(j0.makeTranslation(i*-5/16,2/16,0)),e}function m7(n,t){let e=new S0.Matrix4,i=1,r=Math.sqrt(n),s=-.4*Math.sin(r*Math.PI),o=.2*Math.sin(r*2*Math.PI),a=-.2*Math.sin(n*Math.PI);e.multiply(j0.makeTranslation(i*s,o,a)),e.multiply(j0.makeTranslation(i*.56,-.52+t*-.6,-.72));let v=Math.sin(n*n*Math.PI),l=Math.sin(r*Math.PI);return e.multiply(j0.makeRotationY(i*(45+v*-20)*Math.PI/180)),e.multiply(j0.makeRotationZ(i*l*-20*Math.PI/180)),e.multiply(j0.makeRotationX(l*-80*Math.PI/180)),e.multiply(j0.makeRotationY(i*-45*Math.PI/180)),e}var p5=class{constructor(t,e=!1){this.worldRenderer=t;this.offHand=e;u(this,"holdingBlock");u(this,"blockSwapAnimation");u(this,"cameraGroup",new S0.Mesh);u(this,"armTransformGroup",new S0.Group);u(this,"camera",new S0.PerspectiveCamera(70,1,.05,100));u(this,"equipProgress",0);u(this,"stopUpdate",!1);u(this,"lastHeldItem");u(this,"lastHeldItemRenderKey");u(this,"currentDisplayType","hand");u(this,"isSwinging",!1);u(this,"nextIterStopCallbacks");u(this,"idleAnimator");u(this,"ready",!1);u(this,"lastUpdate",0);u(this,"xBob",0);u(this,"yBob",0);u(this,"lastBobUpdateTime",0);u(this,"lastBobWalkDist",0);u(this,"lastBobTickTime",0);u(this,"playerHand");u(this,"offHandDisplay",!1);u(this,"offHandModeLegacy",!1);u(this,"swingAnimator");u(this,"config");u(this,"disposed",!1);u(this,"unsubs",[]);u(this,"lastItemModelName");u(this,"switchRequest",0);this.initCameraGroup(),this.swingAnimator=new ir,this.unsubs.push(this.worldRenderer.onReactivePlayerStateUpdated("heldItemMain",()=>{this.offHand||this.updateItem()},!1),this.worldRenderer.onReactivePlayerStateUpdated("heldItemOff",()=>{this.offHand&&this.updateItem()},!1)),this.config=t.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||g5().then(i=>{this.disposed||(this.playerHand=i,this.updateItem())}).then(()=>{if(this.disposed)return;let i=b1(async()=>g5(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",r=>{r&&(this.playerHand=r,this.updateItem())},r=>{R0(r,!0)});this.unsubs.push(i)})}dispose(){this.disposed=!0,this.unsubs.forEach(t=>t()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,R0(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&R0(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(R0(this.playerHand,!0),this.playerHand=void 0),this.ready=!1}updateItem(){if(!this.ready)return;let t=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;t?this.setNewItem(t):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new S0.Mesh,this.armTransformGroup=new S0.Group,this.armTransformGroup.matrixAutoUpdate=!1,this.cameraGroup.add(this.armTransformGroup)}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(t,e,i,r){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),(this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage)&&this.swingAnimator?.update(),this.blockSwapAnimation?.switcher.update();let o=new S0.Scene;o.add(this.cameraGroup);let a=e.getSize(new S0.Vector2),v=a.height>a.width;v?this.camera.aspect!==1&&(this.camera.aspect=1,this.camera.updateProjectionMatrix()):this.camera.aspect!==t.aspect&&(this.camera.aspect=t.aspect,this.camera.updateProjectionMatrix()),this.updateCameraGroup(),o.add(i.clone()),o.add(r.clone());let{offHandDisplay:l}=this;if(l&&(this.cameraGroup.scale.x=-1),e.autoClear=!1,e.clearDepth(),v){let c=Math.min(a.width,a.height);l?e.setViewport(0,0,c,c):e.setViewport(a.width-c,0,c,c)}e.render(o,this.camera),v&&e.setViewport(0,0,a.width,a.height),l&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(t){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new te(()=>({progress:this.equipProgress}),(r,s)=>{r==="progress"&&(this.equipProgress=s)},{progress:4})});let e=t==="disappeared"?1:0,i=!1;return new Promise(r=>{this.blockSwapAnimation.switcher.transitionTo({progress:e},t,()=>{i||r(!0)},()=>{i=!0,r(!1)})})}isDifferentItem(t){return this.lastHeldItemRenderKey!==Te(this.worldRenderer,t)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:t}=this,e=performance.now(),i=this.worldRenderer.cameraShake.getBaseRotation(),r=i.pitch,s=i.yaw;if(this.lastBobUpdateTime===0)this.xBob=r,this.yBob=s;else{let f=Math.min((e-this.lastBobUpdateTime)/1e3,.1),m=1-Math.pow(.5,f*28),g=1-Math.pow(.5,f*36);this.xBob+=(r-this.xBob)*m,this.yBob+=M3(s-this.yBob)*g}this.lastBobUpdateTime=e;let o=(r-this.xBob)*-.05,a=M3(s-this.yBob)*-.035;if(this.cameraGroup.position.copy(t.position),this.cameraGroup.rotation.copy(t.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let f=this.worldRenderer.playerStateReactive;f.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=e,this.lastBobWalkDist=f.walkDist);let m=Math.min((e-this.lastBobTickTime)/50,1),g=1.8,b=y1({walkDist:f.walkDist*g,prevWalkDist:f.prevWalkDist*g,bob:f.bob,prevBob:f.prevBob,partialTick:m});this.cameraGroup.position.x+=b.position.x,this.cameraGroup.position.y+=b.position.y,this.cameraGroup.rotation.z+=b.rotation.z,this.cameraGroup.rotation.x+=b.rotation.x}this.cameraGroup.rotation.x+=o,this.cameraGroup.rotation.y+=a;let l=this.currentDisplayType,c=this.swingAnimator?.getSwingProgress()??0,d;l==="hand"?d=h7(c,this.equipProgress):d=m7(c,this.equipProgress),this.armTransformGroup.matrix.copy(d),this.armTransformGroup.matrixWorldNeedsUpdate=!0}async createItemModel(t){if(this.lastUpdate=performance.now(),!t||t.type==="hand"&&!this.playerHand)return;let e;if(t.type==="item"||t.type==="block"){let i=this.worldRenderer.entities.getItemMesh({...t.fullItem,itemId:t.id},_1(this.worldRenderer),!1,this.lastItemModelName);if(i){let{mesh:r,isBlock:s,modelName:o}=i;s?(e=r,t.type="block"):(e=r,t.type="item"),this.lastItemModelName=o}}else e=this.playerHand;if(e){if(t.type==="item"||t.type==="block"){let i=new S0.Group;i.name="displayTransform",t.type==="item"?(i.position.set(1.13/16,3.2/16,1.13/16),i.rotation.set(0,S0.MathUtils.degToRad(-90),S0.MathUtils.degToRad(25),"XYZ"),i.scale.set(.68,.68,.68)):(i.rotation.set(0,S0.MathUtils.degToRad(45),0,"XYZ"),i.scale.set(.4,.4,.4)),i.add(e),e=i}return e.name="holdingBlock",{model:e,type:t.type}}}async replaceItemModel(t){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!t){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.currentDisplayType="hand";let i=this.swingAnimator;i?.stopSwing(),i&&(i.type="hand"),this.idleAnimator=void 0;return}let e=await this.createItemModel(t);e&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=e.model,this.currentDisplayType=e.type,this.armTransformGroup.add(e.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(t){let e=Te(this.worldRenderer,t),i=this.lastHeldItemRenderKey!==e;if(this.lastHeldItem=t,!i)return;this.lastHeldItemRenderKey=e,this.lastItemModelName=void 0;let r=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock.removeFromParent(),this.holdingBlock!==this.playerHand&&R0(this.holdingBlock,!1),this.holdingBlock=void 0}if(!t){this.currentDisplayType="hand";let v=this.swingAnimator;v?.stopSwing(),v&&(v.type="hand"),this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(r!==this.switchRequest)return;let o=await this.createItemModel(t);if(!o||r!==this.switchRequest)return;this.holdingBlock=o.model,this.currentDisplayType=o.type,this.armTransformGroup.add(this.holdingBlock),s&&await this.playBlockSwapAnimation("appeared");let a=this.swingAnimator;a&&(a.type=o.type),this.idleAnimator=void 0}};var ir=class{constructor(){u(this,"animationTimer",0);u(this,"lastTime",0);u(this,"isAnimating",!1);u(this,"stopRequested",!1);u(this,"swingProgress",0);u(this,"type","hand");u(this,"debugParams",{animationTime:250,animationStage:0});u(this,"debugGui");this.debugGui=new At("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01}})}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.swingProgress=0;return}let t=performance.now(),e=(t-this.lastTime)/1e3;this.lastTime=t,this.animationTimer+=e*1e3;let i=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(i>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.swingProgress=0;return}this.animationTimer=0,this.swingProgress=0;return}this.swingProgress=i}getSwingProgress(){return this.swingProgress}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}},S3=(n,t,e,i,r)=>{let s=i.transformModel(t,{name:e,properties:{}});return Hi(n,[[s]],void 0,"plains",r)};x();R();T();k();import*as s0 from"three";function p7(n,t){let{depth:e,pixelSize:i}=t;if(n.width<=0||n.height<=0)throw new Error(`Invalid canvas dimensions: ${n.width}x${n.height}`);let s=n.getContext("2d").getImageData(0,0,n.width,n.height),{data:o}=s,a=n.width,v=n.height,l=e/2,c=i??1/Math.max(a,v),d=(B,I)=>{if(B<0||I<0||B>=a||I>=v)return!1;let N=(I*a+B)*4;return o[N+3]>128},f=[],m=[],g=[],b=[],A=0,_=(B,I,N,O,j,q,$,e0)=>(f.push(B,I,N),g.push(O,j),b.push(q,$,e0),A++),w=(B,I,N,O)=>{m.push(B,I,N,B,N,O)},M=(B,I)=>{let N=(B/a-.5)*c*a,O=-(I/v-.5)*c*v;return{x:N,y:O}},S=Array.from({length:v+1},()=>Array.from({length:a+1},()=>null)),C=Array.from({length:v+1},()=>Array.from({length:a+1},()=>null));for(let B=0;B<=v;B++)for(let I=0;I<=a;I++){let{x:N,y:O}=M(I-.5,B-.5),j=I/a,q=B/v,$=!1,e0=[[I-1,B-1],[I,B-1],[I-1,B],[I,B]];for(let[d0,l0]of e0)if(d(d0,l0)){$=!0;break}$&&(S[B][I]=_(N,O,l,j,q,0,0,1),C[B][I]=_(N,O,-l,j,q,0,0,-1))}for(let B=0;B<v;B++)for(let I=0;I<a;I++){if(!d(I,B))continue;let N=S[B][I],O=S[B][I+1],j=S[B+1][I+1],q=S[B+1][I],$=C[B][I],e0=C[B][I+1],d0=C[B+1][I+1],l0=C[B+1][I];N!==null&&O!==null&&j!==null&&q!==null&&w(N,O,j,q),$!==null&&e0!==null&&d0!==null&&l0!==null&&w(e0,$,l0,d0)}for(let B=0;B<v;B++)for(let I=0;I<a;I++){if(!d(I,B))continue;let N=(I+.5)/a,O=(B+.5)/v;if(!d(I-1,B)){let j=S[B][I],q=S[B+1][I],$=C[B][I],e0=C[B+1][I];if(j!==null&&q!==null&&$!==null&&e0!==null){let d0=_(f[j*3],f[j*3+1],f[j*3+2],N,O,-1,0,0),l0=_(f[q*3],f[q*3+1],f[q*3+2],N,O,-1,0,0),m0=_(f[e0*3],f[e0*3+1],f[e0*3+2],N,O,-1,0,0),p0=_(f[$*3],f[$*3+1],f[$*3+2],N,O,-1,0,0);w(d0,l0,m0,p0)}}if(!d(I+1,B)){let j=S[B+1][I+1],q=S[B][I+1],$=C[B+1][I+1],e0=C[B][I+1];if(j!==null&&q!==null&&$!==null&&e0!==null){let d0=_(f[j*3],f[j*3+1],f[j*3+2],N,O,1,0,0),l0=_(f[q*3],f[q*3+1],f[q*3+2],N,O,1,0,0),m0=_(f[e0*3],f[e0*3+1],f[e0*3+2],N,O,1,0,0),p0=_(f[$*3],f[$*3+1],f[$*3+2],N,O,1,0,0);w(d0,l0,m0,p0)}}if(!d(I,B-1)){let j=S[B][I],q=S[B][I+1],$=C[B][I],e0=C[B][I+1];if(j!==null&&q!==null&&$!==null&&e0!==null){let d0=_(f[j*3],f[j*3+1],f[j*3+2],N,O,0,-1,0),l0=_(f[q*3],f[q*3+1],f[q*3+2],N,O,0,-1,0),m0=_(f[e0*3],f[e0*3+1],f[e0*3+2],N,O,0,-1,0),p0=_(f[$*3],f[$*3+1],f[$*3+2],N,O,0,-1,0);w(d0,l0,m0,p0)}}if(!d(I,B+1)){let j=S[B+1][I+1],q=S[B+1][I],$=C[B+1][I+1],e0=C[B+1][I];if(j!==null&&q!==null&&$!==null&&e0!==null){let d0=_(f[j*3],f[j*3+1],f[j*3+2],N,O,0,1,0),l0=_(f[q*3],f[q*3+1],f[q*3+2],N,O,0,1,0),m0=_(f[e0*3],f[e0*3+1],f[e0*3+2],N,O,0,1,0),p0=_(f[$*3],f[$*3+1],f[$*3+2],N,O,0,1,0);w(d0,l0,m0,p0)}}}let H=new s0.BufferGeometry;return H.setAttribute("position",new s0.Float32BufferAttribute(f,3)),H.setAttribute("uv",new s0.Float32BufferAttribute(g,2)),H.setAttribute("normal",new s0.Float32BufferAttribute(b,3)),H.setIndex(m),H.computeVertexNormals(),{geometry:H,totalVertices:A,totalTriangles:m.length/3}}function g7(n,t){let{u:e,v:i,sizeX:r,sizeY:s}=t,o=Math.max(1,Math.floor(r*n.image.width)),a=Math.max(1,Math.floor(s*n.image.height)),v=document.createElement("canvas");v.width=o,v.height=a;let l=v.getContext("2d");return l.imageSmoothingEnabled=!1,l.drawImage(n.image,e*n.image.width,i*n.image.height,r*n.image.width,s*n.image.height,0,0,v.width,v.height),v}function C3(n,t,e={}){let{faceCamera:i=!1,use3D:r=!0,depth:s=.04}=e,{u:o,v:a,sizeX:v,sizeY:l}=t;if(i){let b=n.clone();b.flipY=!0,b.offset.set(o,1-a-l),b.repeat.set(v,l),b.needsUpdate=!0,b.magFilter=s0.NearestFilter,b.minFilter=s0.NearestFilter;let A=new s0.SpriteMaterial({map:b,transparent:!0,alphaTest:.1});return{mesh:new s0.Sprite(A),itemsTexture:b,cleanup(){b.dispose()}}}if(r)try{let b=g7(n,t),{geometry:A}=p7(b,{depth:s}),_=new s0.CanvasTexture(b);_.magFilter=s0.NearestFilter,_.minFilter=s0.NearestFilter,_.wrapS=_.wrapT=s0.ClampToEdgeWrapping,_.flipY=!1,_.needsUpdate=!0;let w=new s0.MeshStandardMaterial({map:_,side:s0.DoubleSide,transparent:!0,alphaTest:.1});return{mesh:new s0.Mesh(A,w),itemsTexture:_,cleanup(){_.dispose(),A.dispose(),w.map&&w.map.dispose(),w.dispose()}}}catch{}let c=n.clone();c.flipY=!0,c.offset.set(o,1-a-l),c.repeat.set(v,l),c.needsUpdate=!0,c.magFilter=s0.NearestFilter,c.minFilter=s0.NearestFilter;let d=c.clone();d.repeat.x*=-1,d.needsUpdate=!0,d.offset.set(o+v,1-a-l);let f=new s0.MeshStandardMaterial({map:c,transparent:!0,alphaTest:.1}),m=new s0.MeshStandardMaterial({map:d,transparent:!0,alphaTest:.1});return{mesh:new s0.Mesh(new s0.BoxGeometry(1,1,0),[new s0.MeshBasicMaterial({color:0}),new s0.MeshBasicMaterial({color:0}),new s0.MeshBasicMaterial({color:0}),new s0.MeshBasicMaterial({color:0}),f,m]),itemsTexture:c,itemsTextureFlipped:d,cleanup(){c.dispose(),d.dispose(),f.dispose(),m.dispose()}}}x();R();T();k();import*as J from"three";x();R();T();k();x();R();T();k();import{REVISION as b7}from"three";var P3=parseInt(b7.replace(/\D+/g,""));x();R();T();k();import{Loader as y7,FileLoader as _7,Group as w7,BufferGeometry as B3,Float32BufferAttribute as Me,LineBasicMaterial as rr,Material as I3,PointsMaterial as w1,MeshPhongMaterial as A7,LineSegments as H3,Points as nr,Mesh as O3,Vector3 as b5}from"three";var E7=/^[og]\s*(.+)?/,x7=/^mtllib /,R7=/^usemtl /,k7=/^usemap /,z3=new b5,sr=new b5,D3=new b5,F3=new b5,at=new b5;function T7(){let n={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}let i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(r,s){let o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);let a={index:this.materials.length,name:r||"",mtllib:Array.isArray(s)&&s.length>0?s[s.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(v){let l={index:typeof v=="number"?v:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(r){let s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.inherited=!1),r&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return r&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},i&&i.name&&typeof i.clone=="function"){let r=i.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(t,e){let i=parseInt(t,10);return(i>=0?i-1:i+e/3)*3},parseNormalIndex:function(t,e){let i=parseInt(t,10);return(i>=0?i-1:i+e/3)*3},parseUVIndex:function(t,e){let i=parseInt(t,10);return(i>=0?i-1:i+e/2)*2},addVertex:function(t,e,i){let r=this.vertices,s=this.object.geometry.vertices;s.push(r[t+0],r[t+1],r[t+2]),s.push(r[e+0],r[e+1],r[e+2]),s.push(r[i+0],r[i+1],r[i+2])},addVertexPoint:function(t){let e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){let e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){let r=this.normals,s=this.object.geometry.normals;s.push(r[t+0],r[t+1],r[t+2]),s.push(r[e+0],r[e+1],r[e+2]),s.push(r[i+0],r[i+1],r[i+2])},addFaceNormal:function(t,e,i){let r=this.vertices,s=this.object.geometry.normals;z3.fromArray(r,t),sr.fromArray(r,e),D3.fromArray(r,i),at.subVectors(D3,sr),F3.subVectors(z3,sr),at.cross(F3),at.normalize(),s.push(at.x,at.y,at.z),s.push(at.x,at.y,at.z),s.push(at.x,at.y,at.z)},addColor:function(t,e,i){let r=this.colors,s=this.object.geometry.colors;r[t]!==void 0&&s.push(r[t+0],r[t+1],r[t+2]),r[e]!==void 0&&s.push(r[e+0],r[e+1],r[e+2]),r[i]!==void 0&&s.push(r[i+0],r[i+1],r[i+2])},addUV:function(t,e,i){let r=this.uvs,s=this.object.geometry.uvs;s.push(r[t+0],r[t+1]),s.push(r[e+0],r[e+1]),s.push(r[i+0],r[i+1])},addDefaultUV:function(){let t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){let e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,r,s,o,a,v,l){let c=this.vertices.length,d=this.parseVertexIndex(t,c),f=this.parseVertexIndex(e,c),m=this.parseVertexIndex(i,c);if(this.addVertex(d,f,m),this.addColor(d,f,m),a!==void 0&&a!==""){let g=this.normals.length;d=this.parseNormalIndex(a,g),f=this.parseNormalIndex(v,g),m=this.parseNormalIndex(l,g),this.addNormal(d,f,m)}else this.addFaceNormal(d,f,m);if(r!==void 0&&r!==""){let g=this.uvs.length;d=this.parseUVIndex(r,g),f=this.parseUVIndex(s,g),m=this.parseUVIndex(o,g),this.addUV(d,f,m),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";let e=this.vertices.length;for(let i=0,r=t.length;i<r;i++){let s=this.parseVertexIndex(t[i],e);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(t,e){this.object.geometry.type="Line";let i=this.vertices.length,r=this.uvs.length;for(let s=0,o=t.length;s<o;s++)this.addVertexLine(this.parseVertexIndex(t[s],i));for(let s=0,o=e.length;s<o;s++)this.addUVLine(this.parseUVIndex(e[s],r))}};return n.startObject("",!1),n}var Se=class extends y7{constructor(t){super(t),this.materials=null}load(t,e,i,r){let s=this,o=new _7(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(a){try{e(s.parse(a))}catch(v){r&&r(v),s.manager.itemError(t)}},i,r)}setMaterials(t){return this.materials=t,this}parse(t){let e=new T7;t.indexOf(`\r
|
|
447
|
+
}`;function w7(n){let t=document.createElement("style");t.innerHTML=n;let e=document.querySelector("head link[rel=stylesheet], head style");e?document.head.insertBefore(t,e):document.head.appendChild(t)}var I3=!1,nr=class n{constructor({parent:t,autoPlace:e=t===void 0,container:i,width:r,title:s="Controls",closeFolders:o=!1,injectStyles:a=!0,touchStyles:v=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",l=>{(l.code==="Enter"||l.code==="Space")&&(l.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),v&&this.domElement.classList.add("allow-touch-styles"),!I3&&a&&(w7(_7),I3=!0),i?i.appendChild(this.domElement):e&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=o}add(t,e,i,r,s){if(Object(i)===i)return new ir(this,t,e,i);switch(typeof t[e]){case"number":return new er(this,t,e,i,r,s);case"boolean":return new Xi(this,t,e);case"string":return new rr(this,t,e);case"function":return new y5(this,t,e)}}addColor(t,e,i=1){return new tr(this,t,e,i)}addFolder(t){let e=new n({parent:this,title:t});return this.root._closeFolders&&e.close(),e}load(t,e=!0){return t.controllers&&this.controllers.forEach(i=>{i instanceof y5||i._name in t.controllers&&i.load(t.controllers[i._name])}),e&&t.folders&&this.folders.forEach(i=>{i._title in t.folders&&i.load(t.folders[i._title])}),this}save(t=!0){let e={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof y5)){if(i._name in e.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);e.controllers[i._name]=i.save()}}),t&&this.folders.forEach(i=>{if(i._title in e.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);e.folders[i._title]=i.save()}),e}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let e=this.$children.clientHeight;this.$children.style.height=e+"px",this.domElement.classList.add("transition");let i=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);let r=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=r+"px"})}),this}title(t){return this._title=t,this.$title.innerHTML=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(e=>{t=t.concat(e.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(e=>{t=t.concat(e.foldersRecursive())}),t}},sr=nr;var Et=class{constructor(t,e,i,r){u(this,"gui",null);u(this,"storageKey","");u(this,"target");u(this,"params",[]);u(this,"paramsMeta",{});u(this,"_visible",!1);u(this,"initialValues",{});u(this,"initialized",!1);if(!R0){this.gui=new sr,this.storageKey=`debug_params_${t}`,this.target=e,this.paramsMeta=r??{},this.params=i??Object.keys(e);for(let s of this.params)this.initialValues[s]=e[s];this.gui.domElement.style.display="none"}}activate(){return R0?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return R0?!1:this._visible}set visible(t){R0||!this.gui||(this._visible=t,this.gui.domElement.style.display=t?"block":"none",this.saveVisibility())}loadSavedValues(){if(!R0)try{let t=localStorage.getItem(this.storageKey);if(t){let e=JSON.parse(t);for(let i of this.params)if(i in e){let r=e[i];r!==null&&(this.target[i]=r)}}}catch{}}saveValues(t=!1){if(!R0)try{let e={};for(let i of this.params)e[i]=this.target[i];t?localStorage.removeItem(this.storageKey):localStorage.setItem(this.storageKey,JSON.stringify(e))}catch{}}saveVisibility(){if(!R0)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch{}}setupControls(){if(!(R0||!this.gui)){this.gui.add(this,"visible").name("Show Controls"),this.gui.add({resetAll:()=>{if(this.gui){for(let t of this.params)this.target[t]=this.initialValues[t];this.saveValues(!0),this.gui.destroy(),this.gui=new sr,this.setupControls()}}},"resetAll").name("Reset All Parameters");for(let t of this.params){let e=this.target[t],i=this.paramsMeta[t]??{};if(typeof e=="number"){let r=i.min??e-Math.abs(e*2),s=i.max??e+Math.abs(e*2),o=i.step??Math.abs(e)/100;this.gui.add(this.target,t,r,s,o).onChange(()=>this.saveValues())}else if(typeof e=="boolean")this.gui.add(this.target,t).onChange(()=>this.saveValues());else if(typeof e=="string"&&["x","y","z"].includes(t)){let r=i.min??-10,s=i.max??10,o=i.step??.1;this.gui.add(this.target,t,r,s,o).onChange(()=>this.saveValues())}else Array.isArray(e)&&this.gui.add(this.target,t,e).onChange(()=>this.saveValues())}}}save(){R0||(this.saveValues(),this.saveVisibility())}destroy(){R0||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};x();R();M();k();x();R();M();k();var x1=class{constructor(){u(this,"currentAnimation",null);u(this,"isAnimating",!1);u(this,"cancelRequested",!1);u(this,"completionCallbacks",[]);u(this,"currentCancelCallback",null)}async startAnimation(t,e){return this.isAnimating&&await this.cancelCurrentAnimation(),new Promise(i=>{this.isAnimating=!0,this.cancelRequested=!1,this.currentCancelCallback=e??null,this.currentAnimation=t(),this.completionCallbacks.push(()=>{this.isAnimating=!1,this.currentAnimation=null,i()})})}async cancelCurrentAnimation(){if(this.isAnimating){if(this.currentCancelCallback){let t=this.currentCancelCallback;this.currentCancelCallback=null,t()}return new Promise(t=>{this.cancelRequested=!0,this.completionCallbacks.push(()=>{t()})})}}animationCycleFinish(){this.cancelRequested&&this.forceFinish()}forceFinish(t=!0){if(!this.isAnimating)return;if(this.currentAnimation){for(let i of this.currentAnimation.getAll())i.stop();this.currentAnimation.removeAll(),this.currentAnimation=null}this.isAnimating=!1,this.cancelRequested=!1;let e=[...this.completionCallbacks];if(this.completionCallbacks=[],t)for(let i of e)i()}update(){this.currentAnimation&&this.currentAnimation.update()}get isActive(){return this.isAnimating}get shouldCancel(){return this.cancelRequested}};var A7={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},ne=class{constructor(t,e,i){this.getState=t;this.setState=e;u(this,"animationController",new x1);u(this,"defaultState");u(this,"speeds");u(this,"currentStateName","");u(this,"transitioningToStateName","");this.speeds={...A7},i&&Object.assign(this.speeds,i),this.defaultState=this.getState()}calculateDuration(t){let e=0,i=this.getState();for(let[r,s]of Object.entries(t)){let o=i[r],a=Math.abs(s-o),v=this.getPropertySpeed(r),l=a/v*1e3;e=Math.max(e,l)}return Math.min(Math.max(e,200),2e3)}getPropertySpeed(t){return t in this.speeds?this.speeds[t]:t.toLowerCase().includes("rotation")?this.speeds.rotation:t.toLowerCase().includes("scale")?this.speeds.scale:t.toLowerCase()==="x"||t.toLowerCase()==="y"||t.toLowerCase()==="z"?this.speeds[t]:this.speeds.default}startTransition(t,e,i,r=I0.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=e??"";let o=this.getState(),a=this.calculateDuration(t);this.animationController.startAnimation(()=>{let v=new ye;return new O0(o,v).to(t,a).easing(r).onUpdate(l=>{for(let c of Object.keys(l))this.setState(c,l[c])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",i?.()}).start(),v},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(t,e,i,r){this.startTransition(t,e,i,I0.Linear.None,r)}getCurrentValue(t){return this.getState()[t]}get isTransitioning(){return this.animationController.isActive}};x();R();M();k();import{subscribeKey as E7}from"valtio/utils";function R1(n,t,e,i,r){let s=0,o,a=async()=>{let v=++s,l=await n(t[e]);v===s?(o&&r?.(o),i(l),o=l):r?.(l)};return a(),E7(t,e,a)}x();R();M();k();var H3=Math.PI/180;function k1(n){let{walkDist:t,prevWalkDist:e,bob:i,prevBob:r,partialTick:s}=n,o=t-e,a=-(t+o*s),v=r+(i-r)*s,l=Math.sin(a*Math.PI),c=Math.cos(a*Math.PI);return{position:{x:l*v*.5,y:-Math.abs(c*v)},rotation:{x:Math.abs(Math.cos(a*Math.PI-.2)*v)*5*H3,z:l*v*3*H3}}}x();R();M();k();var M1=n=>({"minecraft:display_context":"firstperson","minecraft:use_duration":n.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!n.playerStateReactive.itemUsageTicks}),x7=()=>({"minecraft:display_context":"firstperson"}),Ce=(n,t)=>{if(!t)return"empty";if(t.type==="hand")return"hand";let e=t.name??(t.id!==void 0?`#${t.id}`:"unknown");if(!n.resourcesManager.currentResources)return`${t.type}:${e}`;let i=n.getItemRenderData({...t.fullItem,itemId:t.id},x7());return`${t.type}:${e}:${i.modelName}`};var j0=new S0.Matrix4,O3=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function R7(n,t){let e=new S0.Matrix4,i=1,r=Math.sqrt(n),s=-.3*Math.sin(r*Math.PI),o=.4*Math.sin(r*2*Math.PI),a=-.4*Math.sin(n*Math.PI);return e.multiply(j0.makeTranslation(i*(s+.64),o-.6+t*-.6,a-.72)),e.multiply(j0.makeRotationY(i*45*Math.PI/180)),e.multiply(j0.makeRotationY(i*Math.sin(r*Math.PI)*70*Math.PI/180)),e.multiply(j0.makeRotationZ(i*Math.sin(n*n*Math.PI)*-20*Math.PI/180)),e.multiply(j0.makeTranslation(i*-1,3.6,3.5)),e.multiply(j0.makeRotationZ(i*120*Math.PI/180)),e.multiply(j0.makeRotationX(200*Math.PI/180)),e.multiply(j0.makeRotationY(i*-135*Math.PI/180)),e.multiply(j0.makeTranslation(i*5.6,0,0)),e.multiply(j0.makeTranslation(i*-5/16,2/16,0)),e}function k7(n,t){let e=new S0.Matrix4,i=1,r=Math.sqrt(n),s=-.4*Math.sin(r*Math.PI),o=.2*Math.sin(r*2*Math.PI),a=-.2*Math.sin(n*Math.PI);e.multiply(j0.makeTranslation(i*s,o,a)),e.multiply(j0.makeTranslation(i*.56,-.52+t*-.6,-.72));let v=Math.sin(n*n*Math.PI),l=Math.sin(r*Math.PI);return e.multiply(j0.makeRotationY(i*(45+v*-20)*Math.PI/180)),e.multiply(j0.makeRotationZ(i*l*-20*Math.PI/180)),e.multiply(j0.makeRotationX(l*-80*Math.PI/180)),e.multiply(j0.makeRotationY(i*-45*Math.PI/180)),e}var w5=class{constructor(t,e=!1){this.worldRenderer=t;this.offHand=e;u(this,"holdingBlock");u(this,"blockSwapAnimation");u(this,"cameraGroup",new S0.Mesh);u(this,"armTransformGroup",new S0.Group);u(this,"camera",new S0.PerspectiveCamera(70,1,.05,100));u(this,"equipProgress",0);u(this,"stopUpdate",!1);u(this,"lastHeldItem");u(this,"lastHeldItemRenderKey");u(this,"currentDisplayType","hand");u(this,"isSwinging",!1);u(this,"nextIterStopCallbacks");u(this,"idleAnimator");u(this,"ready",!1);u(this,"lastUpdate",0);u(this,"xBob",0);u(this,"yBob",0);u(this,"lastBobUpdateTime",0);u(this,"lastBobWalkDist",0);u(this,"lastBobTickTime",0);u(this,"playerHand");u(this,"offHandDisplay",!1);u(this,"offHandModeLegacy",!1);u(this,"swingAnimator");u(this,"config");u(this,"disposed",!1);u(this,"unsubs",[]);u(this,"lastItemModelName");u(this,"switchRequest",0);this.initCameraGroup(),this.swingAnimator=new or,this.unsubs.push(this.worldRenderer.onReactivePlayerStateUpdated("heldItemMain",()=>{this.offHand||this.updateItem()},!1),this.worldRenderer.onReactivePlayerStateUpdated("heldItemOff",()=>{this.offHand&&this.updateItem()},!1)),this.config=t.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||A5().then(i=>{this.disposed||(this.playerHand=i,this.updateItem())}).then(()=>{if(this.disposed)return;let i=R1(async()=>A5(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",r=>{r&&(this.playerHand=r,this.updateItem())},r=>{x0(r,!0)});this.unsubs.push(i)})}dispose(){this.disposed=!0,this.unsubs.forEach(t=>t()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,x0(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&x0(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(x0(this.playerHand,!0),this.playerHand=void 0),this.ready=!1}updateItem(){if(!this.ready)return;let t=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;t?this.setNewItem(t):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new S0.Mesh,this.armTransformGroup=new S0.Group,this.armTransformGroup.matrixAutoUpdate=!1,this.cameraGroup.add(this.armTransformGroup)}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(t,e,i,r){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),(this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage)&&this.swingAnimator?.update(),this.blockSwapAnimation?.switcher.update();let o=new S0.Scene;o.add(this.cameraGroup);let a=e.getSize(new S0.Vector2),v=a.height>a.width;v?this.camera.aspect!==1&&(this.camera.aspect=1,this.camera.updateProjectionMatrix()):this.camera.aspect!==t.aspect&&(this.camera.aspect=t.aspect,this.camera.updateProjectionMatrix()),this.updateCameraGroup(),o.add(i.clone()),o.add(r.clone());let{offHandDisplay:l}=this;if(l&&(this.cameraGroup.scale.x=-1),e.autoClear=!1,e.clearDepth(),v){let c=Math.min(a.width,a.height);l?e.setViewport(0,0,c,c):e.setViewport(a.width-c,0,c,c)}e.render(o,this.camera),v&&e.setViewport(0,0,a.width,a.height),l&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(t){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new ne(()=>({progress:this.equipProgress}),(r,s)=>{r==="progress"&&(this.equipProgress=s)},{progress:4})});let e=t==="disappeared"?1:0,i=!1;return new Promise(r=>{this.blockSwapAnimation.switcher.transitionTo({progress:e},t,()=>{i||r(!0)},()=>{i=!0,r(!1)})})}isDifferentItem(t){return this.lastHeldItemRenderKey!==Ce(this.worldRenderer,t)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:t}=this,e=performance.now(),i=this.worldRenderer.cameraShake.getBaseRotation(),r=i.pitch,s=i.yaw;if(this.lastBobUpdateTime===0)this.xBob=r,this.yBob=s;else{let f=Math.min((e-this.lastBobUpdateTime)/1e3,.1),m=1-Math.pow(.5,f*28),g=1-Math.pow(.5,f*36);this.xBob+=(r-this.xBob)*m,this.yBob+=O3(s-this.yBob)*g}this.lastBobUpdateTime=e;let o=(r-this.xBob)*-.05,a=O3(s-this.yBob)*-.035;if(this.cameraGroup.position.copy(t.position),this.cameraGroup.rotation.copy(t.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let f=this.worldRenderer.playerStateReactive;f.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=e,this.lastBobWalkDist=f.walkDist);let m=Math.min((e-this.lastBobTickTime)/50,1),g=1.8,b=k1({walkDist:f.walkDist*g,prevWalkDist:f.prevWalkDist*g,bob:f.bob,prevBob:f.prevBob,partialTick:m});this.cameraGroup.position.x+=b.position.x,this.cameraGroup.position.y+=b.position.y,this.cameraGroup.rotation.z+=b.rotation.z,this.cameraGroup.rotation.x+=b.rotation.x}this.cameraGroup.rotation.x+=o,this.cameraGroup.rotation.y+=a;let l=this.currentDisplayType,c=this.swingAnimator?.getSwingProgress()??0,d;l==="hand"?d=R7(c,this.equipProgress):d=k7(c,this.equipProgress),this.armTransformGroup.matrix.copy(d),this.armTransformGroup.matrixWorldNeedsUpdate=!0}async createItemModel(t){if(this.lastUpdate=performance.now(),!t||t.type==="hand"&&!this.playerHand)return;let e;if(t.type==="item"||t.type==="block"){let i=this.worldRenderer.entities.getItemMesh({...t.fullItem,itemId:t.id},M1(this.worldRenderer),!1,this.lastItemModelName);if(i){let{mesh:r,isBlock:s,modelName:o}=i;s?(e=r,t.type="block"):(e=r,t.type="item"),this.lastItemModelName=o}}else e=this.playerHand;if(e){if(t.type==="item"||t.type==="block"){let i=new S0.Group;i.name="displayTransform",t.type==="item"?(i.position.set(1.13/16,3.2/16,1.13/16),i.rotation.set(0,S0.MathUtils.degToRad(-90),S0.MathUtils.degToRad(25),"XYZ"),i.scale.set(.68,.68,.68)):(i.rotation.set(0,S0.MathUtils.degToRad(45),0,"XYZ"),i.scale.set(.4,.4,.4)),i.add(e),e=i}return e.name="holdingBlock",{model:e,type:t.type}}}async replaceItemModel(t){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!t){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.currentDisplayType="hand";let i=this.swingAnimator;i?.stopSwing(),i&&(i.type="hand"),this.idleAnimator=void 0;return}let e=await this.createItemModel(t);e&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=e.model,this.currentDisplayType=e.type,this.armTransformGroup.add(e.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(t){let e=Ce(this.worldRenderer,t),i=this.lastHeldItemRenderKey!==e;if(this.lastHeldItem=t,!i)return;this.lastHeldItemRenderKey=e,this.lastItemModelName=void 0;let r=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock.removeFromParent(),this.holdingBlock!==this.playerHand&&x0(this.holdingBlock,!1),this.holdingBlock=void 0}if(!t){this.currentDisplayType="hand";let v=this.swingAnimator;v?.stopSwing(),v&&(v.type="hand"),this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(r!==this.switchRequest)return;let o=await this.createItemModel(t);if(!o||r!==this.switchRequest)return;this.holdingBlock=o.model,this.currentDisplayType=o.type,this.armTransformGroup.add(this.holdingBlock),s&&await this.playBlockSwapAnimation("appeared");let a=this.swingAnimator;a&&(a.type=o.type),this.idleAnimator=void 0}};var or=class{constructor(){u(this,"animationTimer",0);u(this,"lastTime",0);u(this,"isAnimating",!1);u(this,"stopRequested",!1);u(this,"swingProgress",0);u(this,"type","hand");u(this,"debugParams",{animationTime:250,animationStage:0});u(this,"debugGui");this.debugGui=new Et("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01}})}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.swingProgress=0;return}let t=performance.now(),e=(t-this.lastTime)/1e3;this.lastTime=t,this.animationTimer+=e*1e3;let i=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(i>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.swingProgress=0;return}this.animationTimer=0,this.swingProgress=0;return}this.swingProgress=i}getSwingProgress(){return this.swingProgress}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}},z3=(n,t,e,i,r)=>{let s=i.transformModel(t,{name:e,properties:{}});return Fi(n,[[s]],void 0,"plains",r)};x();R();M();k();import*as s0 from"three";function M7(n,t){let{depth:e,pixelSize:i}=t;if(n.width<=0||n.height<=0)throw new Error(`Invalid canvas dimensions: ${n.width}x${n.height}`);let s=n.getContext("2d").getImageData(0,0,n.width,n.height),{data:o}=s,a=n.width,v=n.height,l=e/2,c=i??1/Math.max(a,v),d=(P,I)=>{if(P<0||I<0||P>=a||I>=v)return!1;let N=(I*a+P)*4;return o[N+3]>128},f=[],m=[],g=[],b=[],A=0,_=(P,I,N,O,j,q,$,e0)=>(f.push(P,I,N),g.push(O,j),b.push(q,$,e0),A++),w=(P,I,N,O)=>{m.push(P,I,N,P,N,O)},T=(P,I)=>{let N=(P/a-.5)*c*a,O=-(I/v-.5)*c*v;return{x:N,y:O}},S=Array.from({length:v+1},()=>Array.from({length:a+1},()=>null)),C=Array.from({length:v+1},()=>Array.from({length:a+1},()=>null));for(let P=0;P<=v;P++)for(let I=0;I<=a;I++){let{x:N,y:O}=T(I-.5,P-.5),j=I/a,q=P/v,$=!1,e0=[[I-1,P-1],[I,P-1],[I-1,P],[I,P]];for(let[d0,l0]of e0)if(d(d0,l0)){$=!0;break}$&&(S[P][I]=_(N,O,l,j,q,0,0,1),C[P][I]=_(N,O,-l,j,q,0,0,-1))}for(let P=0;P<v;P++)for(let I=0;I<a;I++){if(!d(I,P))continue;let N=S[P][I],O=S[P][I+1],j=S[P+1][I+1],q=S[P+1][I],$=C[P][I],e0=C[P][I+1],d0=C[P+1][I+1],l0=C[P+1][I];N!==null&&O!==null&&j!==null&&q!==null&&w(N,O,j,q),$!==null&&e0!==null&&d0!==null&&l0!==null&&w(e0,$,l0,d0)}for(let P=0;P<v;P++)for(let I=0;I<a;I++){if(!d(I,P))continue;let N=(I+.5)/a,O=(P+.5)/v;if(!d(I-1,P)){let j=S[P][I],q=S[P+1][I],$=C[P][I],e0=C[P+1][I];if(j!==null&&q!==null&&$!==null&&e0!==null){let d0=_(f[j*3],f[j*3+1],f[j*3+2],N,O,-1,0,0),l0=_(f[q*3],f[q*3+1],f[q*3+2],N,O,-1,0,0),m0=_(f[e0*3],f[e0*3+1],f[e0*3+2],N,O,-1,0,0),p0=_(f[$*3],f[$*3+1],f[$*3+2],N,O,-1,0,0);w(d0,l0,m0,p0)}}if(!d(I+1,P)){let j=S[P+1][I+1],q=S[P][I+1],$=C[P+1][I+1],e0=C[P][I+1];if(j!==null&&q!==null&&$!==null&&e0!==null){let d0=_(f[j*3],f[j*3+1],f[j*3+2],N,O,1,0,0),l0=_(f[q*3],f[q*3+1],f[q*3+2],N,O,1,0,0),m0=_(f[e0*3],f[e0*3+1],f[e0*3+2],N,O,1,0,0),p0=_(f[$*3],f[$*3+1],f[$*3+2],N,O,1,0,0);w(d0,l0,m0,p0)}}if(!d(I,P-1)){let j=S[P][I],q=S[P][I+1],$=C[P][I],e0=C[P][I+1];if(j!==null&&q!==null&&$!==null&&e0!==null){let d0=_(f[j*3],f[j*3+1],f[j*3+2],N,O,0,-1,0),l0=_(f[q*3],f[q*3+1],f[q*3+2],N,O,0,-1,0),m0=_(f[e0*3],f[e0*3+1],f[e0*3+2],N,O,0,-1,0),p0=_(f[$*3],f[$*3+1],f[$*3+2],N,O,0,-1,0);w(d0,l0,m0,p0)}}if(!d(I,P+1)){let j=S[P+1][I+1],q=S[P+1][I],$=C[P+1][I+1],e0=C[P+1][I];if(j!==null&&q!==null&&$!==null&&e0!==null){let d0=_(f[j*3],f[j*3+1],f[j*3+2],N,O,0,1,0),l0=_(f[q*3],f[q*3+1],f[q*3+2],N,O,0,1,0),m0=_(f[e0*3],f[e0*3+1],f[e0*3+2],N,O,0,1,0),p0=_(f[$*3],f[$*3+1],f[$*3+2],N,O,0,1,0);w(d0,l0,m0,p0)}}}let H=new s0.BufferGeometry;return H.setAttribute("position",new s0.Float32BufferAttribute(f,3)),H.setAttribute("uv",new s0.Float32BufferAttribute(g,2)),H.setAttribute("normal",new s0.Float32BufferAttribute(b,3)),H.setIndex(m),H.computeVertexNormals(),{geometry:H,totalVertices:A,totalTriangles:m.length/3}}function T7(n,t){let{u:e,v:i,sizeX:r,sizeY:s}=t,o=Math.max(1,Math.floor(r*n.image.width)),a=Math.max(1,Math.floor(s*n.image.height)),v=document.createElement("canvas");v.width=o,v.height=a;let l=v.getContext("2d");return l.imageSmoothingEnabled=!1,l.drawImage(n.image,e*n.image.width,i*n.image.height,r*n.image.width,s*n.image.height,0,0,v.width,v.height),v}function D3(n,t,e={}){let{faceCamera:i=!1,use3D:r=!0,depth:s=.04}=e,{u:o,v:a,sizeX:v,sizeY:l}=t;if(i){let b=n.clone();b.flipY=!0,b.offset.set(o,1-a-l),b.repeat.set(v,l),b.needsUpdate=!0,b.magFilter=s0.NearestFilter,b.minFilter=s0.NearestFilter;let A=new s0.SpriteMaterial({map:b,transparent:!0,alphaTest:.1});return{mesh:new s0.Sprite(A),itemsTexture:b,cleanup(){b.dispose()}}}if(r)try{let b=T7(n,t),{geometry:A}=M7(b,{depth:s}),_=new s0.CanvasTexture(b);_.magFilter=s0.NearestFilter,_.minFilter=s0.NearestFilter,_.wrapS=_.wrapT=s0.ClampToEdgeWrapping,_.flipY=!1,_.needsUpdate=!0;let w=new s0.MeshStandardMaterial({map:_,side:s0.DoubleSide,transparent:!0,alphaTest:.1});return{mesh:new s0.Mesh(A,w),itemsTexture:_,cleanup(){_.dispose(),A.dispose(),w.map&&w.map.dispose(),w.dispose()}}}catch{}let c=n.clone();c.flipY=!0,c.offset.set(o,1-a-l),c.repeat.set(v,l),c.needsUpdate=!0,c.magFilter=s0.NearestFilter,c.minFilter=s0.NearestFilter;let d=c.clone();d.repeat.x*=-1,d.needsUpdate=!0,d.offset.set(o+v,1-a-l);let f=new s0.MeshStandardMaterial({map:c,transparent:!0,alphaTest:.1}),m=new s0.MeshStandardMaterial({map:d,transparent:!0,alphaTest:.1});return{mesh:new s0.Mesh(new s0.BoxGeometry(1,1,0),[new s0.MeshBasicMaterial({color:0}),new s0.MeshBasicMaterial({color:0}),new s0.MeshBasicMaterial({color:0}),new s0.MeshBasicMaterial({color:0}),f,m]),itemsTexture:c,itemsTextureFlipped:d,cleanup(){c.dispose(),d.dispose(),f.dispose(),m.dispose()}}}x();R();M();k();import*as J from"three";x();R();M();k();x();R();M();k();import{REVISION as S7}from"three";var F3=parseInt(S7.replace(/\D+/g,""));x();R();M();k();import{Loader as C7,FileLoader as B7,Group as P7,BufferGeometry as L3,Float32BufferAttribute as Be,LineBasicMaterial as ar,Material as U3,PointsMaterial as T1,MeshPhongMaterial as I7,LineSegments as G3,Points as vr,Mesh as N3,Vector3 as E5}from"three";var H7=/^[og]\s*(.+)?/,O7=/^mtllib /,z7=/^usemtl /,D7=/^usemap /,W3=new E5,lr=new E5,V3=new E5,j3=new E5,at=new E5;function F7(){let n={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}let i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(r,s){let o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);let a={index:this.materials.length,name:r||"",mtllib:Array.isArray(s)&&s.length>0?s[s.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(v){let l={index:typeof v=="number"?v:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(r){let s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.inherited=!1),r&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return r&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},i&&i.name&&typeof i.clone=="function"){let r=i.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(t,e){let i=parseInt(t,10);return(i>=0?i-1:i+e/3)*3},parseNormalIndex:function(t,e){let i=parseInt(t,10);return(i>=0?i-1:i+e/3)*3},parseUVIndex:function(t,e){let i=parseInt(t,10);return(i>=0?i-1:i+e/2)*2},addVertex:function(t,e,i){let r=this.vertices,s=this.object.geometry.vertices;s.push(r[t+0],r[t+1],r[t+2]),s.push(r[e+0],r[e+1],r[e+2]),s.push(r[i+0],r[i+1],r[i+2])},addVertexPoint:function(t){let e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){let e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){let r=this.normals,s=this.object.geometry.normals;s.push(r[t+0],r[t+1],r[t+2]),s.push(r[e+0],r[e+1],r[e+2]),s.push(r[i+0],r[i+1],r[i+2])},addFaceNormal:function(t,e,i){let r=this.vertices,s=this.object.geometry.normals;W3.fromArray(r,t),lr.fromArray(r,e),V3.fromArray(r,i),at.subVectors(V3,lr),j3.subVectors(W3,lr),at.cross(j3),at.normalize(),s.push(at.x,at.y,at.z),s.push(at.x,at.y,at.z),s.push(at.x,at.y,at.z)},addColor:function(t,e,i){let r=this.colors,s=this.object.geometry.colors;r[t]!==void 0&&s.push(r[t+0],r[t+1],r[t+2]),r[e]!==void 0&&s.push(r[e+0],r[e+1],r[e+2]),r[i]!==void 0&&s.push(r[i+0],r[i+1],r[i+2])},addUV:function(t,e,i){let r=this.uvs,s=this.object.geometry.uvs;s.push(r[t+0],r[t+1]),s.push(r[e+0],r[e+1]),s.push(r[i+0],r[i+1])},addDefaultUV:function(){let t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){let e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,r,s,o,a,v,l){let c=this.vertices.length,d=this.parseVertexIndex(t,c),f=this.parseVertexIndex(e,c),m=this.parseVertexIndex(i,c);if(this.addVertex(d,f,m),this.addColor(d,f,m),a!==void 0&&a!==""){let g=this.normals.length;d=this.parseNormalIndex(a,g),f=this.parseNormalIndex(v,g),m=this.parseNormalIndex(l,g),this.addNormal(d,f,m)}else this.addFaceNormal(d,f,m);if(r!==void 0&&r!==""){let g=this.uvs.length;d=this.parseUVIndex(r,g),f=this.parseUVIndex(s,g),m=this.parseUVIndex(o,g),this.addUV(d,f,m),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";let e=this.vertices.length;for(let i=0,r=t.length;i<r;i++){let s=this.parseVertexIndex(t[i],e);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(t,e){this.object.geometry.type="Line";let i=this.vertices.length,r=this.uvs.length;for(let s=0,o=t.length;s<o;s++)this.addVertexLine(this.parseVertexIndex(t[s],i));for(let s=0,o=e.length;s<o;s++)this.addUVLine(this.parseUVIndex(e[s],r))}};return n.startObject("",!1),n}var Pe=class extends C7{constructor(t){super(t),this.materials=null}load(t,e,i,r){let s=this,o=new B7(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(a){try{e(s.parse(a))}catch(v){r&&r(v),s.manager.itemError(t)}},i,r)}setMaterials(t){return this.materials=t,this}parse(t){let e=new F7;t.indexOf(`\r
|
|
448
448
|
`)!==-1&&(t=t.replace(/\r\n/g,`
|
|
449
449
|
`)),t.indexOf(`\\
|
|
450
450
|
`)!==-1&&(t=t.replace(/\\\n/g,""));let i=t.split(`
|
|
451
|
-
`),r="",s="",o=0,a=[],v=typeof"".trimLeft=="function";for(let d=0,f=i.length;d<f;d++)if(r=i[d],r=v?r.trimLeft():r.trim(),o=r.length,o!==0&&(s=r.charAt(0),s!=="#")){if(s==="v"){let m=r.split(/\s+/);switch(m[0]){case"v":e.vertices.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3])),m.length>=7?e.colors.push(parseFloat(m[4]),parseFloat(m[5]),parseFloat(m[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3]));break;case"vt":e.uvs.push(parseFloat(m[1]),parseFloat(m[2]));break}}else if(s==="f"){let g=r.substr(1).trim().split(/\s+/),b=[];for(let _=0,w=g.length;_<w;_++){let
|
|
451
|
+
`),r="",s="",o=0,a=[],v=typeof"".trimLeft=="function";for(let d=0,f=i.length;d<f;d++)if(r=i[d],r=v?r.trimLeft():r.trim(),o=r.length,o!==0&&(s=r.charAt(0),s!=="#")){if(s==="v"){let m=r.split(/\s+/);switch(m[0]){case"v":e.vertices.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3])),m.length>=7?e.colors.push(parseFloat(m[4]),parseFloat(m[5]),parseFloat(m[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3]));break;case"vt":e.uvs.push(parseFloat(m[1]),parseFloat(m[2]));break}}else if(s==="f"){let g=r.substr(1).trim().split(/\s+/),b=[];for(let _=0,w=g.length;_<w;_++){let T=g[_];if(T.length>0){let S=T.split("/");b.push(S)}}let A=b[0];for(let _=1,w=b.length-1;_<w;_++){let T=b[_],S=b[_+1];e.addFace(A[0],T[0],S[0],A[1],T[1],S[1],A[2],T[2],S[2])}}else if(s==="l"){let m=r.substring(1).trim().split(" "),g=[],b=[];if(r.indexOf("/")===-1)g=m;else for(let A=0,_=m.length;A<_;A++){let w=m[A].split("/");w[0]!==""&&g.push(w[0]),w[1]!==""&&b.push(w[1])}e.addLineGeometry(g,b)}else if(s==="p"){let g=r.substr(1).trim().split(" ");e.addPointGeometry(g)}else if((a=H7.exec(r))!==null){let m=(" "+a[0].substr(1).trim()).substr(1);e.startObject(m)}else if(z7.test(r))e.object.startMaterial(r.substring(7).trim(),e.materialLibraries);else if(O7.test(r))e.materialLibraries.push(r.substring(7).trim());else if(!D7.test(r)){if(s==="s"){if(a=r.split(" "),a.length>1){let g=a[1].trim().toLowerCase();e.object.smooth=g!=="0"&&g!=="off"}else e.object.smooth=!0;let m=e.object.currentMaterial();m&&(m.smooth=e.object.smooth)}else if(r==="\0")continue}}e.finalize();let l=new P7;if(l.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let d=0,f=e.objects.length;d<f;d++){let m=e.objects[d],g=m.geometry,b=m.materials,A=g.type==="Line",_=g.type==="Points",w=!1;if(g.vertices.length===0)continue;let T=new L3;T.setAttribute("position",new Be(g.vertices,3)),g.normals.length>0&&T.setAttribute("normal",new Be(g.normals,3)),g.colors.length>0&&(w=!0,T.setAttribute("color",new Be(g.colors,3))),g.hasUVIndices===!0&&T.setAttribute("uv",new Be(g.uvs,2));let S=[];for(let H=0,P=b.length;H<P;H++){let I=b[H],N=I.name+"_"+I.smooth+"_"+w,O=e.materials[N];if(this.materials!==null){if(O=this.materials.create(I.name),A&&O&&!(O instanceof ar)){let j=new ar;U3.prototype.copy.call(j,O),j.color.copy(O.color),O=j}else if(_&&O&&!(O instanceof T1)){let j=new T1({size:10,sizeAttenuation:!1});U3.prototype.copy.call(j,O),j.color.copy(O.color),j.map=O.map,O=j}}O===void 0&&(A?O=new ar:_?O=new T1({size:1,sizeAttenuation:!1}):O=new I7,O.name=I.name,O.flatShading=!I.smooth,O.vertexColors=w,e.materials[N]=O),S.push(O)}let C;if(S.length>1){for(let H=0,P=b.length;H<P;H++){let I=b[H];T.addGroup(I.groupStart,I.groupCount,H)}A?C=new G3(T,S):_?C=new vr(T,S):C=new N3(T,S)}else A?C=new G3(T,S[0]):_?C=new vr(T,S[0]):C=new N3(T,S[0]);C.name=m.name,l.add(C)}else if(e.vertices.length>0){let d=new T1({size:1,sizeAttenuation:!1}),f=new L3;f.setAttribute("position",new Be(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(f.setAttribute("color",new Be(e.colors,3)),d.vertexColors=!0);let m=new vr(f,d);l.add(m)}return l}};x();R();M();k();import{InstancedBufferGeometry as L7,Float32BufferAttribute as Y3,InstancedInterleavedBuffer as Q3,InterleavedBufferAttribute as S1,WireframeGeometry as U7,Box3 as J3,Sphere as G7,Vector3 as N7}from"three";var K3=new J3,C1=new N7,se=class extends L7{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new Y3(t,3)),this.setAttribute("uv",new Y3(e,2))}applyMatrix4(t){let e=this.attributes.instanceStart,i=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),i.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let i=new Q3(e,6,1);return this.setAttribute("instanceStart",new S1(i,3,0)),this.setAttribute("instanceEnd",new S1(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t,e=3){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));let r=new Q3(i,e*2,1);return this.setAttribute("instanceColorStart",new S1(r,e,0)),this.setAttribute("instanceColorEnd",new S1(r,e,e)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new U7(t.geometry)),this}fromLineSegments(t){let e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new J3);let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),K3.setFromBufferAttribute(e),this.boundingBox.union(K3))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new G7),this.boundingBox===null&&this.computeBoundingBox();let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){let i=this.boundingSphere.center;this.boundingBox.getCenter(i);let r=0;for(let s=0,o=t.count;s<o;s++)C1.fromBufferAttribute(t,s),r=Math.max(r,i.distanceToSquared(C1)),C1.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(C1));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)}}toJSON(){}applyMatrix(t){return this.applyMatrix4(t)}};x();R();M();k();import{Mesh as j7,InstancedInterleavedBuffer as Y7,InterleavedBufferAttribute as X3,Vector3 as es,Vector4 as Q7}from"three";x();R();M();k();import{ShaderMaterial as W7,UniformsUtils as q3,UniformsLib as Z3,Vector2 as V7}from"three";var oe=class extends W7{constructor(t){super({type:"LineMaterial",uniforms:q3.clone(q3.merge([Z3.common,Z3.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new V7(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
|
|
452
452
|
#include <common>
|
|
453
453
|
#include <fog_pars_vertex>
|
|
454
454
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -851,12 +851,12 @@ var v6=Object.create;var Ye=Object.defineProperty;var l6=Object.getOwnPropertyDe
|
|
|
851
851
|
gl_FragColor = diffuseColor;
|
|
852
852
|
|
|
853
853
|
#include <tonemapping_fragment>
|
|
854
|
-
#include <${
|
|
854
|
+
#include <${F3>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
855
855
|
#include <fog_fragment>
|
|
856
856
|
#include <premultiplied_alpha_fragment>
|
|
857
857
|
|
|
858
858
|
}
|
|
859
|
-
`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(e){!!e!="USE_DASH"in this.defines&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){!!e!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)}};var Y3=new K3,Q3=new K3,or=new z7,y5=class extends H7{constructor(t=new ee,e=new ie({color:Math.random()*16777215})){super(t,e),this.isWireframe=!0,this.type="Wireframe"}computeLineDistances(){let t=this.geometry,e=t.attributes.instanceStart,i=t.attributes.instanceEnd,r=new Float32Array(2*e.count);for(let o=0,a=0,v=e.count;o<v;o++,a+=2)Y3.fromBufferAttribute(e,o),Q3.fromBufferAttribute(i,o),r[a]=a===0?0:r[a-1],r[a+1]=r[a]+Y3.distanceTo(Q3);let s=new O7(r,2,1);return t.setAttribute("instanceDistanceStart",new j3(s,1,0)),t.setAttribute("instanceDistanceEnd",new j3(s,1,1)),this}onBeforeRender(t){let e=this.material.uniforms;e&&e.resolution&&(t.getViewport(or),this.material.uniforms.resolution.value.set(or.z,or.w))}};import{GLTFLoader as A8}from"three/examples/jsm/loaders/GLTFLoader.js";import E8 from"mc-assets/dist/other-textures/latest/entity/zombie/husk.png";import{Vec3 as x1}from"vec3";import x8 from"mc-assets/dist/other-textures/latest/entity/cat/ocelot.png";import R8 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/arrow.png";import k8 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/spectral_arrow.png";import T8 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/tipped_arrow.png";var J3={armor_stand:{identifier:"minecraft:armor_stand",min_engine_version:"1.8.0",materials:{default:"armor_stand"},textures:{default:"textures/entity/armorstand/wood"},geometry:{default:{bones:[{name:"baseplate",parent:"waist",cubes:[{origin:[-6,0,-6],size:[12,1,12],uv:[0,32]}]},{name:"waist",pivot:[0,12,0]},{name:"body",parent:"waist",pivot:[0,13,0],cubes:[{origin:[-6,21,-1.5],size:[12,3,3],uv:[0,26]},{origin:[-3,14,-1],size:[2,7,2],uv:[16,0]},{origin:[1,14,-1],size:[2,7,2],uv:[48,16]},{origin:[-4,12,-1],size:[8,2,2],uv:[0,48]}]},{name:"head",parent:"waist",pivot:[0,12,0],cubes:[{origin:[-1,24,-1],size:[2,7,2],uv:[0,0]}]},{name:"hat",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0]}]},{name:"leftarm",parent:"waist",mirror:!0,pivot:[5,10,0],cubes:[{origin:[5,12,-1],size:[2,12,2],uv:[32,16]}]},{name:"leftitem",parent:"leftarm",pivot:[1,-9,-5]},{name:"leftleg",parent:"waist",mirror:!0,pivot:[1.9,1,0],cubes:[{origin:[.9,1,-1],size:[2,11,2],uv:[40,16]}]},{name:"rightarm",parent:"waist",pivot:[-5,10,0],cubes:[{origin:[-7,12,-1],size:[2,12,2],uv:[24,0]}]},{name:"rightitem",parent:"rightarm",pivot:[-1,-9,-5]},{name:"rightleg",parent:"waist",pivot:[-1.9,1,0],cubes:[{origin:[-2.9,1,-1],size:[2,11,2],uv:[8,0]}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64}},render_controllers:["controller.render.armor_stand"],enable_attachables:!0},arrow:{identifier:"minecraft:arrow",materials:{default:"arrow"},textures:{default:"textures/entity/arrow"},geometry:{default:{bones:[{name:"body",pivot:[0,1,0],cubes:[{origin:[0,-2.5,-3],rotation:[0,0,45],size:[0,5,16],uv:{east:{uv:[0,0]}}},{origin:[0,-2.5,-3],rotation:[0,0,-45],size:[0,5,16],uv:{east:{uv:[0,0]}}},{origin:[-2.5,-2.5,12],rotation:[0,0,45],size:[5,5,0],uv:{south:{uv:[0,5]}}}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.arrow"]},bat:{_comment:"Wing tip mirror flags are swapped vs vanilla Bedrock model: our addCube() mirror implementation flips UVs in the opposite direction, so rightWingTip needs mirror=true and leftWingTip needs mirror=false to render correctly.",identifier:"minecraft:bat",materials:{default:"bat"},textures:{default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAALHSURBVHja7VrBSiQxFJybHvci6G1gF2TBwyoKelnWy55kWYS9ePDmD+in+KcevLb7GgpqipeeTkzPpGdewSNJmx6nKtXJS3oWiwTOv33pbs6Ou9vr731YHddQ5/ZiAHa/9cXnjLln62DyLALIL48P+4AIQ+RZAP2cnO909/PH4uvRQcdh1zSqwCMPIiDPIqwT8uHufMVJuDfnOxnhq9OT7vHPZR9WZxEgSjUBUi7IcQBG++XpphfB6rgvVwCQ//f7og8WAeL8F6Kr6oD7X8s+PPuOmQNYAAsIUOIAkDeSLIK1LeCMagIweZQ8iRkBlJuYl5gwSlxjZ2R9KM/2XBphsyxEQGhfOCEVNQXQ0UZdo2i21+edR57DmxjZFRpTCaD2/7QAXsAFcEKq3zYEGHJBtgCeC97f3vtnG0uY1e1aavQ3/QgMuaBoDtCsDyWv3yqSlxhpTClAygXZArAILIaS8ezOo52TIJVA1/sqAswRnhCfEoAnuqGkZwpbZxJfyflTQuysAN7GxxNiZ62fEoCFMBGqpcK8h8ckqIkRoiU3VPkHIM/2R4rMaTLK0pGr9oVrw9v7Iy/QDLFEAH5umxTAW9utreTHOuD1+e/KaQ4mrGrb1ykE0L07HODFmKMsJs1b2GYfAc0MdYPEThiTvIA8DjWayNxSs3pJePPDOvJNCKDL27r22L95AlRJXaewuh57cVuPx7Acen1VlNkIoKR0++udCer84PXn42wj660EW38BooS99rqTn1R/FkCTnibyAH3l5bW9GOqjx+Wa8TWVCXpn/NzW63oIote1bH6HlSKUK0BKkFkIgDSX01+taz9+vTV0X/MC6Hu+1OFmSb9tHp6MRopIrQgBAjMDtr2bfOvb3KTIP2vZy9HnvH6vXJD6ZdheOYAJl/yOZ/YCMOFYygKBQCAQCAQCgUAgEAgEAoFAIBDYKXwAXSs8dJ1Ggb4AAAAASUVORK5CYII="},geometry:{default:{texturewidth:64,textureheight:64,visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],bones:[{name:"head",pivot:[0,24,0],cubes:[{origin:[-3,21,-3],size:[6,6,6],uv:[0,0]}]},{name:"rightEar",pivot:[0,24,0],cubes:[{origin:[-4,26,-2],size:[3,4,1],uv:[24,0]}],parent:"head"},{name:"leftEar",mirror:!0,pivot:[0,24,0],cubes:[{origin:[1,26,-2],size:[3,4,1],uv:[24,0]}],parent:"head"},{name:"body",pivot:[0,24,0],cubes:[{origin:[-3,8,-3],size:[6,12,6],uv:[0,16]},{origin:[-5,-8,0],size:[10,16,1],uv:[0,34]}]},{name:"rightWing",pivot:[0,24,0],cubes:[{origin:[-12,7,1.5],size:[10,16,1],uv:[42,0]}],parent:"body"},{name:"rightWingTip",mirror:!0,pivot:[-12,23,1.5],cubes:[{origin:[-20,10,1.5],size:[8,12,1],uv:[24,16]}],parent:"rightWing"},{name:"leftWing",mirror:!0,pivot:[0,24,0],cubes:[{origin:[2,7,1.5],size:[10,16,1],uv:[42,0]}],parent:"body"},{name:"leftWingTip",pivot:[12,23,1.5],cubes:[{origin:[12,10,1.5],size:[8,12,1],uv:[24,16]}],parent:"leftWing"}]}},render_controllers:["controller.render.bat"],spawn_egg:{texture:"spawn_egg",texture_index:18}},bee:{identifier:"minecraft:bee",materials:{default:"bee"},textures:{default:"textures/entity/bee/bee",angry:"textures/entity/bee/bee_angry",nectar:"textures/entity/bee/bee_nectar",angry_nectar:"textures/entity/bee/bee_angry_nectar"},geometry:{default:{texturewidth:64,textureheight:64,visible_bounds_width:1.5,visible_bounds_height:1.5,visible_bounds_offset:[0,.25,0],bones:[{name:"body",pivot:[.5,5,0],cubes:[{origin:[-3,2,-5],size:[7,7,10],uv:[0,0]},{origin:[2,7,-8],size:[1,2,3],uv:[2,0]},{origin:[-2,7,-8],size:[1,2,3],uv:[2,3]}],locators:{lead:[0,4,-1]}},{name:"stinger",parent:"body",pivot:[.5,6,1],cubes:[{origin:[.5,5,5],size:[0,1,2],uv:[26,7]}]},{name:"rightwing_bone",parent:"body",pivot:[-1,9,-3],rotation:[15,-15,0],cubes:[{origin:[-10,9,-3],size:[9,0,6],uv:[0,18]}]},{name:"leftwing_bone",parent:"body",pivot:[2,9,-3],rotation:[15,15,0],cubes:[{origin:[2,9,-3],size:[9,0,6],uv:[9,24]}]},{name:"leg_front",parent:"body",pivot:[2,2,-2],cubes:[{origin:[-3,0,-2],size:[7,2,0],uv:[26,1]}]},{name:"leg_mid",parent:"body",pivot:[2,2,0],cubes:[{origin:[-3,0,0],size:[7,2,0],uv:[26,3]}]},{name:"leg_back",parent:"body",pivot:[2,2,2],cubes:[{origin:[-3,0,2],size:[7,2,0],uv:[26,5]}]}]}},particle_effects:{nectar_dripping:"minecraft:nectar_drip_particle"},render_controllers:["controller.render.bee"],spawn_egg:{texture:"egg_bee",texture_index:0}},cave_spider:{identifier:"minecraft:cave_spider",min_engine_version:"1.8.0",materials:{default:"spider",invisible:"spider_invisible"},textures:{default:"textures/entity/spider/cave_spider"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"head",pivot:[0,9,-3],cubes:[{origin:[-4,5,-11],size:[8,8,8],uv:[32,4]}],parent:"body0"},{name:"body0",pivot:[0,9,0],cubes:[{origin:[-3,6,-3],size:[6,6,6],uv:[0,0]}]},{name:"body1",pivot:[0,9,9],cubes:[{origin:[-5,5,3],size:[10,8,12],uv:[0,12]}],parent:"body0"},{name:"leg0",pivot:[-4,9,2],cubes:[{origin:[-19,8,1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg1",pivot:[4,9,2],cubes:[{origin:[3,8,1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg2",pivot:[-4,9,1],cubes:[{origin:[-19,8,0],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg3",pivot:[4,9,1],cubes:[{origin:[3,8,0],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg4",pivot:[-4,9,0],cubes:[{origin:[-19,8,-1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg5",pivot:[4,9,0],cubes:[{origin:[3,8,-1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg6",pivot:[-4,9,-1],cubes:[{origin:[-19,8,-2],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg7",pivot:[4,9,-1],cubes:[{origin:[3,8,-2],size:[16,2,2],uv:[18,0]}],parent:"body0"}]}},render_controllers:["controller.render.spider"],spawn_egg:{texture:"spawn_egg",texture_index:22}},chest_minecart:{identifier:"minecraft:chest_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},command_block_minecart:{identifier:"minecraft:command_block_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},cow:{identifier:"minecraft:cow",min_engine_version:"1.8.0",materials:{default:"cow"},textures:{default:"textures/entity/cow/cow"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.75,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-6,11,-5],size:[12,18,10],uv:[18,4]},{origin:[-2,11,-6],size:[4,6,1],uv:[52,0]}]},{name:"head",parent:"body",pivot:[0,20,-8],locators:{lead:[0,20,-8]},cubes:[{origin:[-4,16,-14],size:[8,8,6],uv:[0,0]},{origin:[-5,22,-12],size:[1,3,1],uv:[22,0]},{origin:[4,22,-12],size:[1,3,1],uv:[22,0]}]},{name:"leg0",parent:"body",pivot:[-4,12,7],cubes:[{origin:[-6,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[4,12,7],cubes:[{origin:[2,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-4,12,-6],cubes:[{origin:[-6,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[4,12,-6],cubes:[{origin:[2,0,-7],size:[4,12,4],uv:[0,16]}]}]}},render_controllers:["controller.render.cow"],spawn_egg:{texture:"spawn_egg",texture_index:1}},dragon_fireball:{identifier:"minecraft:dragon_fireball",materials:{default:"fireball"},textures:{default:"textures/entity/enderdragon/dragon_fireball"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},drowned:{identifier:"minecraft:drowned",min_engine_version:"1.16.0",materials:{default:"drowned"},textures:{default:"textures/entity/zombie/drowned"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}]},{name:"jacket",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.5}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0],inflate:.5}]},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:1}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-7,12,-2],size:[4,12,4],uv:[0,16]}]},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16],mirror:!0}]},{name:"rightSleeve",parent:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-7,12,-2],size:[4,12,4],uv:[48,48],inflate:.5}]},{name:"leftSleeve",parent:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,32],inflate:.5,mirror:!0}]},{name:"rightLeg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4.05,0,-2],size:[4,12,4],uv:[16,48]}]},{name:"leftLeg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[.05,0,-2],size:[4,12,4],uv:[32,48],mirror:!0}]},{name:"rightPants",parent:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-4.25,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]},{name:"leftPants",parent:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[.25,0,-2],size:[4,12,4],uv:[0,32],inflate:.25,mirror:!0}]},{name:"waist",parent:"body",pivot:[0,12,0]},{name:"rightItem",parent:"rightArm",pivot:[-1,-45,-5]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]}],visible_bounds_width:2.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64}},render_controllers:["controller.render.drowned"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:48}},egg:{identifier:"minecraft:egg",materials:{default:"egg"},textures:{default:"textures/items/egg"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},elder_guardian:{identifier:"minecraft:elder_guardian",min_engine_version:"1.8.0",materials:{default:"guardian",ghost:"guardian_ghost"},textures:{default:"textures/entity/guardian",elder:"textures/entity/guardian_elder",beam:"textures/entity/guardian_beam"},geometry:{default:{visible_bounds_width:3.5,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,0,0],mirror:!0,cubes:[{mirror:!1,origin:[-6,2,-8],size:[12,12,16],uv:[0,0]},{mirror:!1,origin:[-8,2,-6],size:[2,12,12],uv:[0,28]},{origin:[6,2,-6],size:[2,12,12],uv:[0,28]},{origin:[-6,14,-6],size:[12,2,12],uv:[16,40]},{origin:[-6,0,-6],size:[12,2,12],uv:[16,40]}]},{name:"eye",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,6,0],size:[2,2,1],uv:[8,0]}]},{name:"tailpart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-2,6,7],size:[4,4,8],uv:[40,0]}]},{name:"tailpart1",parent:"tailpart0",pivot:[0,24,0],cubes:[{origin:[0,7,0],size:[3,3,7],uv:[0,54]}]},{name:"tailpart2",parent:"tailpart1",pivot:[0,24,0],cubes:[{origin:[0,8,0],size:[2,2,6],uv:[41,32]},{origin:[1,4.5,3],size:[1,9,9],uv:[25,19]}]},{name:"spikepart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart1",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart2",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart3",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart4",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart5",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart6",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart7",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart8",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart9",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart10",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart11",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]}]},ghost:{visible_bounds_width:3.5,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,24,0],mirror:!0,cubes:[{mirror:!1,origin:[-6,2,-8],size:[12,12,16],uv:[0,0]},{mirror:!1,origin:[-8,2,-6],size:[2,12,12],uv:[0,28]},{origin:[6,2,-6],size:[2,12,12],uv:[0,28]},{origin:[-6,14,-6],size:[12,2,12],uv:[16,40]},{origin:[-6,0,-6],size:[12,2,12],uv:[16,40]}]},{name:"eye",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,7,0],size:[2,2,1],uv:[8,0]}]},{name:"tailpart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-2,6,7],size:[4,4,8],uv:[40,0]}]},{name:"tailpart1",parent:"tailpart0",pivot:[0,24,0],cubes:[{origin:[0,7,0],size:[3,3,7],uv:[0,54]}]},{name:"tailpart2",parent:"tailpart1",pivot:[0,24,0],cubes:[{origin:[0,8,0],size:[2,2,6],uv:[41,32]},{origin:[1,4.5,3],size:[1,9,9],uv:[25,19]}]},{name:"spikepart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart1",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart2",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart3",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart4",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart5",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart6",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart7",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart8",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart9",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart10",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart11",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]}]}},render_controllers:["controller.render.guardian"],spawn_egg:{texture:"spawn_egg",texture_index:36}},eye_of_ender:{identifier:"minecraft:eye_of_ender_signal",materials:{default:"eye_of_ender_signal"},textures:{default:"textures/items/ender_eye"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},ender_pearl:{identifier:"minecraft:ender_pearl",materials:{default:"ender_pearl"},textures:{default:"textures/items/ender_pearl"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},evoker_fangs:{identifier:"minecraft:evocation_fang",materials:{default:"fang"},textures:{default:"textures/entity/illager/evoker_fangs"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:64,textureheight:32,bones:[{name:"upper_jaw",parent:"base",pivot:[0,11,0],cubes:[{origin:[-1.5,0,-4],size:[4,14,8],uv:[40,0],inflate:.01}]},{name:"lower_jaw",parent:"base",pivot:[0,11,0],bind_pose_rotation:[0,180,0],cubes:[{origin:[-1.5,0,-4],size:[4,14,8],uv:[40,0]}]},{name:"base",pivot:[0,0,0],bind_pose_rotation:[0,90,0],cubes:[{origin:[-5,0,-5],size:[10,12,10],uv:[0,0]}]}]}},render_controllers:["controller.render.evocation_fang"]},evoker:{identifier:"minecraft:evocation_illager",min_engine_version:"1.8.0",materials:{default:"evoker"},textures:{default:"textures/entity/illager/evoker"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22]},{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]}]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],mirror:!0,cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],locators:{right_hand:[-6,12,0]},cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,46]}]},{name:"rightItem",pivot:[-5.5,16,.5],neverRender:!0,parent:"rightArm"},{name:"leftArm",parent:"body",pivot:[5,22,0],locators:{left_hand:[6,12,0]},mirror:!0,cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,46]}]}]}},particle_effects:{spell:"minecraft:evoker_spell"},render_controllers:["controller.render.evoker"],spawn_egg:{texture:"spawn_egg",texture_index:40}},experience_bottle:{identifier:"minecraft:xp_bottle",materials:{default:"xp_bottle"},textures:{default:"textures/items/experience_bottle",enchanted:"textures/misc/enchanted_item_glint"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.experience_bottle"]},experience_orb:{identifier:"minecraft:xp_orb",materials:{default:"experience_orb"},textures:{default:"textures/entity/experience_orb"},geometry:{default:{bones:[{name:"body",pivot:[8,8,0],cubes:[{origin:[0,0,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:64,textureheight:64}},render_controllers:["controller.render.experience_orb"]},fireball:{identifier:"minecraft:fireball",materials:{default:"fireball"},textures:{default:"textures/items/fire_charge"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},firework_rocket:{identifier:"minecraft:fireworks_rocket",materials:{default:"fireworks_rocket"},textures:{default:"textures/entity/fireworks"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],rotation:[0,90,0],size:[16,16,0],uv:{north:{uv:[0,0]}}},{origin:[-8,-8,0],rotation:[90,90,0],size:[16,16,0],uv:{north:{uv:[0,0]}}}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.fireworks_rocket"]},fishing_bobber:{identifier:"minecraft:fishing_hook",materials:{default:"fishing_hook"},textures:{default:"textures/entity/fishing_hook"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-1.5,-1.5,-1.5],size:[3,3,3],rotation:[0,0,180],uv:{up:{uv:[0,0]},down:{uv:[3,0]},south:{uv:[9,0],uv_size:[-3,3]},north:{uv:[9,0]},east:{uv:[12,0]},west:{uv:[15,0]}}},{origin:[0,-4.5,-.5],size:[0,3,3],uv:{east:{uv:[18,0]}}},{origin:[0,1.5,-1.5],size:[0,3,3],uv:{east:{uv:[21,0]}}},{origin:[-1.5,1.5,0],size:[3,3,0],uv:{north:{uv:[21,0]}}}]}],texturewidth:24,textureheight:3}},render_controllers:["controller.render.fishing_hook"]},hoglin:{identifier:"minecraft:hoglin",materials:{default:"hoglin"},textures:{default:"textures/entity/hoglin/hoglin"},geometry:{default:{bones:[{name:"body",pivot:[0,19,-3],cubes:[{origin:[-8,11,-7],size:[16,14,26],inflate:.02,uv:[1,1]},{origin:[0,22,-10],size:[0,10,19],inflate:.02,uv:[90,33]}],locators:{lead:[0,20,-5]}},{name:"head",parent:"body",pivot:[0,22,-5],rotation:[50,0,0],cubes:[{origin:[-7,21,-24],size:[14,6,19],uv:[61,1]},{origin:[-8,22,-19],size:[2,11,2],uv:[1,13]},{origin:[6,22,-19],size:[2,11,2],uv:[1,13]}]},{name:"right_ear",parent:"head",pivot:[-7,27,-7],rotation:[0,0,-50],cubes:[{origin:[-13,26,-10],size:[6,1,4],uv:[1,1]}]},{name:"left_ear",parent:"head",pivot:[7,27,-7],rotation:[0,0,50],cubes:[{origin:[7,26,-10],size:[6,1,4],uv:[1,6]}]},{name:"leg_back_right",pivot:[6,8,17],cubes:[{origin:[-8,0,13],size:[5,11,5],uv:[21,45]}]},{name:"leg_back_left",pivot:[-6,8,17],cubes:[{origin:[3,0,13],size:[5,11,5],uv:[0,45]}]},{name:"leg_front_right",pivot:[-6,12,-3],cubes:[{origin:[-8,0,-6],size:[6,14,6],uv:[66,42]}]},{name:"leg_front_left",pivot:[6,12,-3],cubes:[{origin:[2,0,-6],size:[6,14,6],uv:[41,42]}]}],visible_bounds_width:4,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:64}},spawn_egg:{base_color:"#C66E55",overlay_color:"#5f6464"},render_controllers:["controller.render.hoglin"]},hopper_minecart:{identifier:"minecraft:hopper_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},husk:{identifier:"minecraft:husk",min_engine_version:"1.8.0",materials:{default:"husk"},textures:{default:"textures/entity/zombie/husk"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],mirror:!0,parent:"body"}]}},scripts:{pre_animation:["variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;"]},animations:{humanoid_big_head:{loop:!0,bones:{head:{scale:1.4}}},look_at_target_default:{loop:!0,bones:{head:{relative_to:{rotation:"entity"},rotation:["query.target_x_rotation","query.target_y_rotation",0]}}},look_at_target_gliding:{loop:!0,bones:{head:{rotation:[-45,"query.target_y_rotation",0]}}},look_at_target_swimming:{loop:!0,bones:{head:{rotation:["math.lerp(query.target_x_rotation, -45.0, variable.swim_amount)","query.target_y_rotation",0]}}},move:{loop:!0,bones:{leftarm:{rotation:["variable.tcos0",0,0]},leftleg:{rotation:["variable.tcos0 * -1.4",0,0]},rightarm:{rotation:["-variable.tcos0",0,0]},rightleg:{rotation:["variable.tcos0 * 1.4",0,0]}}},"riding.arms":{loop:!0,bones:{leftarm:{rotation:[-36,0,0]},rightarm:{rotation:[-36,0,0]}}},"riding.legs":{loop:!0,bones:{leftleg:{rotation:["-72.0 - this","-18.0 - this","-this"]},rightleg:{rotation:["-72.0 - this","18.0 - this","-this"]}}},holding:{loop:!0,bones:{leftarm:{rotation:["variable.is_holding_left ? (-this * 0.5 - 18.0) : 0.0",0,0]},rightarm:{rotation:["variable.is_holding_right ? (-this * 0.5 - 18.0) : 0.0",0,0]}}},brandish_spear:{loop:!0,bones:{rightarm:{rotation:["this * -0.5 - 157.5 - 22.5 * variable.charge_amount","-this",0]}}},charging:{loop:!0,bones:{rightarm:{rotation:["22.5 * variable.charge_amount - this","-this",0]}}},"attack.rotations":{loop:!0,bones:{body:{rotation:[0,"math.sin(math.sqrt(variable.attack_time) * 360) * 11.46 - this",0]},leftarm:{rotation:["math.sin(math.sqrt(variable.attack_time) * 360) * 11.46",0,0]},rightarm:{rotation:["math.sin(1.0 - math.pow(1.0 - variable.attack_time, 3.0) * 180.0) * (variable.is_brandishing_spear ? -1.0 : 1.0 )","variable.is_brandishing_spear ? 0.0 : (math.sin(math.sqrt(variable.attack_time) * 360) * 11.46) * 2.0",0]}}},sneaking:{loop:!0,bones:{body:{rotation:["0.5 - this",0,0]},head:{position:[0,1,0]},leftarm:{rotation:[72,0,0]},leftleg:{position:[0,-3,4]},rightarm:{rotation:[72,0,0]},rightleg:{position:[0,-3,4]}}},bob:{loop:!0,bones:{leftarm:{rotation:[0,0,"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) *-1.0"]},rightarm:{rotation:[0,0,"(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},damage_nearby_mobs:{loop:!0,bones:{leftarm:{rotation:["-45.0-this","-this","-this"]},leftleg:{rotation:["45.0-this","-this","-this"]},rightarm:{rotation:["45.0-this","-this","-this"]},rightleg:{rotation:["-45.0-this","-this","-this"]}}},bow_and_arrow:{loop:!0,bones:{leftarm:{rotation:["query.target_x_rotation - 90.0 - math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation + 28.65","-(math.cos(query.life_time * 103.2) * 2.865) - 2.865"]},rightarm:{rotation:["query.target_x_rotation - 90.0 + math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation - 5.73","(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},use_item_progress:{loop:!0,bones:{rightarm:{rotation:["variable.use_item_startup_progress * -60.0 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -22.5 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -5.625 + variable.use_item_interval_progress * 11.25"]}}},zombie_attack_bare_hand:{loop:!0,bones:{leftarm:{rotation:["-90.0 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) - (math.sin(query.life_time * 76.776372) * 2.865) - this","5.73 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 0.6) - this","math.cos(query.life_time * 103.13244) * -2.865 - 2.865 - this"]},rightarm:{rotation:["90.0 * (variable.is_brandishing_spear - 1.0) - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) + (math.sin(query.life_time * 76.776372) * 2.865) - this","(math.sin(variable.attack_time * 180.0) * 57.3) * 0.6 - 5.73 - this","math.cos(query.life_time * 103.13244) * 2.865 + 2.865 - this"]}}},swimming:{loop:!0,bones:{body:{position:[0,"variable.swim_amount * -10.0 - this","variable.swim_amount * 9.0 - this"],rotation:["variable.swim_amount * (90.0 + query.target_x_rotation)",0,0]},leftarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) - (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, 14.325, variable.swim_amount) - (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},leftleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0 + 180.0) * 0.3, variable.swim_amount)",0,0]},rightarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) + (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, -14.325, variable.swim_amount) + (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},rightleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0) * 0.3, variable.swim_amount)",0,0]}}}},animation_controllers:{humanoid_baby_big_head:{initial_state:"default",states:{baby:{animations:["humanoid_big_head"],transitions:[{default:"!query.is_baby"}]},default:{transitions:[{baby:"query.is_baby"}]}}},look_at_target:{initial_state:"default",states:{default:{animations:["look_at_target_default"],transitions:[{gliding:"query.is_gliding"},{swimming:"query.is_swimming"}]},gliding:{animations:["look_at_target_gliding"],transitions:[{swimming:"query.is_swimming"},{default:"!query.is_gliding"}]},swimming:{animations:["look_at_target_swimming"],transitions:[{gliding:"query.is_gliding"},{default:"!query.is_swimming"}]}}},move:{initial_state:"default",states:{default:{animations:["move"]}}},riding:{initial_state:"default",states:{default:{transitions:[{riding:"query.is_riding"}]},riding:{animations:["riding.arms","riding.legs"],transitions:[{default:"!query.is_riding"}]}}},holding:{initial_state:"default",states:{default:{animations:["holding"]}}},brandish_spear:{initial_state:"default",states:{brandish_spear:{animations:["brandish_spear"],transitions:[{default:"!variable.is_brandishing_spear"}]},default:{transitions:[{brandish_spear:"variable.is_brandishing_spear"}]}}},charging:{initial_state:"default",states:{charging:{animations:["charging"],transitions:[{default:"!query.is_charging"}]},default:{transitions:[{charging:"query.is_charging"}]}}},attack:{initial_state:"default",states:{attacking:{animations:["attack.rotations"],transitions:[{default:"variable.attack_time < 0.0"}]},default:{transitions:[{attacking:"variable.attack_time >= 0.0"}]}}},sneaking:{initial_state:"default",states:{default:{transitions:[{sneaking:"query.is_sneaking"}]},sneaking:{animations:["sneaking"],transitions:[{default:"!query.is_sneaking"}]}}},bob:{initial_state:"default",states:{default:{animations:["bob"]}}},damage_nearby_mobs:{initial_state:"default",states:{damage_nearby_mobs:{animations:["damage_nearby_mobs"],transitions:[{default:"!variable.damage_nearby_mobs"}]},default:{transitions:[{damage_nearby_mobs:"variable.damage_nearby_mobs"}]}}},bow_and_arrow:{initial_state:"default",states:{bow_and_arrow:{animations:["bow_and_arrow"],transitions:[{default:"!query.has_target"}]},default:{transitions:[{bow_and_arrow:"query.has_target"}]}}},use_item_progress:{initial_state:"default",states:{default:{transitions:[{use_item_progress:"( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"}]},use_item_progress:{animations:["use_item_progress"],transitions:[{default:"( variable.use_item_interval_progress <= 0.0 ) && ( variable.use_item_startup_progress <= 0.0 )"}]}}},zombie_attack_bare_hand:{initial_state:"default",states:{default:{transitions:[{is_bare_hand:"variable.is_holding_left != 1.0"}]},is_bare_hand:{animations:["zombie_attack_bare_hand"],transitions:[{default:"variable.is_holding_left == 1.0"}]}}},swimming:{initial_state:"default",states:{default:{transitions:[{is_swimming:"variable.swim_amount > 0.0"}]},is_swimming:{animations:["swimming"],transitions:[{default:"variable.swim_amount <= 0.0"}]}}}},render_controllers:["controller.render.husk"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:28}},iron_golem:{identifier:"minecraft:iron_golem",materials:{default:"iron_golem"},textures:{default:"textures/entity/iron_golem/iron_golem"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:128,bones:[{name:"body",pivot:[0,31,0],cubes:[{origin:[-9,21,-6],size:[18,12,11],uv:[0,40]},{origin:[-4.5,16,-3],size:[9,5,6],uv:[0,70],inflate:.5}]},{name:"head",parent:"body",pivot:[0,31,-2],locators:{lead:[0,31,-2]},cubes:[{origin:[-4,33,-7.5],size:[8,10,8],uv:[0,0]},{origin:[-1,32,-9.5],size:[2,4,2],uv:[24,0]}]},{name:"arm0",parent:"body",pivot:[0,31,0],cubes:[{origin:[-13,3.5,-3],size:[4,30,6],uv:[60,21]}]},{name:"arm1",parent:"body",pivot:[0,31,0],cubes:[{origin:[9,3.5,-3],size:[4,30,6],uv:[60,58]}]},{name:"leg0",parent:"body",pivot:[-4,13,0],cubes:[{origin:[-7.5,0,-3],size:[6,16,5],uv:[37,0]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[5,13,0],cubes:[{origin:[1.5,0,-3],size:[6,16,5],uv:[60,0]}]}]}},render_controllers:["controller.render.iron_golem"]},item_frame:{identifier:"minecraft:item_frame",materials:{default:"item_frame"},textures:{background:"block:item_frame",frame:"block:oak_planks"},geometry:{background:{bones:[{name:"base"},{name:"background",parent:"base",rotation:[0,180,0],pivot:[0,0,0],cubes:[{origin:[-5,-5,-8],size:[10,10,.5],uv:[3,3]}]}],texturewidth:16,textureheight:16},frame:{bones:[{name:"frame",parent:"base",rotation:[0,180,0],pivot:[0,0,0],cubes:[{origin:[-6,-6,-8],size:[12,1,1],uv:[2,2]},{origin:[-6,5,-8],size:[12,1,1],uv:[2,13]},{origin:[-6,-5,-8],size:[1,10,1],uv:[2,3]},{origin:[5,-5,-8],size:[1,10,1],uv:[13,3]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_frame"]},leash_knot:{identifier:"minecraft:leash_knot",materials:{default:"leash_knot"},textures:{default:"textures/entity/lead_knot"},geometry:{default:{bones:[{name:"knot",rotation:[0,180,0],cubes:[{origin:[5,6,5],size:[6,8,6],uv:[0,0]}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.leash_knot"]},llama_spit:{identifier:"minecraft:llama_spit",materials:{default:"llama_spit"},textures:{default:"textures/entity/llama/spit"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,22,0],size:[2,2,2],uv:[0,0]},{origin:[0,26,0],size:[2,2,2],uv:[0,0]},{origin:[0,22,-4],size:[2,2,2],uv:[0,0]},{origin:[0,22,0],size:[2,2,2],uv:[0,0]},{origin:[2,22,0],size:[2,2,2],uv:[0,0]},{origin:[0,20,0],size:[2,2,2],uv:[0,0]},{origin:[0,22,2],size:[2,2,2],uv:[0,0]}]}]}},render_controllers:["controller.render.llama_spit"]},magma_cube:{identifier:"minecraft:magma_cube",materials:{default:"magma_cube"},textures:{default:"textures/entity/slime/magmacube"},geometry:{default:{visible_bounds_width:2.5,visible_bounds_height:5,visible_bounds_offset:[0,2.5,0],texturewidth:64,textureheight:32,bones:[{name:"bodyCube_0",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,7,-4],size:[8,1,8],uv:[0,0]}]},{name:"bodyCube_1",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,6,-4],size:[8,1,8],uv:[0,1]}]},{name:"bodyCube_2",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,5,-4],size:[8,1,8],uv:[24,10]}]},{name:"bodyCube_3",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,4,-4],size:[8,1,8],uv:[24,19]}]},{name:"bodyCube_4",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,3,-4],size:[8,1,8],uv:[0,4]}]},{name:"bodyCube_5",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,2,-4],size:[8,1,8],uv:[0,5]}]},{name:"bodyCube_6",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,1,-4],size:[8,1,8],uv:[0,6]}]},{name:"bodyCube_7",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,0,-4],size:[8,1,8],uv:[0,7]}]},{name:"insideCube",pivot:[0,0,0],cubes:[{origin:[-2,2,-2],size:[4,4,4],uv:[0,16]}]}]}},render_controllers:["controller.render.magma_cube"],spawn_egg:{texture:"spawn_egg",texture_index:20}},mooshroom:{identifier:"minecraft:mooshroom",min_engine_version:"1.8.0",materials:{default:"mooshroom"},textures:{default:"textures/entity/cow/red_mooshroom",brown:"textures/entity/cow/brown_mooshroom"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-6,11,-5],size:[12,18,10],uv:[18,4]},{origin:[-2,11,-6],size:[4,6,1],uv:[52,0]}]},{name:"head",pivot:[0,20,-8],locators:{lead:[0,20,-8]},cubes:[{origin:[-4,16,-14],size:[8,8,6],uv:[0,0]},{origin:[-5,22,-12],size:[1,3,1],uv:[22,0]},{origin:[4,22,-12],size:[1,3,1],uv:[22,0]}]},{name:"leg0",parent:"body",pivot:[-4,12,7],cubes:[{origin:[-6,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[4,12,7],cubes:[{origin:[2,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-4,12,-6],cubes:[{origin:[-6,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[4,12,-6],cubes:[{origin:[2,0,-7],size:[4,12,4],uv:[0,16]}]}]}},render_controllers:["controller.render.mooshroom"],spawn_egg:{texture:"spawn_egg",texture_index:5}},panda:{identifier:"minecraft:panda",materials:{default:"panda"},textures:{default:"textures/entity/panda/panda",lazy:"textures/entity/panda/lazy_panda",worried:"textures/entity/panda/worried_panda",playful:"textures/entity/panda/playful_panda",brown:"textures/entity/panda/brown_panda",weak:"textures/entity/panda/weak_panda",aggressive:"textures/entity/panda/aggressive_panda"},geometry:{default:{texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,12.5,-17],locators:{lead:[0,14,-16]},cubes:[{origin:[-6.5,7.5,-21],size:[13,10,9],uv:[0,6]},{origin:[-3.5,7.5,-23],size:[7,5,2],uv:[45,16]},{origin:[-8.5,16.5,-18],size:[5,4,1],uv:[52,25]},{origin:[3.5,16.5,-18],size:[5,4,1],uv:[52,25]}]},{name:"body",pivot:[0,14,0],bind_pose_rotation:[90,0,0],cubes:[{origin:[-9.5,1,-6.5],size:[19,26,13],uv:[0,25]}]},{name:"leg0",parent:"body",pivot:[-5.5,9,9],cubes:[{origin:[-8.5,0,6],size:[6,9,6],uv:[40,0]}]},{name:"leg1",parent:"body",pivot:[5.5,9,9],cubes:[{origin:[2.5,0,6],size:[6,9,6],uv:[40,0]}]},{name:"leg2",parent:"body",pivot:[-5.5,9,-9],cubes:[{origin:[-8.5,0,-12],size:[6,9,6],uv:[40,0]}]},{name:"leg3",parent:"body",pivot:[5.5,9,-9],cubes:[{origin:[2.5,0,-12],size:[6,9,6],uv:[40,0]}]}]}},render_controllers:["controller.render.panda"],spawn_egg:{texture:"spawn_egg",texture_index:54}},phantom:{identifier:"minecraft:phantom",materials:{default:"phantom",invisible:"phantom_invisible"},textures:{default:"textures/entity/phantom"},geometry:{default:{texturewidth:64,textureheight:64,bones:[{name:"body",pivot:[0,24,0],bind_pose_rotation:[0,0,0],cubes:[{origin:[-3,23,-8],size:[5,3,9],uv:[0,8]}]},{name:"wing0",pivot:[2,26,-8],bind_pose_rotation:[0,0,5.7],cubes:[{origin:[2,24,-8],size:[6,2,9],uv:[23,12]}],parent:"body"},{name:"wingtip0",pivot:[8,26,-8],bind_pose_rotation:[0,0,5.7],locators:{left_wing:[21,26,0]},cubes:[{origin:[8,25,-8],size:[13,1,9],uv:[16,24]}],parent:"wing0"},{name:"wing1",pivot:[-3,26,-8],bind_pose_rotation:[0,0,-5.7],mirror:!0,cubes:[{origin:[-9,24,-8],size:[6,2,9],uv:[23,12]}],parent:"body"},{name:"wingtip1",pivot:[-9,24,-8],bind_pose_rotation:[0,0,-5.7],locators:{right_wing:[-22,24,0]},mirror:!0,cubes:[{origin:[-22,25,-8],size:[13,1,9],uv:[16,24]}],parent:"wing1"},{name:"head",pivot:[0,23,-7],bind_pose_rotation:[11.5,0,0],cubes:[{origin:[-4,22,-12],size:[7,3,5],uv:[0,0]}],parent:"body"},{name:"tail",pivot:[0,26,1],bind_pose_rotation:[0,0,0],cubes:[{origin:[-2,24,1],size:[3,2,6],uv:[3,20]}],parent:"body"},{name:"tailtip",pivot:[0,25.5,7],bind_pose_rotation:[0,0,0],cubes:[{origin:[-1,24.5,7],size:[1,1,6],uv:[4,29]}],parent:"tail"}]}},particle_effects:{wing_dust:"minecraft:phantom_trail_particle"},sound_effects:{flap:"mob.phantom.flap"},render_controllers:["controller.render.phantom"],spawn_egg:{texture:"spawn_egg",texture_index:51}},pig:{identifier:"minecraft:pig",min_engine_version:"1.8.0",materials:{default:"pig"},textures:{default:"textures/entity/pig/pig",saddled:"textures/entity/pig/pig_saddle"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,13,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-5,7,-5],size:[10,16,8],uv:[28,8]}]},{name:"head",parent:"body",pivot:[0,12,-6],locators:{lead:[0,14,-6]},cubes:[{origin:[-4,8,-14],size:[8,8,8],uv:[0,0]},{origin:[-2,9,-15],size:[4,3,1],uv:[16,16]}]},{name:"leg0",parent:"body",pivot:[-3,6,7],cubes:[{origin:[-5,0,5],size:[4,6,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[3,6,7],cubes:[{origin:[1,0,5],size:[4,6,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-3,6,-5],cubes:[{origin:[-5,0,-7],size:[4,6,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[3,6,-5],cubes:[{origin:[1,0,-7],size:[4,6,4],uv:[0,16]}]}]}},render_controllers:["controller.render.pig"],spawn_egg:{texture:"spawn_egg",texture_index:2}},piglin_brute:{identifier:"minecraft:piglin_brute",materials:{default:"piglin_brute"},textures:{default:"textures/entity/piglin/piglin_brute"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]},{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.25}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-5,24,-4],size:[10,8,8],uv:[0,0],inflate:-.02},{origin:[-2,24,-5],size:[4,4,1],uv:[31,1]},{origin:[2,24,-5],size:[1,2,1],uv:[2,4]},{origin:[-3,24,-5],size:[1,2,1],uv:[2,0]}],inflate:-.02},{name:"leftear",parent:"head",pivot:[5,30,0],rotation:[0,0,-30],cubes:[{origin:[4,25,-2],size:[1,5,4],uv:[51,6]}]},{name:"rightear",parent:"head",pivot:[-5,30,0],rotation:[0,0,30],cubes:[{origin:[-5,25,-2],size:[1,5,4],uv:[39,6]}]},{name:"hat",parent:"head",pivot:[0,24,0]},{name:"rightarm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]},{origin:[-8,12,-2],size:[4,12,4],uv:[40,32],inflate:.25}]},{name:"rightItem",parent:"rightarm",pivot:[-1,-45,-5]},{name:"leftarm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[32,48]},{origin:[4,12,-2],size:[4,12,4],uv:[48,48],inflate:.25}]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]},{name:"rightleg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,16]},{origin:[-4,0,-2],size:[4,12,4],uv:[0,32],inflate:.25}]},{name:"leftleg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[16,48]},{origin:[0,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]}],visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:64}},spawn_egg:{base_color:"#592A10",overlay_color:"#F9F3A4"},render_controllers:["controller.render.piglin_brute"],enable_attachables:!0},polar_bear:{identifier:"minecraft:polar_bear",materials:{default:"polar_bear"},textures:{default:"textures/entity/bear/polarbear"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:128,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,14,-16],locators:{lead:[0,14,-16]},mirror:!0,cubes:[{mirror:!1,origin:[-3.5,10,-19],size:[7,7,7],uv:[0,0]},{mirror:!1,origin:[-2.5,10,-22],size:[5,3,3],uv:[0,44]},{mirror:!1,origin:[-4.5,16,-17],size:[2,2,1],uv:[26,0]},{origin:[2.5,16,-17],size:[2,2,1],uv:[26,0]}]},{name:"body",pivot:[-2,15,12],bind_pose_rotation:[90,0,0],cubes:[{origin:[-7,14,5],size:[14,14,11],uv:[0,19]},{origin:[-6,28,5],size:[12,12,10],uv:[39,0]}]},{name:"leg0",parent:"body",pivot:[-4.5,10,6],cubes:[{origin:[-6.5,0,4],size:[4,10,8],uv:[50,22]}]},{name:"leg1",parent:"body",pivot:[4.5,10,6],cubes:[{origin:[2.5,0,4],size:[4,10,8],uv:[50,22]}]},{name:"leg2",parent:"body",pivot:[-3.5,10,-8],cubes:[{origin:[-5.5,0,-10],size:[4,10,6],uv:[50,40]}]},{name:"leg3",parent:"body",pivot:[3.5,10,-8],cubes:[{origin:[1.5,0,-10],size:[4,10,6],uv:[50,40]}]}]}},render_controllers:["controller.render.polarbear"],spawn_egg:{texture:"spawn_egg",texture_index:37}},pufferfish:{identifier:"minecraft:pufferfish",min_engine_version:"1.8.0",materials:{default:"pufferfish"},textures:{default:"textures/entity/fish/pufferfish"},geometry:{default:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-1.5,0,-1.5],size:[3,2,3],uv:[0,27]},{origin:[.5,2,-1.5],size:[1,1,1],uv:[24,6]},{origin:[-1.5,2,-1.5],size:[1,1,1],uv:[28,6]}],locators:{lead:[0,0,0]}},{name:"tailfin",parent:"body",cubes:[{origin:[-1.5,1,1.5],size:[3,0,3],uv:[-3,0]}]},{name:"leftFin",parent:"body",pivot:[6.5,5,.5],cubes:[{origin:[1.5,0,-1.5],size:[1,1,2],uv:[25,0],mirror:!0}]},{name:"rightFin",parent:"body",pivot:[-6.5,5,.5],cubes:[{origin:[-2.5,0,-1.5],size:[1,1,2],uv:[25,0]}]}]},mid:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-2.5,1,-2.5],size:[5,5,5],uv:[12,22]}]},{name:"leftFin",parent:"body",pivot:[2.5,5,.5],cubes:[{origin:[2.5,4,-1.5],size:[2,1,2],uv:[24,3]}]},{name:"rightFin",parent:"body",pivot:[-2.5,5,.5],cubes:[{origin:[-4.5,4,-1.5],size:[2,1,2],uv:[24,0]}]},{name:"spines_top_front",parent:"body",bind_pose_rotation:[45,0,0],pivot:[0,6,-2.5],cubes:[{origin:[-2.5,6,-2.5],size:[5,1,0],uv:[19,17]}]},{name:"spines_top_back",parent:"body",bind_pose_rotation:[-45,0,0],pivot:[0,6,2.5],cubes:[{origin:[-2.5,6,2.5],size:[5,1,0],uv:[11,17]}]},{name:"spines_bottom_front",parent:"body",bind_pose_rotation:[-45,0,0],pivot:[0,1,-2.5],cubes:[{origin:[-2.5,0,-2.5],size:[5,1,0],uv:[18,20]}]},{name:"spines_bottom_back",parent:"body",bind_pose_rotation:[45,0,0],pivot:[0,1,2.5],rotation:[45,0,0],cubes:[{origin:[-2.5,0,2.5],size:[5,1,0],uv:[18,20]}]},{name:"spines_left_front",parent:"body",bind_pose_rotation:[0,45,0],pivot:[2.5,0,-2.5],rotation:[0,45,0],cubes:[{origin:[2.5,1,-2.5],size:[1,5,0],uv:[1,17]}]},{name:"spines_left_back",parent:"body",bind_pose_rotation:[0,-45,0],pivot:[2.5,0,2.5],rotation:[0,-45,0],cubes:[{origin:[2.5,1,2.5],size:[1,5,0],uv:[1,17]}]},{name:"spines_right_front",parent:"body",bind_pose_rotation:[0,-45,0],pivot:[-2.5,0,-2.5],rotation:[0,-45,0],cubes:[{origin:[-3.5,1,-2.5],size:[1,5,0],uv:[5,17]}]},{name:"spines_right_back",parent:"body",bind_pose_rotation:[0,45,0],pivot:[-2.5,0,2.5],rotation:[0,45,0],cubes:[{origin:[-3.5,1,2.5],size:[1,5,0],uv:[9,17]}]}]},large:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0]}]},{name:"leftFin",parent:"body",pivot:[4,7,1],cubes:[{origin:[4,6,-2.9904],size:[2,1,2],uv:[24,3]}]},{name:"rightFin",parent:"body",pivot:[-4,7,1],cubes:[{origin:[-5.9968,6,-2.992],size:[2,1,2],uv:[24,0]}]},{name:"spines_top_front",parent:"body",pivot:[-4,8,-4],bind_pose_rotation:[45,0,0],cubes:[{origin:[-4,8,-4],size:[8,1,1],uv:[14,16]}]},{name:"spines_top_mid",parent:"body",pivot:[0,8,0],cubes:[{origin:[-4,8,0],size:[8,1,1],uv:[14,16]}]},{name:"spines_top_back",parent:"body",pivot:[0,8,4],bind_pose_rotation:[-45,0,0],cubes:[{origin:[-4,8,4],size:[8,1,1],uv:[14,16]}]},{name:"spines_bottom_front",parent:"body",pivot:[0,0,-4],bind_pose_rotation:[-45,0,0],cubes:[{origin:[-4,-1,-4],size:[8,1,1],uv:[14,19]}]},{name:"spines_bottom_mid",parent:"body",pivot:[0,-1,0],cubes:[{origin:[-4,-1,0],size:[8,1,1],uv:[14,19]}]},{name:"spines_bottom_back",parent:"body",pivot:[0,0,4],bind_pose_rotation:[45,0,0],cubes:[{origin:[-4,-1,4],size:[8,1,1],uv:[14,19]}]},{name:"spines_left_front",parent:"body",pivot:[4,0,-4],bind_pose_rotation:[0,45,0],cubes:[{origin:[4,0,-4],size:[1,8,1],uv:[0,16]}]},{name:"spines_left_mid",parent:"body",pivot:[4,0,0],cubes:[{origin:[4,0,0],size:[1,8,1],uv:[4,16],mirror:!0}]},{name:"spines_left_back",parent:"body",pivot:[4,0,4],bind_pose_rotation:[0,-45,0],cubes:[{origin:[4,0,4],size:[1,8,1],uv:[8,16],mirror:!0}]},{name:"spines_right_front",parent:"body",pivot:[-4,0,-4],bind_pose_rotation:[0,-45,0],cubes:[{origin:[-5,0,-4],size:[1,8,1],uv:[4,16]}]},{name:"spines_right_mid",parent:"body",pivot:[-4,0,0],cubes:[{origin:[-5,0,0],size:[1,8,1],uv:[8,16]}]},{name:"spines_right_back",parent:"body",pivot:[-4,0,4],bind_pose_rotation:[0,45,0],cubes:[{origin:[-5,0,4],size:[1,8,1],uv:[8,16]}]}]}},render_controllers:[{"controller.render.pufferfish.small":"query.variant == 0"},{"controller.render.pufferfish.medium":"query.variant == 1"},{"controller.render.pufferfish.large":"query.variant == 2"}],spawn_egg:{texture:"spawn_egg",texture_index:46}},rabbit:{identifier:"minecraft:rabbit",min_engine_version:"1.8.0",materials:{default:"rabbit"},textures:{brown:"textures/entity/rabbit/brown",white:"textures/entity/rabbit/white",black:"textures/entity/rabbit/black",white_splotched:"textures/entity/rabbit/white_splotched",gold:"textures/entity/rabbit/gold",salt:"textures/entity/rabbit/salt",toast:"textures/entity/rabbit/toast"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"rearFootLeft",pivot:[3,6.5,3.7],mirror:!0,parent:"body",cubes:[{origin:[2,0,0],size:[2,1,7],uv:[8,24]}]},{name:"rearFootRight",pivot:[-3,6.5,3.7],mirror:!0,parent:"body",cubes:[{origin:[-4,0,0],size:[2,1,7],uv:[26,24]}]},{name:"haunchLeft",pivot:[3,6.5,3.7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[2,2.5,3.7],size:[2,4,5],uv:[16,15]}]},{name:"haunchRight",pivot:[-3,6.5,3.7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[-4,2.5,3.7],size:[2,4,5],uv:[30,15]}]},{name:"body",pivot:[0,5,8],bind_pose_rotation:[-20,0,0],mirror:!0,cubes:[{origin:[-3,2,-2],size:[6,5,10],uv:[0,0]}]},{name:"frontLegLeft",pivot:[3,7,-1],bind_pose_rotation:[-10,0,0],mirror:!0,parent:"body",cubes:[{origin:[2,0,-2],size:[2,7,2],uv:[8,15]}]},{name:"frontLegRight",pivot:[-3,7,-1],bind_pose_rotation:[-10,0,0],mirror:!0,parent:"body",cubes:[{origin:[-4,0,-2],size:[2,7,2],uv:[0,15]}]},{name:"head",pivot:[0,8,-1],locators:{lead:[0,8,-1]},mirror:!0,parent:"body",cubes:[{origin:[-2.5,8,-6],size:[5,4,5],uv:[32,0]}]},{name:"earRight",pivot:[0,8,-1],bind_pose_rotation:[0,-15,0],mirror:!0,parent:"body",cubes:[{origin:[-2.5,12,-2],size:[2,5,1],uv:[58,0]}]},{name:"earLeft",pivot:[0,8,-1],bind_pose_rotation:[0,15,0],mirror:!0,parent:"body",cubes:[{origin:[.5,12,-2],size:[2,5,1],uv:[52,0]}]},{name:"tail",pivot:[0,4,7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[-1.5,2.5,7],size:[3,3,2],uv:[52,6]}]},{name:"nose",pivot:[0,8,-1],mirror:!0,parent:"body",cubes:[{origin:[-.5,9.5,-6.5],size:[1,1,1],uv:[32,9]}]}]}},render_controllers:["controller.render.rabbit"],spawn_egg:{texture:"spawn_egg",texture_index:24}},ravager:{identifier:"minecraft:ravager",textures:{default:"textures/entity/illager/ravager"},materials:{default:"ravager"},geometry:{default:{bones:[{pivot:[0,19,2],rotation:[90,0,0],cubes:[{origin:[-7,10,-2],size:[14,16,20],uv:[0,55]},{origin:[-6,-3,-2],size:[12,13,18],uv:[0,91]}],name:"body"},{pivot:[0,15,-10],cubes:[{origin:[-8,13,-24],size:[16,3,16],uv:[0,36]}],name:"mouth",parent:"head"},{pivot:[0,20,-20],cubes:[{origin:[-5,21,-10],size:[10,10,18],uv:[68,73]}],name:"neck"},{locators:{stun:[0,32,-15]},pivot:[0,28,-10],cubes:[{origin:[-8,14,-24],size:[16,20,16],uv:[0,0]},{origin:[-2,12,-28],size:[4,8,4],uv:[0,0]}],name:"head",parent:"neck"},{pivot:[-12,30,22],cubes:[{origin:[-12,0,17],size:[8,37,8],uv:[96,0]}],name:"leg0"},{pivot:[4,30,22],cubes:[{origin:[4,0,17],size:[8,37,8],uv:[96,0]}],name:"leg1"},{pivot:[-4,26,-4],cubes:[{origin:[-12,0,-8],size:[8,37,8],uv:[64,0]}],name:"leg2"},{pivot:[-4,26,-4],cubes:[{origin:[4,0,-8],size:[8,37,8],uv:[64,0]}],name:"leg3"},{pivot:[-5,27,-19],rotation:[60,0,0],cubes:[{origin:[-10,27,-20],size:[2,14,4],uv:[74,55]},{origin:[8,27,-20],size:[2,14,4],uv:[74,55]}],name:"horns",parent:"head"}],texturewidth:128,textureheight:128,visible_bounds_width:4,visible_bounds_height:3.5,visible_bounds_offset:[0,1.25,0]}},render_controllers:["controller.render.ravager"],spawn_egg:{texture:"spawn_egg",texture_index:57},particle_effects:{stun_particles:"minecraft:stunned_emitter"}},salmon:{identifier:"minecraft:salmon",materials:{default:"salmon"},textures:{default:"textures/entity/fish/salmon"},geometry:{default:{visible_bounds_width:.5,visible_bounds_height:.5,visible_bounds_offset:[0,.5,0],texturewidth:32,textureheight:32,bones:[{name:"body_front",pivot:[0,0,-4],cubes:[{origin:[-1.5,3.5,-4],size:[3,5,8],uv:[0,0]}]},{name:"body_back",parent:"body_front",pivot:[0,0,4],cubes:[{origin:[-1.5,3.5,4],size:[3,5,8],uv:[0,13]}]},{name:"dorsal_front",parent:"body_front",pivot:[0,5,2],cubes:[{origin:[0,8.5,2],size:[0,2,2],uv:[4,2]}]},{name:"dorsal_back",parent:"body_back",pivot:[0,5,4],cubes:[{origin:[0,8.5,4],size:[0,2,3],uv:[2,3]}]},{name:"tailfin",parent:"body_back",pivot:[0,0,12],cubes:[{origin:[0,3.5,12],size:[0,5,6],uv:[20,10]}]},{name:"head",parent:"body_front",pivot:[0,3,-4],locators:{lead:[0,3,-4]},cubes:[{origin:[-1,4.5,-7],size:[2,4,3],uv:[22,0]}]},{name:"leftFin",parent:"body_front",pivot:[1.5,1,-4],rotation:[0,0,35],cubes:[{origin:[-.50752,3.86703,-4],size:[2,0,2],uv:[2,0]}]},{name:"rightFin",parent:"body_front",pivot:[-1.5,1,-4],rotation:[0,0,-35],cubes:[{origin:[-1.49258,3.86703,-4],size:[2,0,2],uv:[-2,0]}]}]}},render_controllers:["controller.render.salmon"],spawn_egg:{texture:"spawn_egg",texture_index:47}},sheep:{identifier:"minecraft:sheep",materials:{default:"sheep"},textures:{default:"textures/entity/sheep/sheep",wool:"textures/entity/sheep/sheep_fur"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-4,13,-5],size:[8,16,6],uv:[28,8]}]},{name:"head",pivot:[0,18,-8],cubes:[{origin:[-3,16,-14],size:[6,6,8],uv:[0,0]}]},{name:"leg0",parent:"body",pivot:[-3,12,7],cubes:[{origin:[-5,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",pivot:[3,12,7],cubes:[{origin:[1,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-3,12,-5],cubes:[{origin:[-5,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",pivot:[3,12,-5],cubes:[{origin:[1,0,-7],size:[4,12,4],uv:[0,16]}]}]},wool:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,18,-8],cubes:[{origin:[-3,16,-12],size:[6,6,6],uv:[0,32],inflate:.6}]},{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-4,13,-5],size:[8,16,6],uv:[28,40],inflate:1.75}]},{name:"leg0",parent:"body",pivot:[-3,12,7],cubes:[{origin:[-5,6,5],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg1",parent:"body",pivot:[3,12,7],cubes:[{origin:[1,6,5],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg2",parent:"body",pivot:[-3,12,-5],cubes:[{origin:[-5,6,-7],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg3",parent:"body",pivot:[3,12,-5],cubes:[{origin:[1,6,-7],size:[4,6,4],uv:[0,48],inflate:.5}]}]}}},shulker_bullet:{identifier:"minecraft:shulker_bullet",materials:{default:"shulker_bullet"},textures:{default:"textures/entity/shulker/spark"},geometry:{default:{texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-4,-4,-1],size:[8,8,2],uv:[0,0]},{origin:[-1,-4,-4],size:[2,8,8],uv:[0,10]},{origin:[-4,-1,-4],size:[8,2,8],uv:[20,0]}]}]}},render_controllers:["controller.render.shulker_bullet"]},silverfish:{identifier:"minecraft:silverfish",materials:{default:"silverfish",body_layer:"silverfish_layers"},textures:{default:"textures/entity/silverfish"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"bodyPart_0",parent:"bodyPart_2",pivot:[0,2,-3.5],cubes:[{origin:[-1.5,0,-4.5],size:[3,2,2],uv:[0,0]}]},{name:"bodyPart_1",parent:"bodyPart_2",pivot:[0,3,-1.5],cubes:[{origin:[-2,0,-2.5],size:[4,3,2],uv:[0,4]}]},{name:"bodyPart_2",pivot:[0,4,1],cubes:[{origin:[-3,0,-.5],size:[6,4,3],uv:[0,9]}]},{name:"bodyPart_3",parent:"bodyPart_2",pivot:[0,3,4],cubes:[{origin:[-1.5,0,2.5],size:[3,3,3],uv:[0,16]}]},{name:"bodyPart_4",parent:"bodyPart_2",pivot:[0,2,7],cubes:[{origin:[-1,0,5.5],size:[2,2,3],uv:[0,22]}]},{name:"bodyPart_5",parent:"bodyPart_2",pivot:[0,1,9.5],cubes:[{origin:[-1,0,8.5],size:[2,1,2],uv:[11,0]}]},{name:"bodyPart_6",parent:"bodyPart_2",pivot:[0,1,11.5],cubes:[{origin:[-.5,0,10.5],size:[1,1,2],uv:[13,4]}]},{name:"bodyLayer_0",parent:"bodyPart_2",pivot:[0,8,1],cubes:[{origin:[-5,0,-.5],size:[10,8,3],uv:[20,0]}]},{name:"bodyLayer_1",parent:"bodyPart_4",pivot:[0,4,7],cubes:[{origin:[-3,0,5.5],size:[6,4,3],uv:[20,11]}]},{name:"bodyLayer_2",parent:"bodyPart_1",pivot:[0,5,-1.5],cubes:[{origin:[-3,0,-3],size:[6,5,2],uv:[20,18]}]}]}},render_controllers:["controller.render.silverfish"],spawn_egg:{texture:"spawn_egg",texture_index:8}},skeleton:{identifier:"minecraft:skeleton",min_engine_version:"1.8.0",materials:{default:"skeleton"},textures:{default:"textures/entity/skeleton/skeleton"},geometry:{default:{texturewidth:64,textureheight:32,visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0,parent:"body"}]}},spawn_egg:{texture:"spawn_egg",texture_index:9},render_controllers:["controller.render.skeleton"],enable_attachables:!0},skeleton_horse:{identifier:"minecraft:skeleton_horse",textures:{base_brown:"textures/entity/horse/horse_brown",base_white:"textures/entity/horse/horse_white",base_chestnut:"textures/entity/horse/horse_chestnut",base_creamy:"textures/entity/horse/horse_creamy",base_black:"textures/entity/horse/horse_black",base_gray:"textures/entity/horse/horse_gray",base_darkbrown:"textures/entity/horse/horse_darkbrown",markings_none:"textures/entity/horse/horse_markings_none",markings_white:"textures/entity/horse/horse_markings_white",markings_whitefield:"textures/entity/horse/horse_markings_whitefield",markings_whitedots:"textures/entity/horse/horse_markings_whitedots",markings_blackdots:"textures/entity/horse/horse_markings_blackdots",mule:"textures/entity/horse/mule",donkey:"textures/entity/horse/donkey",skeleton:"textures/entity/horse/horse_skeleton",zombie:"textures/entity/horse/horse_zombie",armor_none:"textures/entity/horse/armor/horse_armor_none",armor_leather:"textures/entity/horse/armor/horse_armor_leather",armor_iron:"textures/entity/horse/armor/horse_armor_iron",armor_gold:"textures/entity/horse/armor/horse_armor_gold",armor_diamond:"textures/entity/horse/armor/horse_armor_diamond"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:3,visible_bounds_offset:[0,1,0],texturewidth:128,textureheight:128,bones:[{name:"Body",pivot:[0,13,9],rotation:[0,0,0],cubes:[{origin:[-5,11,-10],size:[10,10,24],uv:[0,34]}]},{name:"TailA",pivot:[0,21,14],rotation:[-65,0,0],cubes:[{origin:[-1,20,14],size:[2,2,3],uv:[44,0]}]},{name:"TailB",pivot:[0,21,14],rotation:[-65,0,0],cubes:[{origin:[-1.5,19,17],size:[3,4,7],uv:[38,7]}]},{name:"TailC",pivot:[0,21,14],rotation:[-80.34,0,0],cubes:[{origin:[-1.5,21.5,23],size:[3,4,7],uv:[24,3]}]},{name:"Leg1A",pivot:[4,15,11],rotation:[0,0,0],cubes:[{origin:[1.5,8,8.5],size:[4,9,5],uv:[78,29]}]},{name:"Leg1B",pivot:[4,8,11],rotation:[0,0,0],cubes:[{origin:[2,3,9.5],size:[3,5,3],uv:[78,43]}]},{name:"Leg1C",pivot:[4,8,11],rotation:[0,0,0],cubes:[{origin:[1.5,-.1,9],size:[4,3,4],uv:[78,51]}]},{name:"Leg2A",pivot:[-4,15,11],rotation:[0,0,0],cubes:[{origin:[-5.5,8,8.5],size:[4,9,5],uv:[96,29]}]},{name:"Leg2B",pivot:[-4,8,11],rotation:[0,0,0],cubes:[{origin:[-5,3,9.5],size:[3,5,3],uv:[96,43]}]},{name:"Leg2C",pivot:[-4,8,11],rotation:[0,0,0],cubes:[{origin:[-5.5,-.1,9],size:[4,3,4],uv:[96,51]}]},{name:"Leg3A",pivot:[4,15,-8],rotation:[0,0,0],cubes:[{origin:[2.1,8,-10.1],size:[3,8,4],uv:[44,29]}]},{name:"Leg3B",pivot:[4,8,-8],rotation:[0,0,0],cubes:[{origin:[2.1,3,-9.6],size:[3,5,3],uv:[44,41]}]},{name:"Leg3C",pivot:[4,8,-8],rotation:[0,0,0],cubes:[{origin:[1.6,-.1,-10.1],size:[4,3,4],uv:[44,51]}]},{name:"Leg4A",pivot:[-4,15,-8],rotation:[0,0,0],cubes:[{origin:[-5.1,8,-10.1],size:[3,8,4],uv:[60,29]}]},{name:"Leg4B",pivot:[-4,8,-8],rotation:[0,0,0],cubes:[{origin:[-5.1,3,-9.6],size:[3,5,3],uv:[60,41]}]},{name:"Leg4C",pivot:[-4,8,-8],rotation:[0,0,0],cubes:[{origin:[-5.6,-.1,-10.1],size:[4,3,4],uv:[60,51]}]},{name:"Head",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,25,-11.5],size:[5,5,7],uv:[0,0]}]},{name:"UMouth",pivot:[0,20.05,-10],rotation:[30,0,0],cubes:[{origin:[-2,27.05,-17],size:[4,3,6],uv:[24,18]}]},{name:"LMouth",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2,25,-16.5],size:[4,2,5],uv:[24,27]}]},{name:"Ear1",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[.45,29,-6],size:[2,3,1],uv:[0,0]}]},{name:"Ear2",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.45,29,-6],size:[2,3,1],uv:[0,0]}]},{name:"MuleEarL",pivot:[0,20,-10],rotation:[30,0,15],cubes:[{origin:[-2,29,-6],size:[2,7,1],uv:[0,12]}]},{name:"MuleEarR",pivot:[0,20,-10],rotation:[30,0,-15],cubes:[{origin:[0,29,-6],size:[2,7,1],uv:[0,12]}]},{name:"Neck",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.05,15.8,-12],size:[4,14,8],uv:[0,12]}]},{name:"Bag1",pivot:[-7.5,21,10],rotation:[0,90,0],cubes:[{origin:[-10.5,13,10],size:[8,8,3],uv:[0,34]}]},{name:"Bag2",pivot:[4.5,21,10],rotation:[0,90,0],cubes:[{origin:[1.5,13,10],size:[8,8,3],uv:[0,47]}]},{name:"Saddle",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-5,21,-1],size:[10,1,8],uv:[80,0]}]},{name:"SaddleB",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-1.5,22,-1],size:[3,1,2],uv:[106,9]}]},{name:"SaddleC",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-4,22,5],size:[8,1,2],uv:[80,9]}]},{name:"SaddleL2",pivot:[5,21,2],rotation:[0,0,0],cubes:[{origin:[4.5,13,1],size:[1,2,2],uv:[74,0]}]},{name:"SaddleL",pivot:[5,21,2],rotation:[0,0,0],cubes:[{origin:[4.5,15,1.5],size:[1,6,1],uv:[70,0]}]},{name:"SaddleR2",pivot:[-5,21,2],rotation:[0,0,0],cubes:[{origin:[-5.5,13,1],size:[1,2,2],uv:[74,4]}]},{name:"SaddleR",pivot:[-5,21,2],rotation:[0,0,0],cubes:[{origin:[-5.5,15,1.5],size:[1,6,1],uv:[80,0]}]},{name:"SaddleMouthL",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[1.5,26,-14],size:[1,2,2],uv:[74,13]}]},{name:"SaddleMouthR",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,26,-14],size:[1,2,2],uv:[74,13]}]},{name:"SaddleMouthLine",pivot:[0,20,-10],rotation:[0,0,0],cubes:[{origin:[2.6,23,-16],size:[0,3,16],uv:[44,10]}]},{name:"SaddleMouthLineR",pivot:[0,20,-10],rotation:[0,0,0],cubes:[{origin:[-2.6,23,-16],size:[0,3,16],uv:[44,5]}]},{name:"Mane",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-1,15.5,-5],size:[2,16,4],uv:[58,0]}]},{name:"HeadSaddle",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,25.1,-17],size:[5,5,12],uv:[80,12],inflate:.05}]}]}},spawn_egg:{texture:"spawn_egg",texture_index:32}},slime:{identifier:"minecraft:slime",materials:{default:"slime",outer:"slime_outer"},textures:{default:"textures/entity/slime/slime"},geometry:{default:{visible_bounds_width:5,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"cube",pivot:[0,24,0],cubes:[{origin:[-3,1,-3],size:[6,6,6],uv:[0,16]}]},{name:"eye0",parent:"cube",pivot:[0,24,0],cubes:[{origin:[-3.3,4,-3.5],size:[2,2,2],uv:[32,0]}]},{name:"eye1",parent:"cube",pivot:[0,24,0],cubes:[{origin:[1.3,4,-3.5],size:[2,2,2],uv:[32,4]}]},{name:"mouth",parent:"cube",pivot:[0,24,0],cubes:[{origin:[0,2,-3.5],size:[1,1,1],uv:[32,8]}]}]},armor:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"cube",pivot:[0,24,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0]}]},{name:"eye0",parent:"cube",pivot:[0,24,0],cubes:[{origin:[-3.3,4,-3.5],size:[2,2,2],uv:[32,0]}]},{name:"eye1",parent:"cube",pivot:[0,24,0],cubes:[{origin:[1.3,4,-3.5],size:[2,2,2],uv:[32,4]}]},{name:"mouth",parent:"cube",pivot:[0,24,0],cubes:[{origin:[0,2,-3.5],size:[1,1,1],uv:[32,8]}]}]}},render_controllers:["controller.render.slime","controller.render.slime_armor"],spawn_egg:{texture:"spawn_egg",texture_index:10}},small_fireball:{identifier:"minecraft:small_fireball",materials:{default:"fireball"},textures:{default:"textures/items/fire_charge"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},snow_golem:{identifier:"minecraft:snow_golem",min_engine_version:"1.8.0",materials:{default:"snow_golem",head:"snow_golem_pumpkin"},textures:{default:"textures/entity/snow_golem"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:2,visible_bounds_offset:[0,1,0],bones:[{name:"head",parent:"piece1",pivot:[0,20,0],locators:{lead:[0,20,0]},cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0],inflate:-.5}]},{name:"arm1",parent:"piece1",pivot:[0,18,0],bind_pose_rotation:[0,0,57.3],cubes:[{origin:[1,20,-1],size:[12,2,2],uv:[32,0],inflate:-.5}]},{name:"arm2",parent:"piece1",pivot:[0,18,0],bind_pose_rotation:[0,180,-57.3],cubes:[{origin:[1,20,-1],size:[12,2,2],uv:[32,0],inflate:-.5}]},{name:"piece1",parent:"piece2",pivot:[0,11,0],cubes:[{origin:[-5,11,-5],size:[10,10,10],uv:[0,16],inflate:-.5}]},{name:"piece2",pivot:[0,0,0],cubes:[{origin:[-6,0,-6],size:[12,12,12],uv:[0,36],inflate:-.5}]}]}},render_controllers:["controller.render.snowgolem"]},snowball:{identifier:"minecraft:snowball",materials:{default:"snowball"},textures:{default:"textures/items/snowball"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},potion:{identifier:"minecraft:splash_potion",materials:{default:"splash_potion_enchanted"},textures:{moveSlowdown:"textures/items/potion_bottle_splash_moveSlowdown",moveSpeed:"textures/items/potion_bottle_splash_moveSpeed",digSlowdown:"textures/items/potion_bottle_splash_digSlowdown",digSpeed:"textures/items/potion_bottle_splash_digSpeed",damageBoost:"textures/items/potion_bottle_splash_damageBoost",heal:"textures/items/potion_bottle_splash_heal",harm:"textures/items/potion_bottle_splash_harm",jump:"textures/items/potion_bottle_splash_jump",confusion:"textures/items/potion_bottle_splash_confusion",regeneration:"textures/items/potion_bottle_splash_regeneration",resistance:"textures/items/potion_bottle_splash_resistance",fireResistance:"textures/items/potion_bottle_splash_fireResistance",waterBreathing:"textures/items/potion_bottle_splash_waterBreathing",invisibility:"textures/items/potion_bottle_splash_invisibility",blindness:"textures/items/potion_bottle_splash_blindness",nightVision:"textures/items/potion_bottle_splash_nightVision",hunger:"textures/items/potion_bottle_splash_hunger",weakness:"textures/items/potion_bottle_splash_weakness",poison:"textures/items/potion_bottle_splash_poison",wither:"textures/items/potion_bottle_splash_wither",healthBoost:"textures/items/potion_bottle_splash_healthBoost",absorption:"textures/items/potion_bottle_splash_absorption",saturation:"textures/items/potion_bottle_splash_saturation",levitation:"textures/items/potion_bottle_splash_levitation",turtleMaster:"textures/items/potion_bottle_splash_turtleMaster",slowFall:"textures/items/potion_bottle_splash_slowFall",default:"textures/items/potion_bottle_splash",enchanted:"textures/misc/enchanted_item_glint"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.splash_potion"]},squid:{identifier:"minecraft:squid",materials:{default:"squid"},textures:{default:"textures/entity/squid"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",cubes:[{origin:[-6,-8,-6],size:[12,16,12],uv:[0,0]}]},{name:"tentacle1",parent:"body",pivot:[5,-7,0],cubes:[{origin:[4,-25,-1],size:[2,18,2],uv:[48,0]}],rotation:[0,90,0]},{name:"tentacle2",parent:"body",pivot:[3.5,-7,3.5],cubes:[{origin:[2.5,-25,2.5],size:[2,18,2],uv:[48,0]}],rotation:[0,45,0]},{name:"tentacle3",parent:"body",pivot:[0,-7,5],cubes:[{origin:[-1,-25,4],size:[2,18,2],uv:[48,0]}],rotation:[0,0,0]},{name:"tentacle4",parent:"body",pivot:[-3.5,-7,3.5],cubes:[{origin:[-4.5,-25,2.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-45,0]},{name:"tentacle5",parent:"body",pivot:[-5,-7,0],cubes:[{origin:[-6,-25,-1],size:[2,18,2],uv:[48,0]}],rotation:[0,-90,0]},{name:"tentacle6",parent:"body",pivot:[-3.5,-7,-3.5],cubes:[{origin:[-4.5,-25,-4.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-135,0]},{name:"tentacle7",parent:"body",pivot:[0,-7,-5],cubes:[{origin:[-1,-25,-6],size:[2,18,2],uv:[48,0]}],rotation:[0,-180,0]},{name:"tentacle8",parent:"body",pivot:[3.5,-7,-3.5],cubes:[{origin:[2.5,-25,-4.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-225,0]}]}},render_controllers:["controller.render.squid"],spawn_egg:{texture:"spawn_egg",texture_index:15}},stray:{identifier:"minecraft:stray",min_engine_version:"1.8.0",materials:{default:"stray",overlay:"stray_clothes"},textures:{default:"textures/entity/skeleton/stray",overlay:"textures/entity/skeleton/stray_overlay"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",pivot:[0,12,0]},{name:"head",pivot:[0,24,0],locators:{lead:[0,24,0]},cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0,parent:"body"}]},overlay:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",parent:"waist",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],inflate:.25},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],inflate:.25},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],inflate:.25},{name:"rightItem",parent:"rightArm",pivot:[-6,15,1],neverRender:!0},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,inflate:.25},{name:"rightLeg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],inflate:.25},{name:"leftLeg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],inflate:.25,mirror:!0}]}},spawn_egg:{texture:"spawn_egg",texture_index:27},render_controllers:["controller.render.stray_clothes","controller.render.stray"],enable_attachables:!0},strider:{identifier:"minecraft:strider",materials:{default:"strider"},textures:{default:"textures/entity/strider/strider",saddled:"textures/entity/strider/strider",suffocated:"textures/entity/strider/strider_cold",suffocated_saddled:"textures/entity/strider/strider_cold"},geometry:{default:{bones:[{name:"right_leg",pivot:[-4,16,0],cubes:[{origin:[-6,0,-2],size:[4,16,4],uv:[0,32]}]},{name:"left_leg",pivot:[4,16,0],cubes:[{origin:[2,0,-2],size:[4,16,4],uv:[0,55]}]},{name:"body",pivot:[0,16,0],cubes:[{origin:[-8,14,-8],size:[16,14,16],uv:[0,0]}],locators:{lead:[0,15,-1]}},{name:"bristle5",parent:"body",pivot:[8,19,0],cubes:[{origin:[8,19,-8],size:[12,0,16],pivot:[8,19,0],rotation:[0,0,70],uv:[16,65]}]},{name:"bristle4",parent:"body",pivot:[8,24,0],cubes:[{origin:[8,24,-8],size:[12,0,16],pivot:[8,24,0],rotation:[0,0,65],uv:[16,49]}]},{name:"bristle3",parent:"body",pivot:[8,28,0],cubes:[{origin:[8,28,-8],size:[12,0,16],pivot:[8,28,0],rotation:[0,0,50],uv:[16,33]}]},{name:"bristle2",parent:"body",pivot:[-8,28,0],cubes:[{origin:[-20,28,-8],size:[12,0,16],pivot:[-8,28,0],rotation:[0,0,-50],uv:[16,33],mirror:!0}]},{name:"bristle1",parent:"body",pivot:[-8,24,0],cubes:[{origin:[-20,24,-8],size:[12,0,16],pivot:[-8,24,0],rotation:[0,0,-65],uv:[16,49],mirror:!0}]},{name:"bristle0",parent:"body",pivot:[-8,19,0],cubes:[{origin:[-20,19,-8],size:[12,0,16],pivot:[-8,19,0],rotation:[0,0,-70],uv:[16,65],mirror:!0}]}],visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:128}},spawn_egg:{base_color:"#9c3436",overlay_color:"#4d494d"},render_controllers:["controller.render.strider"]},text_display:{identifier:"minecraft:text_display",geometry:{}},trident:{identifier:"minecraft:thrown_trident",textures:{default:"textures/entity/trident",loyalty_rope:"textures/entity/lead_knot"},geometry:{default:{texturewidth:32,textureheight:32,bones:[{name:"pole",pivot:[0,24,0],cubes:[{origin:[-.5,-3,-.5],size:[1,31,1],inflate:.01,uv:[0,0]},{origin:[-1.5,22,-.5],size:[3,2,1],uv:[4,0]},{origin:[-2.5,23,-.5],size:[1,4,1],uv:[4,3]},{origin:[1.5,23,-.5],size:[1,4,1],uv:[4,3]}]}]}}},tnt_minecart:{identifier:"minecraft:tnt_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},tropical_fish:{identifier:"minecraft:tropicalfish",materials:{default:"tropicalfish"},textures:{typeA:"textures/entity/fish/tropical_a",typeB:"textures/entity/fish/tropical_b",aPattern1:"textures/entity/fish/tropical_a_pattern_1",aPattern2:"textures/entity/fish/tropical_a_pattern_2",aPattern3:"textures/entity/fish/tropical_a_pattern_3",aPattern4:"textures/entity/fish/tropical_a_pattern_4",aPattern5:"textures/entity/fish/tropical_a_pattern_5",aPattern6:"textures/entity/fish/tropical_a_pattern_6",bPattern1:"textures/entity/fish/tropical_b_pattern_1",bPattern2:"textures/entity/fish/tropical_b_pattern_2",bPattern3:"textures/entity/fish/tropical_b_pattern_3",bPattern4:"textures/entity/fish/tropical_b_pattern_4",bPattern5:"textures/entity/fish/tropical_b_pattern_5",bPattern6:"textures/entity/fish/tropical_b_pattern_6"},geometry:{typeA:{visible_bounds_width:.5,visible_bounds_height:.5,bones:[{pivot:[-.5,0,0],cubes:[{origin:[-1,0,-3],size:[2,3,6],uv:[0,0]},{origin:[0,3,-2.9992],size:[0,4,6],uv:[10,-6]}],name:"body"},{pivot:[0,0,3],cubes:[{origin:[0,0,3],size:[0,3,4],uv:[24,-4]}],name:"tailfin",parent:"body"},{pivot:[.5,0,1],bind_pose_rotation:[0,-35,0],cubes:[{origin:[.336,0,-.10594],size:[2,2,0],uv:[2,12]}],name:"leftFin",parent:"body"},{pivot:[-.5,0,1],bind_pose_rotation:[0,35,0],cubes:[{origin:[-2.336,0,-.10594],size:[2,2,0],uv:[2,16]}],name:"rightFin",parent:"body"}],texturewidth:32,textureheight:32},typeB:{visible_bounds_width:.5,visible_bounds_height:.5,bones:[{pivot:[-.5,0,0],cubes:[{origin:[-1,0,-8e-4],size:[2,6,6],uv:[0,20]},{origin:[0,-5,-8e-4],size:[0,5,6],uv:[20,21]},{origin:[0,6,-8e-4],size:[0,5,6],uv:[20,10]}],name:"body"},{pivot:[0,0,6],cubes:[{origin:[0,8e-4,6],size:[0,6,5],uv:[21,16]}],name:"tailfin",parent:"body"},{pivot:[.5,0,1],bind_pose_rotation:[0,-35,0],cubes:[{origin:[2.05673,0,2.35152],size:[2,2,0],uv:[2,12]}],name:"leftFin",parent:"body"},{pivot:[-.5,0,1],bind_pose_rotation:[0,35,0],cubes:[{origin:[-4.05673,0,2.35152],size:[2,2,0],uv:[2,16]}],name:"rightFin",parent:"body"}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.tropicalfish"],spawn_egg:{texture:"spawn_egg",texture_index:44}},vindicator:{identifier:"minecraft:vindicator",min_engine_version:"1.8.0",materials:{default:"vindicator"},textures:{default:"textures/entity/illager/vindicator"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22]},{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]}]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],mirror:!0,cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,46]}]},{name:"rightItem",pivot:[-5.5,16,.5],neverRender:!0,parent:"rightArm"},{name:"leftArm",parent:"body",pivot:[5,22,0],mirror:!0,cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,46]}]}]}},spawn_egg:{texture:"spawn_egg",texture_index:39},render_controllers:["controller.render.vindicator"],enable_attachables:!0},wandering_trader:{identifier:"minecraft:wandering_trader",materials:{default:"wandering_trader"},textures:{default:"textures/entity/wandering_trader"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"helmet",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[32,0],inflate:.5}]},{name:"brim",parent:"head",pivot:[0,24,0],bind_pose_rotation:[-90,0,0],cubes:[{origin:[-8,16,-6],size:[16,16,1],uv:[30,47],inflate:.1}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",locators:{lead_hold:[0,40,0]},cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]},{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22],mirror:!0}]},{name:"held_item",parent:"arms",pivot:[0,0,0]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22],mirror:!0}]}]}},render_controllers:["controller.render.wandering_trader"],spawn_egg:{texture:"spawn_egg_wandering_trader"}},wither:{identifier:"minecraft:wither",min_engine_version:"1.8.0",materials:{default:"wither_boss",armor:"wither_boss_armor"},textures:{default:"textures/entity/wither/wither",armor_white:"textures/entity/wither/wither_armor",armor_blue:"textures/entity/wither/wither_armor",invulnerable:"textures/entity/wither/wither_invulnerable"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:4,visible_bounds_offset:[0,2,0],texturewidth:64,textureheight:64,bones:[{name:"upperBodyPart1",cubes:[{origin:[-10,17.1,-.5],size:[20,3,3],uv:[0,16]}]},{name:"upperBodyPart2",parent:"upperBodyPart1",pivot:[-2,17.1,-.5],cubes:[{origin:[-2,7.1,-.5],size:[3,10,3],uv:[0,22]},{origin:[-6,13.6,0],size:[11,2,2],uv:[24,22]},{origin:[-6,11.1,0],size:[11,2,2],uv:[24,22]},{origin:[-6,8.6,0],size:[11,2,2],uv:[24,22]}]},{name:"upperBodyPart3",parent:"upperBodyPart2",pivot:[0,24,0],cubes:[{origin:[0,18,0],size:[3,6,3],uv:[12,22]}]},{name:"head1",parent:"upperBodyPart1",pivot:[0,20,0],cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0]}]},{name:"head2",parent:"upperBodyPart1",pivot:[-9,18,-1],cubes:[{origin:[-12,18,-4],size:[6,6,6],uv:[32,0]}]},{name:"head3",parent:"upperBodyPart1",pivot:[9,18,-1],cubes:[{origin:[6,18,-4],size:[6,6,6],uv:[32,0]}]}]},armor:{visible_bounds_width:3,visible_bounds_height:4,visible_bounds_offset:[0,2,0],texturewidth:64,textureheight:64,bones:[{name:"upperBodyPart1",cubes:[{origin:[-10,17.1,-.5],size:[20,3,3],uv:[0,16]}],inflate:2},{name:"upperBodyPart2",parent:"upperBodyPart1",pivot:[-2,17.1,-.5],cubes:[{origin:[-2,7.1,-.5],size:[3,10,3],uv:[0,22]},{origin:[-6,13.6,0],size:[11,2,2],uv:[24,22]},{origin:[-6,11.1,0],size:[11,2,2],uv:[24,22]},{origin:[-6,8.6,0],size:[11,2,2],uv:[24,22]}],inflate:2},{name:"upperBodyPart3",parent:"upperBodyPart2",pivot:[0,24,0],cubes:[{origin:[0,18,0],size:[3,6,3],uv:[12,22]}],inflate:2},{name:"head1",parent:"upperBodyPart1",pivot:[0,20,0],cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0]}],inflate:2},{name:"head2",parent:"upperBodyPart1",pivot:[-9,18,-1],cubes:[{origin:[-12,18,-4],size:[6,6,6],uv:[32,0]}],inflate:2},{name:"head3",parent:"upperBodyPart1",pivot:[9,18,-1],cubes:[{origin:[6,18,-4],size:[6,6,6],uv:[32,0]}],inflate:2}]}},render_controllers:["controller.render.wither_boss","controller.render.wither_boss_armor_white","controller.render.wither_boss_armor_blue"]},wither_skeleton:{identifier:"minecraft:wither_skeleton",min_engine_version:"1.8.0",materials:{default:"skeleton"},textures:{default:"textures/entity/skeleton/wither_skeleton"},geometry:{default:{texturewidth:64,textureheight:32,visible_bounds_width:1.5,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],bones:[{name:"body",parent:"waist",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}]},{name:"waist",pivot:[0,12,0]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}]},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}]},{name:"rightItem",parent:"rightArm",pivot:[-1,-45,-5],neverRender:!0},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5],neverRender:!0},{name:"rightLeg",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}]},{name:"leftLeg",parent:"body",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0}]}},render_controllers:["controller.render.wither_skeleton"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:29}},wither_skull:{identifier:"minecraft:wither_skull",materials:{default:"wither_skull"},textures:{default:"textures/entity/wither/wither"},geometry:{default:{bones:[{name:"head",cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,35]}]}],visible_bounds_width:1,visible_bounds_height:1,texturewidth:64,textureheight:64}},render_controllers:["controller.render.wither_skull"]},zoglin:{identifier:"minecraft:zoglin",materials:{default:"zoglin"},textures:{default:"textures/entity/hoglin/zoglin"},geometry:{default:{bones:[{name:"body",pivot:[0,19,-3],cubes:[{origin:[-8,11,-7],size:[16,14,26],inflate:.02,uv:[1,1]},{origin:[0,22,-10],size:[0,10,19],inflate:.02,uv:[90,33]}],locators:{lead:[0,20,-5]}},{name:"head",parent:"body",pivot:[0,22,-5],rotation:[50,0,0],cubes:[{origin:[-7,21,-24],size:[14,6,19],uv:[61,1]},{origin:[-8,22,-19],size:[2,11,2],uv:[1,13]},{origin:[6,22,-19],size:[2,11,2],uv:[1,13]}]},{name:"right_ear",parent:"head",pivot:[-7,27,-7],rotation:[0,0,-50],cubes:[{origin:[-13,26,-10],size:[6,1,4],uv:[1,1]}]},{name:"left_ear",parent:"head",pivot:[7,27,-7],rotation:[0,0,50],cubes:[{origin:[7,26,-10],size:[6,1,4],uv:[1,6]}]},{name:"leg_back_right",pivot:[6,8,17],cubes:[{origin:[-8,0,13],size:[5,11,5],uv:[21,45]}]},{name:"leg_back_left",pivot:[-6,8,17],cubes:[{origin:[3,0,13],size:[5,11,5],uv:[0,45]}]},{name:"leg_front_right",pivot:[-6,12,-3],cubes:[{origin:[-8,0,-6],size:[6,14,6],uv:[66,42]}]},{name:"leg_front_left",pivot:[6,12,-3],cubes:[{origin:[2,0,-6],size:[6,14,6],uv:[41,42]}]}],visible_bounds_width:4,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:64}},spawn_egg:{base_color:"#c66e55",overlay_color:"#e6e6e6"},render_controllers:["controller.render.zoglin"]},zombie:{identifier:"minecraft:zombie",min_engine_version:"1.8.0",materials:{default:"zombie"},textures:{default:"textures/entity/zombie/zombie"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],mirror:!0,parent:"body"}]}},spawn_egg:{texture:"spawn_egg",texture_index:12},scripts:{pre_animation:["variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;"]},animations:{humanoid_big_head:{loop:!0,bones:{head:{scale:1.4}}},look_at_target_default:{loop:!0,bones:{head:{relative_to:{rotation:"entity"},rotation:["query.target_x_rotation","query.target_y_rotation",0]}}},look_at_target_gliding:{loop:!0,bones:{head:{rotation:[-45,"query.target_y_rotation",0]}}},look_at_target_swimming:{loop:!0,bones:{head:{rotation:["math.lerp(query.target_x_rotation, -45.0, variable.swim_amount)","query.target_y_rotation",0]}}},move:{loop:!0,bones:{leftarm:{rotation:["variable.tcos0",0,0]},leftleg:{rotation:["variable.tcos0 * -1.4",0,0]},rightarm:{rotation:["-variable.tcos0",0,0]},rightleg:{rotation:["variable.tcos0 * 1.4",0,0]}}},"riding.arms":{loop:!0,bones:{leftarm:{rotation:[-36,0,0]},rightarm:{rotation:[-36,0,0]}}},"riding.legs":{loop:!0,bones:{leftleg:{rotation:["-72.0 - this","-18.0 - this","-this"]},rightleg:{rotation:["-72.0 - this","18.0 - this","-this"]}}},holding:{loop:!0,bones:{leftarm:{rotation:["variable.is_holding_left ? (-this * 0.5 - 18.0) : 0.0",0,0]},rightarm:{rotation:["variable.is_holding_right ? (-this * 0.5 - 18.0) : 0.0",0,0]}}},brandish_spear:{loop:!0,bones:{rightarm:{rotation:["this * -0.5 - 157.5 - 22.5 * variable.charge_amount","-this",0]}}},charging:{loop:!0,bones:{rightarm:{rotation:["22.5 * variable.charge_amount - this","-this",0]}}},"attack.rotations":{loop:!0,bones:{body:{rotation:[0,"math.sin(math.sqrt(variable.attack_time) * 360) * 11.46 - this",0]},leftarm:{rotation:["math.sin(math.sqrt(variable.attack_time) * 360) * 11.46",0,0]},rightarm:{rotation:["math.sin(1.0 - math.pow(1.0 - variable.attack_time, 3.0) * 180.0) * (variable.is_brandishing_spear ? -1.0 : 1.0 )","variable.is_brandishing_spear ? 0.0 : (math.sin(math.sqrt(variable.attack_time) * 360) * 11.46) * 2.0",0]}}},sneaking:{loop:!0,bones:{body:{rotation:["0.5 - this",0,0]},head:{position:[0,1,0]},leftarm:{rotation:[72,0,0]},leftleg:{position:[0,-3,4]},rightarm:{rotation:[72,0,0]},rightleg:{position:[0,-3,4]}}},bob:{loop:!0,bones:{leftarm:{rotation:[0,0,"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) *-1.0"]},rightarm:{rotation:[0,0,"(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},damage_nearby_mobs:{loop:!0,bones:{leftarm:{rotation:["-45.0-this","-this","-this"]},leftleg:{rotation:["45.0-this","-this","-this"]},rightarm:{rotation:["45.0-this","-this","-this"]},rightleg:{rotation:["-45.0-this","-this","-this"]}}},bow_and_arrow:{loop:!0,bones:{leftarm:{rotation:["query.target_x_rotation - 90.0 - math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation + 28.65","-(math.cos(query.life_time * 103.2) * 2.865) - 2.865"]},rightarm:{rotation:["query.target_x_rotation - 90.0 + math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation - 5.73","(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},use_item_progress:{loop:!0,bones:{rightarm:{rotation:["variable.use_item_startup_progress * -60.0 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -22.5 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -5.625 + variable.use_item_interval_progress * 11.25"]}}},zombie_attack_bare_hand:{loop:!0,bones:{leftarm:{rotation:["-90.0 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) - (math.sin(query.life_time * 76.776372) * 2.865) - this","5.73 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 0.6) - this","math.cos(query.life_time * 103.13244) * -2.865 - 2.865 - this"]},rightarm:{rotation:["90.0 * (variable.is_brandishing_spear - 1.0) - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) + (math.sin(query.life_time * 76.776372) * 2.865) - this","(math.sin(variable.attack_time * 180.0) * 57.3) * 0.6 - 5.73 - this","math.cos(query.life_time * 103.13244) * 2.865 + 2.865 - this"]}}},swimming:{loop:!0,bones:{body:{position:[0,"variable.swim_amount * -10.0 - this","variable.swim_amount * 9.0 - this"],rotation:["variable.swim_amount * (90.0 + query.target_x_rotation)",0,0]},leftarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) - (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, 14.325, variable.swim_amount) - (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},leftleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0 + 180.0) * 0.3, variable.swim_amount)",0,0]},rightarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) + (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, -14.325, variable.swim_amount) + (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},rightleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0) * 0.3, variable.swim_amount)",0,0]}}}},animation_controllers:{humanoid_baby_big_head:{initial_state:"default",states:{baby:{animations:["humanoid_big_head"],transitions:[{default:"!query.is_baby"}]},default:{transitions:[{baby:"query.is_baby"}]}}},look_at_target:{initial_state:"default",states:{default:{animations:["look_at_target_default"],transitions:[{gliding:"query.is_gliding"},{swimming:"query.is_swimming"}]},gliding:{animations:["look_at_target_gliding"],transitions:[{swimming:"query.is_swimming"},{default:"!query.is_gliding"}]},swimming:{animations:["look_at_target_swimming"],transitions:[{gliding:"query.is_gliding"},{default:"!query.is_swimming"}]}}},move:{initial_state:"default",states:{default:{animations:["move"]}}},riding:{initial_state:"default",states:{default:{transitions:[{riding:"query.is_riding"}]},riding:{animations:["riding.arms","riding.legs"],transitions:[{default:"!query.is_riding"}]}}},holding:{initial_state:"default",states:{default:{animations:["holding"]}}},brandish_spear:{initial_state:"default",states:{brandish_spear:{animations:["brandish_spear"],transitions:[{default:"!variable.is_brandishing_spear"}]},default:{transitions:[{brandish_spear:"variable.is_brandishing_spear"}]}}},charging:{initial_state:"default",states:{charging:{animations:["charging"],transitions:[{default:"!query.is_charging"}]},default:{transitions:[{charging:"query.is_charging"}]}}},attack:{initial_state:"default",states:{attacking:{animations:["attack.rotations"],transitions:[{default:"variable.attack_time < 0.0"}]},default:{transitions:[{attacking:"variable.attack_time >= 0.0"}]}}},sneaking:{initial_state:"default",states:{default:{transitions:[{sneaking:"query.is_sneaking"}]},sneaking:{animations:["sneaking"],transitions:[{default:"!query.is_sneaking"}]}}},bob:{initial_state:"default",states:{default:{animations:["bob"]}}},damage_nearby_mobs:{initial_state:"default",states:{damage_nearby_mobs:{animations:["damage_nearby_mobs"],transitions:[{default:"!variable.damage_nearby_mobs"}]},default:{transitions:[{damage_nearby_mobs:"variable.damage_nearby_mobs"}]}}},bow_and_arrow:{initial_state:"default",states:{bow_and_arrow:{animations:["bow_and_arrow"],transitions:[{default:"!query.has_target"}]},default:{transitions:[{bow_and_arrow:"query.has_target"}]}}},use_item_progress:{initial_state:"default",states:{default:{transitions:[{use_item_progress:"( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"}]},use_item_progress:{animations:["use_item_progress"],transitions:[{default:"( variable.use_item_interval_progress <= 0.0 ) && ( variable.use_item_startup_progress <= 0.0 )"}]}}},zombie_attack_bare_hand:{initial_state:"default",states:{default:{transitions:[{is_bare_hand:"variable.is_holding_left != 1.0"}]},is_bare_hand:{animations:["zombie_attack_bare_hand"],transitions:[{default:"variable.is_holding_left == 1.0"}]}}},swimming:{initial_state:"default",states:{default:{transitions:[{is_swimming:"variable.swim_amount > 0.0"}]},is_swimming:{animations:["swimming"],transitions:[{default:"variable.swim_amount <= 0.0"}]}}}},render_controllers:["controller.render.zombie"],enable_attachables:!0},zombified_piglin:{identifier:"minecraft:zombie_pigman",min_engine_version:"1.8.0",materials:{default:"zombie"},textures:{default:"textures/entity/piglin/zombified_piglin"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]},{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.25}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-5,24,-4],size:[10,8,8],uv:[0,0],inflate:-.02},{origin:[-2,24,-5],size:[4,4,1],uv:[31,1]},{origin:[2,24,-5],size:[1,2,1],uv:[2,4]},{origin:[-3,24,-5],size:[1,2,1],uv:[2,0]}],inflate:-.02},{name:"leftear",parent:"head",pivot:[5,30,0],rotation:[0,0,-30],cubes:[{origin:[4,25,-2],size:[1,5,4],uv:[51,6]}]},{name:"rightear",parent:"head",pivot:[-5,30,0],rotation:[0,0,30],cubes:[{origin:[-5,25,-2],size:[1,5,4],uv:[39,6]}]},{name:"hat",parent:"head",pivot:[0,24,0]},{name:"rightarm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]},{origin:[-8,12,-2],size:[4,12,4],uv:[40,32],inflate:.25}]},{name:"rightItem",parent:"rightarm",pivot:[-1,-45,-5]},{name:"leftarm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[32,48]},{origin:[4,12,-2],size:[4,12,4],uv:[48,48],inflate:.25}]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]},{name:"rightleg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,16]},{origin:[-4,0,-2],size:[4,12,4],uv:[0,32],inflate:.25}]},{name:"leftleg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[16,48]},{origin:[0,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]}],visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:64}},spawn_egg:{texture:"spawn_egg",texture_index:13},render_controllers:["controller.render.zombie_pigman"],enable_attachables:!0}};x();R();T();k();var Ce={};U5(Ce,{allay:()=>q3,arrow:()=>_s,axolotl:()=>Z3,blaze:()=>X3,boat:()=>Bs,camel:()=>$3,cat:()=>ts,chicken:()=>es,cod:()=>is,creeper:()=>rs,dolphin:()=>ns,ender_dragon:()=>ss,enderman:()=>os,endermite:()=>as,fox:()=>vs,frog:()=>ls,ghast:()=>cs,goat:()=>ds,guardian:()=>us,horse:()=>fs,llama:()=>hs,minecart:()=>ms,parrot:()=>ps,piglin:()=>gs,pillager:()=>bs,rabbit:()=>ys,shulker:()=>ws,sniffer:()=>As,spider:()=>Es,tadpole:()=>xs,turtle:()=>Rs,vex:()=>ks,villager:()=>Ts,warden:()=>Ms,witch:()=>Ss,wolf:()=>Cs,zombie_villager:()=>Ps});x();R();T();k();var q3=`# Made in Blockbench 4.9.4
|
|
859
|
+
`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(e){!!e!="USE_DASH"in this.defines&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){!!e!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)}};var $3=new es,ts=new es,cr=new Q7,x5=class extends j7{constructor(t=new se,e=new oe({color:Math.random()*16777215})){super(t,e),this.isWireframe=!0,this.type="Wireframe"}computeLineDistances(){let t=this.geometry,e=t.attributes.instanceStart,i=t.attributes.instanceEnd,r=new Float32Array(2*e.count);for(let o=0,a=0,v=e.count;o<v;o++,a+=2)$3.fromBufferAttribute(e,o),ts.fromBufferAttribute(i,o),r[a]=a===0?0:r[a-1],r[a+1]=r[a]+$3.distanceTo(ts);let s=new Y7(r,2,1);return t.setAttribute("instanceDistanceStart",new X3(s,1,0)),t.setAttribute("instanceDistanceEnd",new X3(s,1,1)),this}onBeforeRender(t){let e=this.material.uniforms;e&&e.resolution&&(t.getViewport(cr),this.material.uniforms.resolution.value.set(cr.z,cr.w))}};import{GLTFLoader as I8}from"three/examples/jsm/loaders/GLTFLoader.js";import H8 from"mc-assets/dist/other-textures/latest/entity/zombie/husk.png";import{Vec3 as B1}from"vec3";import O8 from"mc-assets/dist/other-textures/latest/entity/cat/ocelot.png";import z8 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/arrow.png";import D8 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/spectral_arrow.png";import F8 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/tipped_arrow.png";var is={armor_stand:{identifier:"minecraft:armor_stand",min_engine_version:"1.8.0",materials:{default:"armor_stand"},textures:{default:"textures/entity/armorstand/wood"},geometry:{default:{bones:[{name:"baseplate",parent:"waist",cubes:[{origin:[-6,0,-6],size:[12,1,12],uv:[0,32]}]},{name:"waist",pivot:[0,12,0]},{name:"body",parent:"waist",pivot:[0,13,0],cubes:[{origin:[-6,21,-1.5],size:[12,3,3],uv:[0,26]},{origin:[-3,14,-1],size:[2,7,2],uv:[16,0]},{origin:[1,14,-1],size:[2,7,2],uv:[48,16]},{origin:[-4,12,-1],size:[8,2,2],uv:[0,48]}]},{name:"head",parent:"waist",pivot:[0,12,0],cubes:[{origin:[-1,24,-1],size:[2,7,2],uv:[0,0]}]},{name:"hat",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0]}]},{name:"leftarm",parent:"waist",mirror:!0,pivot:[5,10,0],cubes:[{origin:[5,12,-1],size:[2,12,2],uv:[32,16]}]},{name:"leftitem",parent:"leftarm",pivot:[1,-9,-5]},{name:"leftleg",parent:"waist",mirror:!0,pivot:[1.9,1,0],cubes:[{origin:[.9,1,-1],size:[2,11,2],uv:[40,16]}]},{name:"rightarm",parent:"waist",pivot:[-5,10,0],cubes:[{origin:[-7,12,-1],size:[2,12,2],uv:[24,0]}]},{name:"rightitem",parent:"rightarm",pivot:[-1,-9,-5]},{name:"rightleg",parent:"waist",pivot:[-1.9,1,0],cubes:[{origin:[-2.9,1,-1],size:[2,11,2],uv:[8,0]}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64}},render_controllers:["controller.render.armor_stand"],enable_attachables:!0},arrow:{identifier:"minecraft:arrow",materials:{default:"arrow"},textures:{default:"textures/entity/arrow"},geometry:{default:{bones:[{name:"body",pivot:[0,1,0],cubes:[{origin:[0,-2.5,-3],rotation:[0,0,45],size:[0,5,16],uv:{east:{uv:[0,0]}}},{origin:[0,-2.5,-3],rotation:[0,0,-45],size:[0,5,16],uv:{east:{uv:[0,0]}}},{origin:[-2.5,-2.5,12],rotation:[0,0,45],size:[5,5,0],uv:{south:{uv:[0,5]}}}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.arrow"]},bat:{_comment:"Wing tip mirror flags are swapped vs vanilla Bedrock model: our addCube() mirror implementation flips UVs in the opposite direction, so rightWingTip needs mirror=true and leftWingTip needs mirror=false to render correctly.",identifier:"minecraft:bat",materials:{default:"bat"},textures:{default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAALHSURBVHja7VrBSiQxFJybHvci6G1gF2TBwyoKelnWy55kWYS9ePDmD+in+KcevLb7GgpqipeeTkzPpGdewSNJmx6nKtXJS3oWiwTOv33pbs6Ou9vr731YHddQ5/ZiAHa/9cXnjLln62DyLALIL48P+4AIQ+RZAP2cnO909/PH4uvRQcdh1zSqwCMPIiDPIqwT8uHufMVJuDfnOxnhq9OT7vHPZR9WZxEgSjUBUi7IcQBG++XpphfB6rgvVwCQ//f7og8WAeL8F6Kr6oD7X8s+PPuOmQNYAAsIUOIAkDeSLIK1LeCMagIweZQ8iRkBlJuYl5gwSlxjZ2R9KM/2XBphsyxEQGhfOCEVNQXQ0UZdo2i21+edR57DmxjZFRpTCaD2/7QAXsAFcEKq3zYEGHJBtgCeC97f3vtnG0uY1e1aavQ3/QgMuaBoDtCsDyWv3yqSlxhpTClAygXZArAILIaS8ezOo52TIJVA1/sqAswRnhCfEoAnuqGkZwpbZxJfyflTQuysAN7GxxNiZ62fEoCFMBGqpcK8h8ckqIkRoiU3VPkHIM/2R4rMaTLK0pGr9oVrw9v7Iy/QDLFEAH5umxTAW9utreTHOuD1+e/KaQ4mrGrb1ykE0L07HODFmKMsJs1b2GYfAc0MdYPEThiTvIA8DjWayNxSs3pJePPDOvJNCKDL27r22L95AlRJXaewuh57cVuPx7Acen1VlNkIoKR0++udCer84PXn42wj660EW38BooS99rqTn1R/FkCTnibyAH3l5bW9GOqjx+Wa8TWVCXpn/NzW63oIote1bH6HlSKUK0BKkFkIgDSX01+taz9+vTV0X/MC6Hu+1OFmSb9tHp6MRopIrQgBAjMDtr2bfOvb3KTIP2vZy9HnvH6vXJD6ZdheOYAJl/yOZ/YCMOFYygKBQCAQCAQCgUAgEAgEAoFAIBDYKXwAXSs8dJ1Ggb4AAAAASUVORK5CYII="},geometry:{default:{texturewidth:64,textureheight:64,visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],bones:[{name:"head",pivot:[0,24,0],cubes:[{origin:[-3,21,-3],size:[6,6,6],uv:[0,0]}]},{name:"rightEar",pivot:[0,24,0],cubes:[{origin:[-4,26,-2],size:[3,4,1],uv:[24,0]}],parent:"head"},{name:"leftEar",mirror:!0,pivot:[0,24,0],cubes:[{origin:[1,26,-2],size:[3,4,1],uv:[24,0]}],parent:"head"},{name:"body",pivot:[0,24,0],cubes:[{origin:[-3,8,-3],size:[6,12,6],uv:[0,16]},{origin:[-5,-8,0],size:[10,16,1],uv:[0,34]}]},{name:"rightWing",pivot:[0,24,0],cubes:[{origin:[-12,7,1.5],size:[10,16,1],uv:[42,0]}],parent:"body"},{name:"rightWingTip",mirror:!0,pivot:[-12,23,1.5],cubes:[{origin:[-20,10,1.5],size:[8,12,1],uv:[24,16]}],parent:"rightWing"},{name:"leftWing",mirror:!0,pivot:[0,24,0],cubes:[{origin:[2,7,1.5],size:[10,16,1],uv:[42,0]}],parent:"body"},{name:"leftWingTip",pivot:[12,23,1.5],cubes:[{origin:[12,10,1.5],size:[8,12,1],uv:[24,16]}],parent:"leftWing"}]}},render_controllers:["controller.render.bat"],spawn_egg:{texture:"spawn_egg",texture_index:18}},bee:{identifier:"minecraft:bee",materials:{default:"bee"},textures:{default:"textures/entity/bee/bee",angry:"textures/entity/bee/bee_angry",nectar:"textures/entity/bee/bee_nectar",angry_nectar:"textures/entity/bee/bee_angry_nectar"},geometry:{default:{texturewidth:64,textureheight:64,visible_bounds_width:1.5,visible_bounds_height:1.5,visible_bounds_offset:[0,.25,0],bones:[{name:"body",pivot:[.5,5,0],cubes:[{origin:[-3,2,-5],size:[7,7,10],uv:[0,0]},{origin:[2,7,-8],size:[1,2,3],uv:[2,0]},{origin:[-2,7,-8],size:[1,2,3],uv:[2,3]}],locators:{lead:[0,4,-1]}},{name:"stinger",parent:"body",pivot:[.5,6,1],cubes:[{origin:[.5,5,5],size:[0,1,2],uv:[26,7]}]},{name:"rightwing_bone",parent:"body",pivot:[-1,9,-3],rotation:[15,-15,0],cubes:[{origin:[-10,9,-3],size:[9,0,6],uv:[0,18]}]},{name:"leftwing_bone",parent:"body",pivot:[2,9,-3],rotation:[15,15,0],cubes:[{origin:[2,9,-3],size:[9,0,6],uv:[9,24]}]},{name:"leg_front",parent:"body",pivot:[2,2,-2],cubes:[{origin:[-3,0,-2],size:[7,2,0],uv:[26,1]}]},{name:"leg_mid",parent:"body",pivot:[2,2,0],cubes:[{origin:[-3,0,0],size:[7,2,0],uv:[26,3]}]},{name:"leg_back",parent:"body",pivot:[2,2,2],cubes:[{origin:[-3,0,2],size:[7,2,0],uv:[26,5]}]}]}},particle_effects:{nectar_dripping:"minecraft:nectar_drip_particle"},render_controllers:["controller.render.bee"],spawn_egg:{texture:"egg_bee",texture_index:0}},cave_spider:{identifier:"minecraft:cave_spider",min_engine_version:"1.8.0",materials:{default:"spider",invisible:"spider_invisible"},textures:{default:"textures/entity/spider/cave_spider"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"head",pivot:[0,9,-3],cubes:[{origin:[-4,5,-11],size:[8,8,8],uv:[32,4]}],parent:"body0"},{name:"body0",pivot:[0,9,0],cubes:[{origin:[-3,6,-3],size:[6,6,6],uv:[0,0]}]},{name:"body1",pivot:[0,9,9],cubes:[{origin:[-5,5,3],size:[10,8,12],uv:[0,12]}],parent:"body0"},{name:"leg0",pivot:[-4,9,2],cubes:[{origin:[-19,8,1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg1",pivot:[4,9,2],cubes:[{origin:[3,8,1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg2",pivot:[-4,9,1],cubes:[{origin:[-19,8,0],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg3",pivot:[4,9,1],cubes:[{origin:[3,8,0],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg4",pivot:[-4,9,0],cubes:[{origin:[-19,8,-1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg5",pivot:[4,9,0],cubes:[{origin:[3,8,-1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg6",pivot:[-4,9,-1],cubes:[{origin:[-19,8,-2],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg7",pivot:[4,9,-1],cubes:[{origin:[3,8,-2],size:[16,2,2],uv:[18,0]}],parent:"body0"}]}},render_controllers:["controller.render.spider"],spawn_egg:{texture:"spawn_egg",texture_index:22}},chest_minecart:{identifier:"minecraft:chest_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},command_block_minecart:{identifier:"minecraft:command_block_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},cow:{identifier:"minecraft:cow",min_engine_version:"1.8.0",materials:{default:"cow"},textures:{default:"textures/entity/cow/cow"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.75,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-6,11,-5],size:[12,18,10],uv:[18,4]},{origin:[-2,11,-6],size:[4,6,1],uv:[52,0]}]},{name:"head",parent:"body",pivot:[0,20,-8],locators:{lead:[0,20,-8]},cubes:[{origin:[-4,16,-14],size:[8,8,6],uv:[0,0]},{origin:[-5,22,-12],size:[1,3,1],uv:[22,0]},{origin:[4,22,-12],size:[1,3,1],uv:[22,0]}]},{name:"leg0",parent:"body",pivot:[-4,12,7],cubes:[{origin:[-6,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[4,12,7],cubes:[{origin:[2,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-4,12,-6],cubes:[{origin:[-6,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[4,12,-6],cubes:[{origin:[2,0,-7],size:[4,12,4],uv:[0,16]}]}]}},render_controllers:["controller.render.cow"],spawn_egg:{texture:"spawn_egg",texture_index:1}},dragon_fireball:{identifier:"minecraft:dragon_fireball",materials:{default:"fireball"},textures:{default:"textures/entity/enderdragon/dragon_fireball"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},drowned:{identifier:"minecraft:drowned",min_engine_version:"1.16.0",materials:{default:"drowned"},textures:{default:"textures/entity/zombie/drowned"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}]},{name:"jacket",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.5}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0],inflate:.5}]},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:1}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-7,12,-2],size:[4,12,4],uv:[0,16]}]},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16],mirror:!0}]},{name:"rightSleeve",parent:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-7,12,-2],size:[4,12,4],uv:[48,48],inflate:.5}]},{name:"leftSleeve",parent:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,32],inflate:.5,mirror:!0}]},{name:"rightLeg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4.05,0,-2],size:[4,12,4],uv:[16,48]}]},{name:"leftLeg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[.05,0,-2],size:[4,12,4],uv:[32,48],mirror:!0}]},{name:"rightPants",parent:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-4.25,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]},{name:"leftPants",parent:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[.25,0,-2],size:[4,12,4],uv:[0,32],inflate:.25,mirror:!0}]},{name:"waist",parent:"body",pivot:[0,12,0]},{name:"rightItem",parent:"rightArm",pivot:[-1,-45,-5]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]}],visible_bounds_width:2.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64}},render_controllers:["controller.render.drowned"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:48}},egg:{identifier:"minecraft:egg",materials:{default:"egg"},textures:{default:"textures/items/egg"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},elder_guardian:{identifier:"minecraft:elder_guardian",min_engine_version:"1.8.0",materials:{default:"guardian",ghost:"guardian_ghost"},textures:{default:"textures/entity/guardian",elder:"textures/entity/guardian_elder",beam:"textures/entity/guardian_beam"},geometry:{default:{visible_bounds_width:3.5,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,0,0],mirror:!0,cubes:[{mirror:!1,origin:[-6,2,-8],size:[12,12,16],uv:[0,0]},{mirror:!1,origin:[-8,2,-6],size:[2,12,12],uv:[0,28]},{origin:[6,2,-6],size:[2,12,12],uv:[0,28]},{origin:[-6,14,-6],size:[12,2,12],uv:[16,40]},{origin:[-6,0,-6],size:[12,2,12],uv:[16,40]}]},{name:"eye",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,6,0],size:[2,2,1],uv:[8,0]}]},{name:"tailpart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-2,6,7],size:[4,4,8],uv:[40,0]}]},{name:"tailpart1",parent:"tailpart0",pivot:[0,24,0],cubes:[{origin:[0,7,0],size:[3,3,7],uv:[0,54]}]},{name:"tailpart2",parent:"tailpart1",pivot:[0,24,0],cubes:[{origin:[0,8,0],size:[2,2,6],uv:[41,32]},{origin:[1,4.5,3],size:[1,9,9],uv:[25,19]}]},{name:"spikepart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart1",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart2",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart3",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart4",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart5",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart6",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart7",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart8",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart9",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart10",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart11",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]}]},ghost:{visible_bounds_width:3.5,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,24,0],mirror:!0,cubes:[{mirror:!1,origin:[-6,2,-8],size:[12,12,16],uv:[0,0]},{mirror:!1,origin:[-8,2,-6],size:[2,12,12],uv:[0,28]},{origin:[6,2,-6],size:[2,12,12],uv:[0,28]},{origin:[-6,14,-6],size:[12,2,12],uv:[16,40]},{origin:[-6,0,-6],size:[12,2,12],uv:[16,40]}]},{name:"eye",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,7,0],size:[2,2,1],uv:[8,0]}]},{name:"tailpart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-2,6,7],size:[4,4,8],uv:[40,0]}]},{name:"tailpart1",parent:"tailpart0",pivot:[0,24,0],cubes:[{origin:[0,7,0],size:[3,3,7],uv:[0,54]}]},{name:"tailpart2",parent:"tailpart1",pivot:[0,24,0],cubes:[{origin:[0,8,0],size:[2,2,6],uv:[41,32]},{origin:[1,4.5,3],size:[1,9,9],uv:[25,19]}]},{name:"spikepart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart1",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart2",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart3",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart4",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart5",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart6",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart7",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart8",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart9",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart10",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart11",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]}]}},render_controllers:["controller.render.guardian"],spawn_egg:{texture:"spawn_egg",texture_index:36}},eye_of_ender:{identifier:"minecraft:eye_of_ender_signal",materials:{default:"eye_of_ender_signal"},textures:{default:"textures/items/ender_eye"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},ender_pearl:{identifier:"minecraft:ender_pearl",materials:{default:"ender_pearl"},textures:{default:"textures/items/ender_pearl"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},evoker_fangs:{identifier:"minecraft:evocation_fang",materials:{default:"fang"},textures:{default:"textures/entity/illager/evoker_fangs"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:64,textureheight:32,bones:[{name:"upper_jaw",parent:"base",pivot:[0,11,0],cubes:[{origin:[-1.5,0,-4],size:[4,14,8],uv:[40,0],inflate:.01}]},{name:"lower_jaw",parent:"base",pivot:[0,11,0],bind_pose_rotation:[0,180,0],cubes:[{origin:[-1.5,0,-4],size:[4,14,8],uv:[40,0]}]},{name:"base",pivot:[0,0,0],bind_pose_rotation:[0,90,0],cubes:[{origin:[-5,0,-5],size:[10,12,10],uv:[0,0]}]}]}},render_controllers:["controller.render.evocation_fang"]},evoker:{identifier:"minecraft:evocation_illager",min_engine_version:"1.8.0",materials:{default:"evoker"},textures:{default:"textures/entity/illager/evoker"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22]},{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]}]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],mirror:!0,cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],locators:{right_hand:[-6,12,0]},cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,46]}]},{name:"rightItem",pivot:[-5.5,16,.5],neverRender:!0,parent:"rightArm"},{name:"leftArm",parent:"body",pivot:[5,22,0],locators:{left_hand:[6,12,0]},mirror:!0,cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,46]}]}]}},particle_effects:{spell:"minecraft:evoker_spell"},render_controllers:["controller.render.evoker"],spawn_egg:{texture:"spawn_egg",texture_index:40}},experience_bottle:{identifier:"minecraft:xp_bottle",materials:{default:"xp_bottle"},textures:{default:"textures/items/experience_bottle",enchanted:"textures/misc/enchanted_item_glint"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.experience_bottle"]},experience_orb:{identifier:"minecraft:xp_orb",materials:{default:"experience_orb"},textures:{default:"textures/entity/experience_orb"},geometry:{default:{bones:[{name:"body",pivot:[8,8,0],cubes:[{origin:[0,0,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:64,textureheight:64}},render_controllers:["controller.render.experience_orb"]},fireball:{identifier:"minecraft:fireball",materials:{default:"fireball"},textures:{default:"textures/items/fire_charge"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},firework_rocket:{identifier:"minecraft:fireworks_rocket",materials:{default:"fireworks_rocket"},textures:{default:"textures/entity/fireworks"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],rotation:[0,90,0],size:[16,16,0],uv:{north:{uv:[0,0]}}},{origin:[-8,-8,0],rotation:[90,90,0],size:[16,16,0],uv:{north:{uv:[0,0]}}}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.fireworks_rocket"]},fishing_bobber:{identifier:"minecraft:fishing_hook",materials:{default:"fishing_hook"},textures:{default:"textures/entity/fishing_hook"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-1.5,-1.5,-1.5],size:[3,3,3],rotation:[0,0,180],uv:{up:{uv:[0,0]},down:{uv:[3,0]},south:{uv:[9,0],uv_size:[-3,3]},north:{uv:[9,0]},east:{uv:[12,0]},west:{uv:[15,0]}}},{origin:[0,-4.5,-.5],size:[0,3,3],uv:{east:{uv:[18,0]}}},{origin:[0,1.5,-1.5],size:[0,3,3],uv:{east:{uv:[21,0]}}},{origin:[-1.5,1.5,0],size:[3,3,0],uv:{north:{uv:[21,0]}}}]}],texturewidth:24,textureheight:3}},render_controllers:["controller.render.fishing_hook"]},hoglin:{identifier:"minecraft:hoglin",materials:{default:"hoglin"},textures:{default:"textures/entity/hoglin/hoglin"},geometry:{default:{bones:[{name:"body",pivot:[0,19,-3],cubes:[{origin:[-8,11,-7],size:[16,14,26],inflate:.02,uv:[1,1]},{origin:[0,22,-10],size:[0,10,19],inflate:.02,uv:[90,33]}],locators:{lead:[0,20,-5]}},{name:"head",parent:"body",pivot:[0,22,-5],rotation:[50,0,0],cubes:[{origin:[-7,21,-24],size:[14,6,19],uv:[61,1]},{origin:[-8,22,-19],size:[2,11,2],uv:[1,13]},{origin:[6,22,-19],size:[2,11,2],uv:[1,13]}]},{name:"right_ear",parent:"head",pivot:[-7,27,-7],rotation:[0,0,-50],cubes:[{origin:[-13,26,-10],size:[6,1,4],uv:[1,1]}]},{name:"left_ear",parent:"head",pivot:[7,27,-7],rotation:[0,0,50],cubes:[{origin:[7,26,-10],size:[6,1,4],uv:[1,6]}]},{name:"leg_back_right",pivot:[6,8,17],cubes:[{origin:[-8,0,13],size:[5,11,5],uv:[21,45]}]},{name:"leg_back_left",pivot:[-6,8,17],cubes:[{origin:[3,0,13],size:[5,11,5],uv:[0,45]}]},{name:"leg_front_right",pivot:[-6,12,-3],cubes:[{origin:[-8,0,-6],size:[6,14,6],uv:[66,42]}]},{name:"leg_front_left",pivot:[6,12,-3],cubes:[{origin:[2,0,-6],size:[6,14,6],uv:[41,42]}]}],visible_bounds_width:4,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:64}},spawn_egg:{base_color:"#C66E55",overlay_color:"#5f6464"},render_controllers:["controller.render.hoglin"]},hopper_minecart:{identifier:"minecraft:hopper_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},husk:{identifier:"minecraft:husk",min_engine_version:"1.8.0",materials:{default:"husk"},textures:{default:"textures/entity/zombie/husk"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],mirror:!0,parent:"body"}]}},scripts:{pre_animation:["variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;"]},animations:{humanoid_big_head:{loop:!0,bones:{head:{scale:1.4}}},look_at_target_default:{loop:!0,bones:{head:{relative_to:{rotation:"entity"},rotation:["query.target_x_rotation","query.target_y_rotation",0]}}},look_at_target_gliding:{loop:!0,bones:{head:{rotation:[-45,"query.target_y_rotation",0]}}},look_at_target_swimming:{loop:!0,bones:{head:{rotation:["math.lerp(query.target_x_rotation, -45.0, variable.swim_amount)","query.target_y_rotation",0]}}},move:{loop:!0,bones:{leftarm:{rotation:["variable.tcos0",0,0]},leftleg:{rotation:["variable.tcos0 * -1.4",0,0]},rightarm:{rotation:["-variable.tcos0",0,0]},rightleg:{rotation:["variable.tcos0 * 1.4",0,0]}}},"riding.arms":{loop:!0,bones:{leftarm:{rotation:[-36,0,0]},rightarm:{rotation:[-36,0,0]}}},"riding.legs":{loop:!0,bones:{leftleg:{rotation:["-72.0 - this","-18.0 - this","-this"]},rightleg:{rotation:["-72.0 - this","18.0 - this","-this"]}}},holding:{loop:!0,bones:{leftarm:{rotation:["variable.is_holding_left ? (-this * 0.5 - 18.0) : 0.0",0,0]},rightarm:{rotation:["variable.is_holding_right ? (-this * 0.5 - 18.0) : 0.0",0,0]}}},brandish_spear:{loop:!0,bones:{rightarm:{rotation:["this * -0.5 - 157.5 - 22.5 * variable.charge_amount","-this",0]}}},charging:{loop:!0,bones:{rightarm:{rotation:["22.5 * variable.charge_amount - this","-this",0]}}},"attack.rotations":{loop:!0,bones:{body:{rotation:[0,"math.sin(math.sqrt(variable.attack_time) * 360) * 11.46 - this",0]},leftarm:{rotation:["math.sin(math.sqrt(variable.attack_time) * 360) * 11.46",0,0]},rightarm:{rotation:["math.sin(1.0 - math.pow(1.0 - variable.attack_time, 3.0) * 180.0) * (variable.is_brandishing_spear ? -1.0 : 1.0 )","variable.is_brandishing_spear ? 0.0 : (math.sin(math.sqrt(variable.attack_time) * 360) * 11.46) * 2.0",0]}}},sneaking:{loop:!0,bones:{body:{rotation:["0.5 - this",0,0]},head:{position:[0,1,0]},leftarm:{rotation:[72,0,0]},leftleg:{position:[0,-3,4]},rightarm:{rotation:[72,0,0]},rightleg:{position:[0,-3,4]}}},bob:{loop:!0,bones:{leftarm:{rotation:[0,0,"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) *-1.0"]},rightarm:{rotation:[0,0,"(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},damage_nearby_mobs:{loop:!0,bones:{leftarm:{rotation:["-45.0-this","-this","-this"]},leftleg:{rotation:["45.0-this","-this","-this"]},rightarm:{rotation:["45.0-this","-this","-this"]},rightleg:{rotation:["-45.0-this","-this","-this"]}}},bow_and_arrow:{loop:!0,bones:{leftarm:{rotation:["query.target_x_rotation - 90.0 - math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation + 28.65","-(math.cos(query.life_time * 103.2) * 2.865) - 2.865"]},rightarm:{rotation:["query.target_x_rotation - 90.0 + math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation - 5.73","(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},use_item_progress:{loop:!0,bones:{rightarm:{rotation:["variable.use_item_startup_progress * -60.0 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -22.5 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -5.625 + variable.use_item_interval_progress * 11.25"]}}},zombie_attack_bare_hand:{loop:!0,bones:{leftarm:{rotation:["-90.0 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) - (math.sin(query.life_time * 76.776372) * 2.865) - this","5.73 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 0.6) - this","math.cos(query.life_time * 103.13244) * -2.865 - 2.865 - this"]},rightarm:{rotation:["90.0 * (variable.is_brandishing_spear - 1.0) - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) + (math.sin(query.life_time * 76.776372) * 2.865) - this","(math.sin(variable.attack_time * 180.0) * 57.3) * 0.6 - 5.73 - this","math.cos(query.life_time * 103.13244) * 2.865 + 2.865 - this"]}}},swimming:{loop:!0,bones:{body:{position:[0,"variable.swim_amount * -10.0 - this","variable.swim_amount * 9.0 - this"],rotation:["variable.swim_amount * (90.0 + query.target_x_rotation)",0,0]},leftarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) - (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, 14.325, variable.swim_amount) - (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},leftleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0 + 180.0) * 0.3, variable.swim_amount)",0,0]},rightarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) + (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, -14.325, variable.swim_amount) + (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},rightleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0) * 0.3, variable.swim_amount)",0,0]}}}},animation_controllers:{humanoid_baby_big_head:{initial_state:"default",states:{baby:{animations:["humanoid_big_head"],transitions:[{default:"!query.is_baby"}]},default:{transitions:[{baby:"query.is_baby"}]}}},look_at_target:{initial_state:"default",states:{default:{animations:["look_at_target_default"],transitions:[{gliding:"query.is_gliding"},{swimming:"query.is_swimming"}]},gliding:{animations:["look_at_target_gliding"],transitions:[{swimming:"query.is_swimming"},{default:"!query.is_gliding"}]},swimming:{animations:["look_at_target_swimming"],transitions:[{gliding:"query.is_gliding"},{default:"!query.is_swimming"}]}}},move:{initial_state:"default",states:{default:{animations:["move"]}}},riding:{initial_state:"default",states:{default:{transitions:[{riding:"query.is_riding"}]},riding:{animations:["riding.arms","riding.legs"],transitions:[{default:"!query.is_riding"}]}}},holding:{initial_state:"default",states:{default:{animations:["holding"]}}},brandish_spear:{initial_state:"default",states:{brandish_spear:{animations:["brandish_spear"],transitions:[{default:"!variable.is_brandishing_spear"}]},default:{transitions:[{brandish_spear:"variable.is_brandishing_spear"}]}}},charging:{initial_state:"default",states:{charging:{animations:["charging"],transitions:[{default:"!query.is_charging"}]},default:{transitions:[{charging:"query.is_charging"}]}}},attack:{initial_state:"default",states:{attacking:{animations:["attack.rotations"],transitions:[{default:"variable.attack_time < 0.0"}]},default:{transitions:[{attacking:"variable.attack_time >= 0.0"}]}}},sneaking:{initial_state:"default",states:{default:{transitions:[{sneaking:"query.is_sneaking"}]},sneaking:{animations:["sneaking"],transitions:[{default:"!query.is_sneaking"}]}}},bob:{initial_state:"default",states:{default:{animations:["bob"]}}},damage_nearby_mobs:{initial_state:"default",states:{damage_nearby_mobs:{animations:["damage_nearby_mobs"],transitions:[{default:"!variable.damage_nearby_mobs"}]},default:{transitions:[{damage_nearby_mobs:"variable.damage_nearby_mobs"}]}}},bow_and_arrow:{initial_state:"default",states:{bow_and_arrow:{animations:["bow_and_arrow"],transitions:[{default:"!query.has_target"}]},default:{transitions:[{bow_and_arrow:"query.has_target"}]}}},use_item_progress:{initial_state:"default",states:{default:{transitions:[{use_item_progress:"( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"}]},use_item_progress:{animations:["use_item_progress"],transitions:[{default:"( variable.use_item_interval_progress <= 0.0 ) && ( variable.use_item_startup_progress <= 0.0 )"}]}}},zombie_attack_bare_hand:{initial_state:"default",states:{default:{transitions:[{is_bare_hand:"variable.is_holding_left != 1.0"}]},is_bare_hand:{animations:["zombie_attack_bare_hand"],transitions:[{default:"variable.is_holding_left == 1.0"}]}}},swimming:{initial_state:"default",states:{default:{transitions:[{is_swimming:"variable.swim_amount > 0.0"}]},is_swimming:{animations:["swimming"],transitions:[{default:"variable.swim_amount <= 0.0"}]}}}},render_controllers:["controller.render.husk"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:28}},iron_golem:{identifier:"minecraft:iron_golem",materials:{default:"iron_golem"},textures:{default:"textures/entity/iron_golem/iron_golem"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:128,bones:[{name:"body",pivot:[0,31,0],cubes:[{origin:[-9,21,-6],size:[18,12,11],uv:[0,40]},{origin:[-4.5,16,-3],size:[9,5,6],uv:[0,70],inflate:.5}]},{name:"head",parent:"body",pivot:[0,31,-2],locators:{lead:[0,31,-2]},cubes:[{origin:[-4,33,-7.5],size:[8,10,8],uv:[0,0]},{origin:[-1,32,-9.5],size:[2,4,2],uv:[24,0]}]},{name:"arm0",parent:"body",pivot:[0,31,0],cubes:[{origin:[-13,3.5,-3],size:[4,30,6],uv:[60,21]}]},{name:"arm1",parent:"body",pivot:[0,31,0],cubes:[{origin:[9,3.5,-3],size:[4,30,6],uv:[60,58]}]},{name:"leg0",parent:"body",pivot:[-4,13,0],cubes:[{origin:[-7.5,0,-3],size:[6,16,5],uv:[37,0]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[5,13,0],cubes:[{origin:[1.5,0,-3],size:[6,16,5],uv:[60,0]}]}]}},render_controllers:["controller.render.iron_golem"]},item_frame:{identifier:"minecraft:item_frame",materials:{default:"item_frame"},textures:{background:"block:item_frame",frame:"block:oak_planks"},geometry:{background:{bones:[{name:"base"},{name:"background",parent:"base",rotation:[0,180,0],pivot:[0,0,0],cubes:[{origin:[-5,-5,-8],size:[10,10,.5],uv:[3,3]}]}],texturewidth:16,textureheight:16},frame:{bones:[{name:"frame",parent:"base",rotation:[0,180,0],pivot:[0,0,0],cubes:[{origin:[-6,-6,-8],size:[12,1,1],uv:[2,2]},{origin:[-6,5,-8],size:[12,1,1],uv:[2,13]},{origin:[-6,-5,-8],size:[1,10,1],uv:[2,3]},{origin:[5,-5,-8],size:[1,10,1],uv:[13,3]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_frame"]},leash_knot:{identifier:"minecraft:leash_knot",materials:{default:"leash_knot"},textures:{default:"textures/entity/lead_knot"},geometry:{default:{bones:[{name:"knot",rotation:[0,180,0],cubes:[{origin:[5,6,5],size:[6,8,6],uv:[0,0]}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.leash_knot"]},llama_spit:{identifier:"minecraft:llama_spit",materials:{default:"llama_spit"},textures:{default:"textures/entity/llama/spit"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,22,0],size:[2,2,2],uv:[0,0]},{origin:[0,26,0],size:[2,2,2],uv:[0,0]},{origin:[0,22,-4],size:[2,2,2],uv:[0,0]},{origin:[0,22,0],size:[2,2,2],uv:[0,0]},{origin:[2,22,0],size:[2,2,2],uv:[0,0]},{origin:[0,20,0],size:[2,2,2],uv:[0,0]},{origin:[0,22,2],size:[2,2,2],uv:[0,0]}]}]}},render_controllers:["controller.render.llama_spit"]},magma_cube:{identifier:"minecraft:magma_cube",materials:{default:"magma_cube"},textures:{default:"textures/entity/slime/magmacube"},geometry:{default:{visible_bounds_width:2.5,visible_bounds_height:5,visible_bounds_offset:[0,2.5,0],texturewidth:64,textureheight:32,bones:[{name:"bodyCube_0",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,7,-4],size:[8,1,8],uv:[0,0]}]},{name:"bodyCube_1",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,6,-4],size:[8,1,8],uv:[0,1]}]},{name:"bodyCube_2",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,5,-4],size:[8,1,8],uv:[24,10]}]},{name:"bodyCube_3",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,4,-4],size:[8,1,8],uv:[24,19]}]},{name:"bodyCube_4",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,3,-4],size:[8,1,8],uv:[0,4]}]},{name:"bodyCube_5",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,2,-4],size:[8,1,8],uv:[0,5]}]},{name:"bodyCube_6",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,1,-4],size:[8,1,8],uv:[0,6]}]},{name:"bodyCube_7",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,0,-4],size:[8,1,8],uv:[0,7]}]},{name:"insideCube",pivot:[0,0,0],cubes:[{origin:[-2,2,-2],size:[4,4,4],uv:[0,16]}]}]}},render_controllers:["controller.render.magma_cube"],spawn_egg:{texture:"spawn_egg",texture_index:20}},mooshroom:{identifier:"minecraft:mooshroom",min_engine_version:"1.8.0",materials:{default:"mooshroom"},textures:{default:"textures/entity/cow/red_mooshroom",brown:"textures/entity/cow/brown_mooshroom"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-6,11,-5],size:[12,18,10],uv:[18,4]},{origin:[-2,11,-6],size:[4,6,1],uv:[52,0]}]},{name:"head",pivot:[0,20,-8],locators:{lead:[0,20,-8]},cubes:[{origin:[-4,16,-14],size:[8,8,6],uv:[0,0]},{origin:[-5,22,-12],size:[1,3,1],uv:[22,0]},{origin:[4,22,-12],size:[1,3,1],uv:[22,0]}]},{name:"leg0",parent:"body",pivot:[-4,12,7],cubes:[{origin:[-6,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[4,12,7],cubes:[{origin:[2,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-4,12,-6],cubes:[{origin:[-6,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[4,12,-6],cubes:[{origin:[2,0,-7],size:[4,12,4],uv:[0,16]}]}]}},render_controllers:["controller.render.mooshroom"],spawn_egg:{texture:"spawn_egg",texture_index:5}},panda:{identifier:"minecraft:panda",materials:{default:"panda"},textures:{default:"textures/entity/panda/panda",lazy:"textures/entity/panda/lazy_panda",worried:"textures/entity/panda/worried_panda",playful:"textures/entity/panda/playful_panda",brown:"textures/entity/panda/brown_panda",weak:"textures/entity/panda/weak_panda",aggressive:"textures/entity/panda/aggressive_panda"},geometry:{default:{texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,12.5,-17],locators:{lead:[0,14,-16]},cubes:[{origin:[-6.5,7.5,-21],size:[13,10,9],uv:[0,6]},{origin:[-3.5,7.5,-23],size:[7,5,2],uv:[45,16]},{origin:[-8.5,16.5,-18],size:[5,4,1],uv:[52,25]},{origin:[3.5,16.5,-18],size:[5,4,1],uv:[52,25]}]},{name:"body",pivot:[0,14,0],bind_pose_rotation:[90,0,0],cubes:[{origin:[-9.5,1,-6.5],size:[19,26,13],uv:[0,25]}]},{name:"leg0",parent:"body",pivot:[-5.5,9,9],cubes:[{origin:[-8.5,0,6],size:[6,9,6],uv:[40,0]}]},{name:"leg1",parent:"body",pivot:[5.5,9,9],cubes:[{origin:[2.5,0,6],size:[6,9,6],uv:[40,0]}]},{name:"leg2",parent:"body",pivot:[-5.5,9,-9],cubes:[{origin:[-8.5,0,-12],size:[6,9,6],uv:[40,0]}]},{name:"leg3",parent:"body",pivot:[5.5,9,-9],cubes:[{origin:[2.5,0,-12],size:[6,9,6],uv:[40,0]}]}]}},render_controllers:["controller.render.panda"],spawn_egg:{texture:"spawn_egg",texture_index:54}},phantom:{identifier:"minecraft:phantom",materials:{default:"phantom",invisible:"phantom_invisible"},textures:{default:"textures/entity/phantom"},geometry:{default:{texturewidth:64,textureheight:64,bones:[{name:"body",pivot:[0,24,0],bind_pose_rotation:[0,0,0],cubes:[{origin:[-3,23,-8],size:[5,3,9],uv:[0,8]}]},{name:"wing0",pivot:[2,26,-8],bind_pose_rotation:[0,0,5.7],cubes:[{origin:[2,24,-8],size:[6,2,9],uv:[23,12]}],parent:"body"},{name:"wingtip0",pivot:[8,26,-8],bind_pose_rotation:[0,0,5.7],locators:{left_wing:[21,26,0]},cubes:[{origin:[8,25,-8],size:[13,1,9],uv:[16,24]}],parent:"wing0"},{name:"wing1",pivot:[-3,26,-8],bind_pose_rotation:[0,0,-5.7],mirror:!0,cubes:[{origin:[-9,24,-8],size:[6,2,9],uv:[23,12]}],parent:"body"},{name:"wingtip1",pivot:[-9,24,-8],bind_pose_rotation:[0,0,-5.7],locators:{right_wing:[-22,24,0]},mirror:!0,cubes:[{origin:[-22,25,-8],size:[13,1,9],uv:[16,24]}],parent:"wing1"},{name:"head",pivot:[0,23,-7],bind_pose_rotation:[11.5,0,0],cubes:[{origin:[-4,22,-12],size:[7,3,5],uv:[0,0]}],parent:"body"},{name:"tail",pivot:[0,26,1],bind_pose_rotation:[0,0,0],cubes:[{origin:[-2,24,1],size:[3,2,6],uv:[3,20]}],parent:"body"},{name:"tailtip",pivot:[0,25.5,7],bind_pose_rotation:[0,0,0],cubes:[{origin:[-1,24.5,7],size:[1,1,6],uv:[4,29]}],parent:"tail"}]}},particle_effects:{wing_dust:"minecraft:phantom_trail_particle"},sound_effects:{flap:"mob.phantom.flap"},render_controllers:["controller.render.phantom"],spawn_egg:{texture:"spawn_egg",texture_index:51}},pig:{identifier:"minecraft:pig",min_engine_version:"1.8.0",materials:{default:"pig"},textures:{default:"textures/entity/pig/pig",saddled:"textures/entity/pig/pig_saddle"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,13,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-5,7,-5],size:[10,16,8],uv:[28,8]}]},{name:"head",parent:"body",pivot:[0,12,-6],locators:{lead:[0,14,-6]},cubes:[{origin:[-4,8,-14],size:[8,8,8],uv:[0,0]},{origin:[-2,9,-15],size:[4,3,1],uv:[16,16]}]},{name:"leg0",parent:"body",pivot:[-3,6,7],cubes:[{origin:[-5,0,5],size:[4,6,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[3,6,7],cubes:[{origin:[1,0,5],size:[4,6,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-3,6,-5],cubes:[{origin:[-5,0,-7],size:[4,6,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[3,6,-5],cubes:[{origin:[1,0,-7],size:[4,6,4],uv:[0,16]}]}]}},render_controllers:["controller.render.pig"],spawn_egg:{texture:"spawn_egg",texture_index:2}},piglin_brute:{identifier:"minecraft:piglin_brute",materials:{default:"piglin_brute"},textures:{default:"textures/entity/piglin/piglin_brute"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]},{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.25}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-5,24,-4],size:[10,8,8],uv:[0,0],inflate:-.02},{origin:[-2,24,-5],size:[4,4,1],uv:[31,1]},{origin:[2,24,-5],size:[1,2,1],uv:[2,4]},{origin:[-3,24,-5],size:[1,2,1],uv:[2,0]}],inflate:-.02},{name:"leftear",parent:"head",pivot:[5,30,0],rotation:[0,0,-30],cubes:[{origin:[4,25,-2],size:[1,5,4],uv:[51,6]}]},{name:"rightear",parent:"head",pivot:[-5,30,0],rotation:[0,0,30],cubes:[{origin:[-5,25,-2],size:[1,5,4],uv:[39,6]}]},{name:"hat",parent:"head",pivot:[0,24,0]},{name:"rightarm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]},{origin:[-8,12,-2],size:[4,12,4],uv:[40,32],inflate:.25}]},{name:"rightItem",parent:"rightarm",pivot:[-1,-45,-5]},{name:"leftarm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[32,48]},{origin:[4,12,-2],size:[4,12,4],uv:[48,48],inflate:.25}]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]},{name:"rightleg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,16]},{origin:[-4,0,-2],size:[4,12,4],uv:[0,32],inflate:.25}]},{name:"leftleg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[16,48]},{origin:[0,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]}],visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:64}},spawn_egg:{base_color:"#592A10",overlay_color:"#F9F3A4"},render_controllers:["controller.render.piglin_brute"],enable_attachables:!0},polar_bear:{identifier:"minecraft:polar_bear",materials:{default:"polar_bear"},textures:{default:"textures/entity/bear/polarbear"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:128,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,14,-16],locators:{lead:[0,14,-16]},mirror:!0,cubes:[{mirror:!1,origin:[-3.5,10,-19],size:[7,7,7],uv:[0,0]},{mirror:!1,origin:[-2.5,10,-22],size:[5,3,3],uv:[0,44]},{mirror:!1,origin:[-4.5,16,-17],size:[2,2,1],uv:[26,0]},{origin:[2.5,16,-17],size:[2,2,1],uv:[26,0]}]},{name:"body",pivot:[-2,15,12],bind_pose_rotation:[90,0,0],cubes:[{origin:[-7,14,5],size:[14,14,11],uv:[0,19]},{origin:[-6,28,5],size:[12,12,10],uv:[39,0]}]},{name:"leg0",parent:"body",pivot:[-4.5,10,6],cubes:[{origin:[-6.5,0,4],size:[4,10,8],uv:[50,22]}]},{name:"leg1",parent:"body",pivot:[4.5,10,6],cubes:[{origin:[2.5,0,4],size:[4,10,8],uv:[50,22]}]},{name:"leg2",parent:"body",pivot:[-3.5,10,-8],cubes:[{origin:[-5.5,0,-10],size:[4,10,6],uv:[50,40]}]},{name:"leg3",parent:"body",pivot:[3.5,10,-8],cubes:[{origin:[1.5,0,-10],size:[4,10,6],uv:[50,40]}]}]}},render_controllers:["controller.render.polarbear"],spawn_egg:{texture:"spawn_egg",texture_index:37}},pufferfish:{identifier:"minecraft:pufferfish",min_engine_version:"1.8.0",materials:{default:"pufferfish"},textures:{default:"textures/entity/fish/pufferfish"},geometry:{default:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-1.5,0,-1.5],size:[3,2,3],uv:[0,27]},{origin:[.5,2,-1.5],size:[1,1,1],uv:[24,6]},{origin:[-1.5,2,-1.5],size:[1,1,1],uv:[28,6]}],locators:{lead:[0,0,0]}},{name:"tailfin",parent:"body",cubes:[{origin:[-1.5,1,1.5],size:[3,0,3],uv:[-3,0]}]},{name:"leftFin",parent:"body",pivot:[6.5,5,.5],cubes:[{origin:[1.5,0,-1.5],size:[1,1,2],uv:[25,0],mirror:!0}]},{name:"rightFin",parent:"body",pivot:[-6.5,5,.5],cubes:[{origin:[-2.5,0,-1.5],size:[1,1,2],uv:[25,0]}]}]},mid:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-2.5,1,-2.5],size:[5,5,5],uv:[12,22]}]},{name:"leftFin",parent:"body",pivot:[2.5,5,.5],cubes:[{origin:[2.5,4,-1.5],size:[2,1,2],uv:[24,3]}]},{name:"rightFin",parent:"body",pivot:[-2.5,5,.5],cubes:[{origin:[-4.5,4,-1.5],size:[2,1,2],uv:[24,0]}]},{name:"spines_top_front",parent:"body",bind_pose_rotation:[45,0,0],pivot:[0,6,-2.5],cubes:[{origin:[-2.5,6,-2.5],size:[5,1,0],uv:[19,17]}]},{name:"spines_top_back",parent:"body",bind_pose_rotation:[-45,0,0],pivot:[0,6,2.5],cubes:[{origin:[-2.5,6,2.5],size:[5,1,0],uv:[11,17]}]},{name:"spines_bottom_front",parent:"body",bind_pose_rotation:[-45,0,0],pivot:[0,1,-2.5],cubes:[{origin:[-2.5,0,-2.5],size:[5,1,0],uv:[18,20]}]},{name:"spines_bottom_back",parent:"body",bind_pose_rotation:[45,0,0],pivot:[0,1,2.5],rotation:[45,0,0],cubes:[{origin:[-2.5,0,2.5],size:[5,1,0],uv:[18,20]}]},{name:"spines_left_front",parent:"body",bind_pose_rotation:[0,45,0],pivot:[2.5,0,-2.5],rotation:[0,45,0],cubes:[{origin:[2.5,1,-2.5],size:[1,5,0],uv:[1,17]}]},{name:"spines_left_back",parent:"body",bind_pose_rotation:[0,-45,0],pivot:[2.5,0,2.5],rotation:[0,-45,0],cubes:[{origin:[2.5,1,2.5],size:[1,5,0],uv:[1,17]}]},{name:"spines_right_front",parent:"body",bind_pose_rotation:[0,-45,0],pivot:[-2.5,0,-2.5],rotation:[0,-45,0],cubes:[{origin:[-3.5,1,-2.5],size:[1,5,0],uv:[5,17]}]},{name:"spines_right_back",parent:"body",bind_pose_rotation:[0,45,0],pivot:[-2.5,0,2.5],rotation:[0,45,0],cubes:[{origin:[-3.5,1,2.5],size:[1,5,0],uv:[9,17]}]}]},large:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0]}]},{name:"leftFin",parent:"body",pivot:[4,7,1],cubes:[{origin:[4,6,-2.9904],size:[2,1,2],uv:[24,3]}]},{name:"rightFin",parent:"body",pivot:[-4,7,1],cubes:[{origin:[-5.9968,6,-2.992],size:[2,1,2],uv:[24,0]}]},{name:"spines_top_front",parent:"body",pivot:[-4,8,-4],bind_pose_rotation:[45,0,0],cubes:[{origin:[-4,8,-4],size:[8,1,1],uv:[14,16]}]},{name:"spines_top_mid",parent:"body",pivot:[0,8,0],cubes:[{origin:[-4,8,0],size:[8,1,1],uv:[14,16]}]},{name:"spines_top_back",parent:"body",pivot:[0,8,4],bind_pose_rotation:[-45,0,0],cubes:[{origin:[-4,8,4],size:[8,1,1],uv:[14,16]}]},{name:"spines_bottom_front",parent:"body",pivot:[0,0,-4],bind_pose_rotation:[-45,0,0],cubes:[{origin:[-4,-1,-4],size:[8,1,1],uv:[14,19]}]},{name:"spines_bottom_mid",parent:"body",pivot:[0,-1,0],cubes:[{origin:[-4,-1,0],size:[8,1,1],uv:[14,19]}]},{name:"spines_bottom_back",parent:"body",pivot:[0,0,4],bind_pose_rotation:[45,0,0],cubes:[{origin:[-4,-1,4],size:[8,1,1],uv:[14,19]}]},{name:"spines_left_front",parent:"body",pivot:[4,0,-4],bind_pose_rotation:[0,45,0],cubes:[{origin:[4,0,-4],size:[1,8,1],uv:[0,16]}]},{name:"spines_left_mid",parent:"body",pivot:[4,0,0],cubes:[{origin:[4,0,0],size:[1,8,1],uv:[4,16],mirror:!0}]},{name:"spines_left_back",parent:"body",pivot:[4,0,4],bind_pose_rotation:[0,-45,0],cubes:[{origin:[4,0,4],size:[1,8,1],uv:[8,16],mirror:!0}]},{name:"spines_right_front",parent:"body",pivot:[-4,0,-4],bind_pose_rotation:[0,-45,0],cubes:[{origin:[-5,0,-4],size:[1,8,1],uv:[4,16]}]},{name:"spines_right_mid",parent:"body",pivot:[-4,0,0],cubes:[{origin:[-5,0,0],size:[1,8,1],uv:[8,16]}]},{name:"spines_right_back",parent:"body",pivot:[-4,0,4],bind_pose_rotation:[0,45,0],cubes:[{origin:[-5,0,4],size:[1,8,1],uv:[8,16]}]}]}},render_controllers:[{"controller.render.pufferfish.small":"query.variant == 0"},{"controller.render.pufferfish.medium":"query.variant == 1"},{"controller.render.pufferfish.large":"query.variant == 2"}],spawn_egg:{texture:"spawn_egg",texture_index:46}},rabbit:{identifier:"minecraft:rabbit",min_engine_version:"1.8.0",materials:{default:"rabbit"},textures:{brown:"textures/entity/rabbit/brown",white:"textures/entity/rabbit/white",black:"textures/entity/rabbit/black",white_splotched:"textures/entity/rabbit/white_splotched",gold:"textures/entity/rabbit/gold",salt:"textures/entity/rabbit/salt",toast:"textures/entity/rabbit/toast"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"rearFootLeft",pivot:[3,6.5,3.7],mirror:!0,parent:"body",cubes:[{origin:[2,0,0],size:[2,1,7],uv:[8,24]}]},{name:"rearFootRight",pivot:[-3,6.5,3.7],mirror:!0,parent:"body",cubes:[{origin:[-4,0,0],size:[2,1,7],uv:[26,24]}]},{name:"haunchLeft",pivot:[3,6.5,3.7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[2,2.5,3.7],size:[2,4,5],uv:[16,15]}]},{name:"haunchRight",pivot:[-3,6.5,3.7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[-4,2.5,3.7],size:[2,4,5],uv:[30,15]}]},{name:"body",pivot:[0,5,8],bind_pose_rotation:[-20,0,0],mirror:!0,cubes:[{origin:[-3,2,-2],size:[6,5,10],uv:[0,0]}]},{name:"frontLegLeft",pivot:[3,7,-1],bind_pose_rotation:[-10,0,0],mirror:!0,parent:"body",cubes:[{origin:[2,0,-2],size:[2,7,2],uv:[8,15]}]},{name:"frontLegRight",pivot:[-3,7,-1],bind_pose_rotation:[-10,0,0],mirror:!0,parent:"body",cubes:[{origin:[-4,0,-2],size:[2,7,2],uv:[0,15]}]},{name:"head",pivot:[0,8,-1],locators:{lead:[0,8,-1]},mirror:!0,parent:"body",cubes:[{origin:[-2.5,8,-6],size:[5,4,5],uv:[32,0]}]},{name:"earRight",pivot:[0,8,-1],bind_pose_rotation:[0,-15,0],mirror:!0,parent:"body",cubes:[{origin:[-2.5,12,-2],size:[2,5,1],uv:[58,0]}]},{name:"earLeft",pivot:[0,8,-1],bind_pose_rotation:[0,15,0],mirror:!0,parent:"body",cubes:[{origin:[.5,12,-2],size:[2,5,1],uv:[52,0]}]},{name:"tail",pivot:[0,4,7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[-1.5,2.5,7],size:[3,3,2],uv:[52,6]}]},{name:"nose",pivot:[0,8,-1],mirror:!0,parent:"body",cubes:[{origin:[-.5,9.5,-6.5],size:[1,1,1],uv:[32,9]}]}]}},render_controllers:["controller.render.rabbit"],spawn_egg:{texture:"spawn_egg",texture_index:24}},ravager:{identifier:"minecraft:ravager",textures:{default:"textures/entity/illager/ravager"},materials:{default:"ravager"},geometry:{default:{bones:[{pivot:[0,19,2],rotation:[90,0,0],cubes:[{origin:[-7,10,-2],size:[14,16,20],uv:[0,55]},{origin:[-6,-3,-2],size:[12,13,18],uv:[0,91]}],name:"body"},{pivot:[0,15,-10],cubes:[{origin:[-8,13,-24],size:[16,3,16],uv:[0,36]}],name:"mouth",parent:"head"},{pivot:[0,20,-20],cubes:[{origin:[-5,21,-10],size:[10,10,18],uv:[68,73]}],name:"neck"},{locators:{stun:[0,32,-15]},pivot:[0,28,-10],cubes:[{origin:[-8,14,-24],size:[16,20,16],uv:[0,0]},{origin:[-2,12,-28],size:[4,8,4],uv:[0,0]}],name:"head",parent:"neck"},{pivot:[-12,30,22],cubes:[{origin:[-12,0,17],size:[8,37,8],uv:[96,0]}],name:"leg0"},{pivot:[4,30,22],cubes:[{origin:[4,0,17],size:[8,37,8],uv:[96,0]}],name:"leg1"},{pivot:[-4,26,-4],cubes:[{origin:[-12,0,-8],size:[8,37,8],uv:[64,0]}],name:"leg2"},{pivot:[-4,26,-4],cubes:[{origin:[4,0,-8],size:[8,37,8],uv:[64,0]}],name:"leg3"},{pivot:[-5,27,-19],rotation:[60,0,0],cubes:[{origin:[-10,27,-20],size:[2,14,4],uv:[74,55]},{origin:[8,27,-20],size:[2,14,4],uv:[74,55]}],name:"horns",parent:"head"}],texturewidth:128,textureheight:128,visible_bounds_width:4,visible_bounds_height:3.5,visible_bounds_offset:[0,1.25,0]}},render_controllers:["controller.render.ravager"],spawn_egg:{texture:"spawn_egg",texture_index:57},particle_effects:{stun_particles:"minecraft:stunned_emitter"}},salmon:{identifier:"minecraft:salmon",materials:{default:"salmon"},textures:{default:"textures/entity/fish/salmon"},geometry:{default:{visible_bounds_width:.5,visible_bounds_height:.5,visible_bounds_offset:[0,.5,0],texturewidth:32,textureheight:32,bones:[{name:"body_front",pivot:[0,0,-4],cubes:[{origin:[-1.5,3.5,-4],size:[3,5,8],uv:[0,0]}]},{name:"body_back",parent:"body_front",pivot:[0,0,4],cubes:[{origin:[-1.5,3.5,4],size:[3,5,8],uv:[0,13]}]},{name:"dorsal_front",parent:"body_front",pivot:[0,5,2],cubes:[{origin:[0,8.5,2],size:[0,2,2],uv:[4,2]}]},{name:"dorsal_back",parent:"body_back",pivot:[0,5,4],cubes:[{origin:[0,8.5,4],size:[0,2,3],uv:[2,3]}]},{name:"tailfin",parent:"body_back",pivot:[0,0,12],cubes:[{origin:[0,3.5,12],size:[0,5,6],uv:[20,10]}]},{name:"head",parent:"body_front",pivot:[0,3,-4],locators:{lead:[0,3,-4]},cubes:[{origin:[-1,4.5,-7],size:[2,4,3],uv:[22,0]}]},{name:"leftFin",parent:"body_front",pivot:[1.5,1,-4],rotation:[0,0,35],cubes:[{origin:[-.50752,3.86703,-4],size:[2,0,2],uv:[2,0]}]},{name:"rightFin",parent:"body_front",pivot:[-1.5,1,-4],rotation:[0,0,-35],cubes:[{origin:[-1.49258,3.86703,-4],size:[2,0,2],uv:[-2,0]}]}]}},render_controllers:["controller.render.salmon"],spawn_egg:{texture:"spawn_egg",texture_index:47}},sheep:{identifier:"minecraft:sheep",materials:{default:"sheep"},textures:{default:"textures/entity/sheep/sheep",wool:"textures/entity/sheep/sheep_fur"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-4,13,-5],size:[8,16,6],uv:[28,8]}]},{name:"head",pivot:[0,18,-8],cubes:[{origin:[-3,16,-14],size:[6,6,8],uv:[0,0]}]},{name:"leg0",parent:"body",pivot:[-3,12,7],cubes:[{origin:[-5,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",pivot:[3,12,7],cubes:[{origin:[1,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-3,12,-5],cubes:[{origin:[-5,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",pivot:[3,12,-5],cubes:[{origin:[1,0,-7],size:[4,12,4],uv:[0,16]}]}]},wool:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,18,-8],cubes:[{origin:[-3,16,-12],size:[6,6,6],uv:[0,32],inflate:.6}]},{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-4,13,-5],size:[8,16,6],uv:[28,40],inflate:1.75}]},{name:"leg0",parent:"body",pivot:[-3,12,7],cubes:[{origin:[-5,6,5],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg1",parent:"body",pivot:[3,12,7],cubes:[{origin:[1,6,5],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg2",parent:"body",pivot:[-3,12,-5],cubes:[{origin:[-5,6,-7],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg3",parent:"body",pivot:[3,12,-5],cubes:[{origin:[1,6,-7],size:[4,6,4],uv:[0,48],inflate:.5}]}]}}},shulker_bullet:{identifier:"minecraft:shulker_bullet",materials:{default:"shulker_bullet"},textures:{default:"textures/entity/shulker/spark"},geometry:{default:{texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-4,-4,-1],size:[8,8,2],uv:[0,0]},{origin:[-1,-4,-4],size:[2,8,8],uv:[0,10]},{origin:[-4,-1,-4],size:[8,2,8],uv:[20,0]}]}]}},render_controllers:["controller.render.shulker_bullet"]},silverfish:{identifier:"minecraft:silverfish",materials:{default:"silverfish",body_layer:"silverfish_layers"},textures:{default:"textures/entity/silverfish"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"bodyPart_0",parent:"bodyPart_2",pivot:[0,2,-3.5],cubes:[{origin:[-1.5,0,-4.5],size:[3,2,2],uv:[0,0]}]},{name:"bodyPart_1",parent:"bodyPart_2",pivot:[0,3,-1.5],cubes:[{origin:[-2,0,-2.5],size:[4,3,2],uv:[0,4]}]},{name:"bodyPart_2",pivot:[0,4,1],cubes:[{origin:[-3,0,-.5],size:[6,4,3],uv:[0,9]}]},{name:"bodyPart_3",parent:"bodyPart_2",pivot:[0,3,4],cubes:[{origin:[-1.5,0,2.5],size:[3,3,3],uv:[0,16]}]},{name:"bodyPart_4",parent:"bodyPart_2",pivot:[0,2,7],cubes:[{origin:[-1,0,5.5],size:[2,2,3],uv:[0,22]}]},{name:"bodyPart_5",parent:"bodyPart_2",pivot:[0,1,9.5],cubes:[{origin:[-1,0,8.5],size:[2,1,2],uv:[11,0]}]},{name:"bodyPart_6",parent:"bodyPart_2",pivot:[0,1,11.5],cubes:[{origin:[-.5,0,10.5],size:[1,1,2],uv:[13,4]}]},{name:"bodyLayer_0",parent:"bodyPart_2",pivot:[0,8,1],cubes:[{origin:[-5,0,-.5],size:[10,8,3],uv:[20,0]}]},{name:"bodyLayer_1",parent:"bodyPart_4",pivot:[0,4,7],cubes:[{origin:[-3,0,5.5],size:[6,4,3],uv:[20,11]}]},{name:"bodyLayer_2",parent:"bodyPart_1",pivot:[0,5,-1.5],cubes:[{origin:[-3,0,-3],size:[6,5,2],uv:[20,18]}]}]}},render_controllers:["controller.render.silverfish"],spawn_egg:{texture:"spawn_egg",texture_index:8}},skeleton:{identifier:"minecraft:skeleton",min_engine_version:"1.8.0",materials:{default:"skeleton"},textures:{default:"textures/entity/skeleton/skeleton"},geometry:{default:{texturewidth:64,textureheight:32,visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0,parent:"body"}]}},spawn_egg:{texture:"spawn_egg",texture_index:9},render_controllers:["controller.render.skeleton"],enable_attachables:!0},skeleton_horse:{identifier:"minecraft:skeleton_horse",textures:{base_brown:"textures/entity/horse/horse_brown",base_white:"textures/entity/horse/horse_white",base_chestnut:"textures/entity/horse/horse_chestnut",base_creamy:"textures/entity/horse/horse_creamy",base_black:"textures/entity/horse/horse_black",base_gray:"textures/entity/horse/horse_gray",base_darkbrown:"textures/entity/horse/horse_darkbrown",markings_none:"textures/entity/horse/horse_markings_none",markings_white:"textures/entity/horse/horse_markings_white",markings_whitefield:"textures/entity/horse/horse_markings_whitefield",markings_whitedots:"textures/entity/horse/horse_markings_whitedots",markings_blackdots:"textures/entity/horse/horse_markings_blackdots",mule:"textures/entity/horse/mule",donkey:"textures/entity/horse/donkey",skeleton:"textures/entity/horse/horse_skeleton",zombie:"textures/entity/horse/horse_zombie",armor_none:"textures/entity/horse/armor/horse_armor_none",armor_leather:"textures/entity/horse/armor/horse_armor_leather",armor_iron:"textures/entity/horse/armor/horse_armor_iron",armor_gold:"textures/entity/horse/armor/horse_armor_gold",armor_diamond:"textures/entity/horse/armor/horse_armor_diamond"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:3,visible_bounds_offset:[0,1,0],texturewidth:128,textureheight:128,bones:[{name:"Body",pivot:[0,13,9],rotation:[0,0,0],cubes:[{origin:[-5,11,-10],size:[10,10,24],uv:[0,34]}]},{name:"TailA",pivot:[0,21,14],rotation:[-65,0,0],cubes:[{origin:[-1,20,14],size:[2,2,3],uv:[44,0]}]},{name:"TailB",pivot:[0,21,14],rotation:[-65,0,0],cubes:[{origin:[-1.5,19,17],size:[3,4,7],uv:[38,7]}]},{name:"TailC",pivot:[0,21,14],rotation:[-80.34,0,0],cubes:[{origin:[-1.5,21.5,23],size:[3,4,7],uv:[24,3]}]},{name:"Leg1A",pivot:[4,15,11],rotation:[0,0,0],cubes:[{origin:[1.5,8,8.5],size:[4,9,5],uv:[78,29]}]},{name:"Leg1B",pivot:[4,8,11],rotation:[0,0,0],cubes:[{origin:[2,3,9.5],size:[3,5,3],uv:[78,43]}]},{name:"Leg1C",pivot:[4,8,11],rotation:[0,0,0],cubes:[{origin:[1.5,-.1,9],size:[4,3,4],uv:[78,51]}]},{name:"Leg2A",pivot:[-4,15,11],rotation:[0,0,0],cubes:[{origin:[-5.5,8,8.5],size:[4,9,5],uv:[96,29]}]},{name:"Leg2B",pivot:[-4,8,11],rotation:[0,0,0],cubes:[{origin:[-5,3,9.5],size:[3,5,3],uv:[96,43]}]},{name:"Leg2C",pivot:[-4,8,11],rotation:[0,0,0],cubes:[{origin:[-5.5,-.1,9],size:[4,3,4],uv:[96,51]}]},{name:"Leg3A",pivot:[4,15,-8],rotation:[0,0,0],cubes:[{origin:[2.1,8,-10.1],size:[3,8,4],uv:[44,29]}]},{name:"Leg3B",pivot:[4,8,-8],rotation:[0,0,0],cubes:[{origin:[2.1,3,-9.6],size:[3,5,3],uv:[44,41]}]},{name:"Leg3C",pivot:[4,8,-8],rotation:[0,0,0],cubes:[{origin:[1.6,-.1,-10.1],size:[4,3,4],uv:[44,51]}]},{name:"Leg4A",pivot:[-4,15,-8],rotation:[0,0,0],cubes:[{origin:[-5.1,8,-10.1],size:[3,8,4],uv:[60,29]}]},{name:"Leg4B",pivot:[-4,8,-8],rotation:[0,0,0],cubes:[{origin:[-5.1,3,-9.6],size:[3,5,3],uv:[60,41]}]},{name:"Leg4C",pivot:[-4,8,-8],rotation:[0,0,0],cubes:[{origin:[-5.6,-.1,-10.1],size:[4,3,4],uv:[60,51]}]},{name:"Head",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,25,-11.5],size:[5,5,7],uv:[0,0]}]},{name:"UMouth",pivot:[0,20.05,-10],rotation:[30,0,0],cubes:[{origin:[-2,27.05,-17],size:[4,3,6],uv:[24,18]}]},{name:"LMouth",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2,25,-16.5],size:[4,2,5],uv:[24,27]}]},{name:"Ear1",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[.45,29,-6],size:[2,3,1],uv:[0,0]}]},{name:"Ear2",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.45,29,-6],size:[2,3,1],uv:[0,0]}]},{name:"MuleEarL",pivot:[0,20,-10],rotation:[30,0,15],cubes:[{origin:[-2,29,-6],size:[2,7,1],uv:[0,12]}]},{name:"MuleEarR",pivot:[0,20,-10],rotation:[30,0,-15],cubes:[{origin:[0,29,-6],size:[2,7,1],uv:[0,12]}]},{name:"Neck",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.05,15.8,-12],size:[4,14,8],uv:[0,12]}]},{name:"Bag1",pivot:[-7.5,21,10],rotation:[0,90,0],cubes:[{origin:[-10.5,13,10],size:[8,8,3],uv:[0,34]}]},{name:"Bag2",pivot:[4.5,21,10],rotation:[0,90,0],cubes:[{origin:[1.5,13,10],size:[8,8,3],uv:[0,47]}]},{name:"Saddle",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-5,21,-1],size:[10,1,8],uv:[80,0]}]},{name:"SaddleB",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-1.5,22,-1],size:[3,1,2],uv:[106,9]}]},{name:"SaddleC",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-4,22,5],size:[8,1,2],uv:[80,9]}]},{name:"SaddleL2",pivot:[5,21,2],rotation:[0,0,0],cubes:[{origin:[4.5,13,1],size:[1,2,2],uv:[74,0]}]},{name:"SaddleL",pivot:[5,21,2],rotation:[0,0,0],cubes:[{origin:[4.5,15,1.5],size:[1,6,1],uv:[70,0]}]},{name:"SaddleR2",pivot:[-5,21,2],rotation:[0,0,0],cubes:[{origin:[-5.5,13,1],size:[1,2,2],uv:[74,4]}]},{name:"SaddleR",pivot:[-5,21,2],rotation:[0,0,0],cubes:[{origin:[-5.5,15,1.5],size:[1,6,1],uv:[80,0]}]},{name:"SaddleMouthL",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[1.5,26,-14],size:[1,2,2],uv:[74,13]}]},{name:"SaddleMouthR",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,26,-14],size:[1,2,2],uv:[74,13]}]},{name:"SaddleMouthLine",pivot:[0,20,-10],rotation:[0,0,0],cubes:[{origin:[2.6,23,-16],size:[0,3,16],uv:[44,10]}]},{name:"SaddleMouthLineR",pivot:[0,20,-10],rotation:[0,0,0],cubes:[{origin:[-2.6,23,-16],size:[0,3,16],uv:[44,5]}]},{name:"Mane",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-1,15.5,-5],size:[2,16,4],uv:[58,0]}]},{name:"HeadSaddle",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,25.1,-17],size:[5,5,12],uv:[80,12],inflate:.05}]}]}},spawn_egg:{texture:"spawn_egg",texture_index:32}},slime:{identifier:"minecraft:slime",materials:{default:"slime",outer:"slime_outer"},textures:{default:"textures/entity/slime/slime"},geometry:{default:{visible_bounds_width:5,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"cube",pivot:[0,24,0],cubes:[{origin:[-3,1,-3],size:[6,6,6],uv:[0,16]}]},{name:"eye0",parent:"cube",pivot:[0,24,0],cubes:[{origin:[-3.3,4,-3.5],size:[2,2,2],uv:[32,0]}]},{name:"eye1",parent:"cube",pivot:[0,24,0],cubes:[{origin:[1.3,4,-3.5],size:[2,2,2],uv:[32,4]}]},{name:"mouth",parent:"cube",pivot:[0,24,0],cubes:[{origin:[0,2,-3.5],size:[1,1,1],uv:[32,8]}]}]},armor:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"cube",pivot:[0,24,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0]}]},{name:"eye0",parent:"cube",pivot:[0,24,0],cubes:[{origin:[-3.3,4,-3.5],size:[2,2,2],uv:[32,0]}]},{name:"eye1",parent:"cube",pivot:[0,24,0],cubes:[{origin:[1.3,4,-3.5],size:[2,2,2],uv:[32,4]}]},{name:"mouth",parent:"cube",pivot:[0,24,0],cubes:[{origin:[0,2,-3.5],size:[1,1,1],uv:[32,8]}]}]}},render_controllers:["controller.render.slime","controller.render.slime_armor"],spawn_egg:{texture:"spawn_egg",texture_index:10}},small_fireball:{identifier:"minecraft:small_fireball",materials:{default:"fireball"},textures:{default:"textures/items/fire_charge"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},snow_golem:{identifier:"minecraft:snow_golem",min_engine_version:"1.8.0",materials:{default:"snow_golem",head:"snow_golem_pumpkin"},textures:{default:"textures/entity/snow_golem"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:2,visible_bounds_offset:[0,1,0],bones:[{name:"head",parent:"piece1",pivot:[0,20,0],locators:{lead:[0,20,0]},cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0],inflate:-.5}]},{name:"arm1",parent:"piece1",pivot:[0,18,0],bind_pose_rotation:[0,0,57.3],cubes:[{origin:[1,20,-1],size:[12,2,2],uv:[32,0],inflate:-.5}]},{name:"arm2",parent:"piece1",pivot:[0,18,0],bind_pose_rotation:[0,180,-57.3],cubes:[{origin:[1,20,-1],size:[12,2,2],uv:[32,0],inflate:-.5}]},{name:"piece1",parent:"piece2",pivot:[0,11,0],cubes:[{origin:[-5,11,-5],size:[10,10,10],uv:[0,16],inflate:-.5}]},{name:"piece2",pivot:[0,0,0],cubes:[{origin:[-6,0,-6],size:[12,12,12],uv:[0,36],inflate:-.5}]}]}},render_controllers:["controller.render.snowgolem"]},snowball:{identifier:"minecraft:snowball",materials:{default:"snowball"},textures:{default:"textures/items/snowball"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},potion:{identifier:"minecraft:splash_potion",materials:{default:"splash_potion_enchanted"},textures:{moveSlowdown:"textures/items/potion_bottle_splash_moveSlowdown",moveSpeed:"textures/items/potion_bottle_splash_moveSpeed",digSlowdown:"textures/items/potion_bottle_splash_digSlowdown",digSpeed:"textures/items/potion_bottle_splash_digSpeed",damageBoost:"textures/items/potion_bottle_splash_damageBoost",heal:"textures/items/potion_bottle_splash_heal",harm:"textures/items/potion_bottle_splash_harm",jump:"textures/items/potion_bottle_splash_jump",confusion:"textures/items/potion_bottle_splash_confusion",regeneration:"textures/items/potion_bottle_splash_regeneration",resistance:"textures/items/potion_bottle_splash_resistance",fireResistance:"textures/items/potion_bottle_splash_fireResistance",waterBreathing:"textures/items/potion_bottle_splash_waterBreathing",invisibility:"textures/items/potion_bottle_splash_invisibility",blindness:"textures/items/potion_bottle_splash_blindness",nightVision:"textures/items/potion_bottle_splash_nightVision",hunger:"textures/items/potion_bottle_splash_hunger",weakness:"textures/items/potion_bottle_splash_weakness",poison:"textures/items/potion_bottle_splash_poison",wither:"textures/items/potion_bottle_splash_wither",healthBoost:"textures/items/potion_bottle_splash_healthBoost",absorption:"textures/items/potion_bottle_splash_absorption",saturation:"textures/items/potion_bottle_splash_saturation",levitation:"textures/items/potion_bottle_splash_levitation",turtleMaster:"textures/items/potion_bottle_splash_turtleMaster",slowFall:"textures/items/potion_bottle_splash_slowFall",default:"textures/items/potion_bottle_splash",enchanted:"textures/misc/enchanted_item_glint"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.splash_potion"]},squid:{identifier:"minecraft:squid",materials:{default:"squid"},textures:{default:"textures/entity/squid"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",cubes:[{origin:[-6,-8,-6],size:[12,16,12],uv:[0,0]}]},{name:"tentacle1",parent:"body",pivot:[5,-7,0],cubes:[{origin:[4,-25,-1],size:[2,18,2],uv:[48,0]}],rotation:[0,90,0]},{name:"tentacle2",parent:"body",pivot:[3.5,-7,3.5],cubes:[{origin:[2.5,-25,2.5],size:[2,18,2],uv:[48,0]}],rotation:[0,45,0]},{name:"tentacle3",parent:"body",pivot:[0,-7,5],cubes:[{origin:[-1,-25,4],size:[2,18,2],uv:[48,0]}],rotation:[0,0,0]},{name:"tentacle4",parent:"body",pivot:[-3.5,-7,3.5],cubes:[{origin:[-4.5,-25,2.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-45,0]},{name:"tentacle5",parent:"body",pivot:[-5,-7,0],cubes:[{origin:[-6,-25,-1],size:[2,18,2],uv:[48,0]}],rotation:[0,-90,0]},{name:"tentacle6",parent:"body",pivot:[-3.5,-7,-3.5],cubes:[{origin:[-4.5,-25,-4.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-135,0]},{name:"tentacle7",parent:"body",pivot:[0,-7,-5],cubes:[{origin:[-1,-25,-6],size:[2,18,2],uv:[48,0]}],rotation:[0,-180,0]},{name:"tentacle8",parent:"body",pivot:[3.5,-7,-3.5],cubes:[{origin:[2.5,-25,-4.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-225,0]}]}},render_controllers:["controller.render.squid"],spawn_egg:{texture:"spawn_egg",texture_index:15}},stray:{identifier:"minecraft:stray",min_engine_version:"1.8.0",materials:{default:"stray",overlay:"stray_clothes"},textures:{default:"textures/entity/skeleton/stray",overlay:"textures/entity/skeleton/stray_overlay"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",pivot:[0,12,0]},{name:"head",pivot:[0,24,0],locators:{lead:[0,24,0]},cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0,parent:"body"}]},overlay:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",parent:"waist",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],inflate:.25},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],inflate:.25},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],inflate:.25},{name:"rightItem",parent:"rightArm",pivot:[-6,15,1],neverRender:!0},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,inflate:.25},{name:"rightLeg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],inflate:.25},{name:"leftLeg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],inflate:.25,mirror:!0}]}},spawn_egg:{texture:"spawn_egg",texture_index:27},render_controllers:["controller.render.stray_clothes","controller.render.stray"],enable_attachables:!0},strider:{identifier:"minecraft:strider",materials:{default:"strider"},textures:{default:"textures/entity/strider/strider",saddled:"textures/entity/strider/strider",suffocated:"textures/entity/strider/strider_cold",suffocated_saddled:"textures/entity/strider/strider_cold"},geometry:{default:{bones:[{name:"right_leg",pivot:[-4,16,0],cubes:[{origin:[-6,0,-2],size:[4,16,4],uv:[0,32]}]},{name:"left_leg",pivot:[4,16,0],cubes:[{origin:[2,0,-2],size:[4,16,4],uv:[0,55]}]},{name:"body",pivot:[0,16,0],cubes:[{origin:[-8,14,-8],size:[16,14,16],uv:[0,0]}],locators:{lead:[0,15,-1]}},{name:"bristle5",parent:"body",pivot:[8,19,0],cubes:[{origin:[8,19,-8],size:[12,0,16],pivot:[8,19,0],rotation:[0,0,70],uv:[16,65]}]},{name:"bristle4",parent:"body",pivot:[8,24,0],cubes:[{origin:[8,24,-8],size:[12,0,16],pivot:[8,24,0],rotation:[0,0,65],uv:[16,49]}]},{name:"bristle3",parent:"body",pivot:[8,28,0],cubes:[{origin:[8,28,-8],size:[12,0,16],pivot:[8,28,0],rotation:[0,0,50],uv:[16,33]}]},{name:"bristle2",parent:"body",pivot:[-8,28,0],cubes:[{origin:[-20,28,-8],size:[12,0,16],pivot:[-8,28,0],rotation:[0,0,-50],uv:[16,33],mirror:!0}]},{name:"bristle1",parent:"body",pivot:[-8,24,0],cubes:[{origin:[-20,24,-8],size:[12,0,16],pivot:[-8,24,0],rotation:[0,0,-65],uv:[16,49],mirror:!0}]},{name:"bristle0",parent:"body",pivot:[-8,19,0],cubes:[{origin:[-20,19,-8],size:[12,0,16],pivot:[-8,19,0],rotation:[0,0,-70],uv:[16,65],mirror:!0}]}],visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:128}},spawn_egg:{base_color:"#9c3436",overlay_color:"#4d494d"},render_controllers:["controller.render.strider"]},text_display:{identifier:"minecraft:text_display",geometry:{}},trident:{identifier:"minecraft:thrown_trident",textures:{default:"textures/entity/trident",loyalty_rope:"textures/entity/lead_knot"},geometry:{default:{texturewidth:32,textureheight:32,bones:[{name:"pole",pivot:[0,24,0],cubes:[{origin:[-.5,-3,-.5],size:[1,31,1],inflate:.01,uv:[0,0]},{origin:[-1.5,22,-.5],size:[3,2,1],uv:[4,0]},{origin:[-2.5,23,-.5],size:[1,4,1],uv:[4,3]},{origin:[1.5,23,-.5],size:[1,4,1],uv:[4,3]}]}]}}},tnt_minecart:{identifier:"minecraft:tnt_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},tropical_fish:{identifier:"minecraft:tropicalfish",materials:{default:"tropicalfish"},textures:{typeA:"textures/entity/fish/tropical_a",typeB:"textures/entity/fish/tropical_b",aPattern1:"textures/entity/fish/tropical_a_pattern_1",aPattern2:"textures/entity/fish/tropical_a_pattern_2",aPattern3:"textures/entity/fish/tropical_a_pattern_3",aPattern4:"textures/entity/fish/tropical_a_pattern_4",aPattern5:"textures/entity/fish/tropical_a_pattern_5",aPattern6:"textures/entity/fish/tropical_a_pattern_6",bPattern1:"textures/entity/fish/tropical_b_pattern_1",bPattern2:"textures/entity/fish/tropical_b_pattern_2",bPattern3:"textures/entity/fish/tropical_b_pattern_3",bPattern4:"textures/entity/fish/tropical_b_pattern_4",bPattern5:"textures/entity/fish/tropical_b_pattern_5",bPattern6:"textures/entity/fish/tropical_b_pattern_6"},geometry:{typeA:{visible_bounds_width:.5,visible_bounds_height:.5,bones:[{pivot:[-.5,0,0],cubes:[{origin:[-1,0,-3],size:[2,3,6],uv:[0,0]},{origin:[0,3,-2.9992],size:[0,4,6],uv:[10,-6]}],name:"body"},{pivot:[0,0,3],cubes:[{origin:[0,0,3],size:[0,3,4],uv:[24,-4]}],name:"tailfin",parent:"body"},{pivot:[.5,0,1],bind_pose_rotation:[0,-35,0],cubes:[{origin:[.336,0,-.10594],size:[2,2,0],uv:[2,12]}],name:"leftFin",parent:"body"},{pivot:[-.5,0,1],bind_pose_rotation:[0,35,0],cubes:[{origin:[-2.336,0,-.10594],size:[2,2,0],uv:[2,16]}],name:"rightFin",parent:"body"}],texturewidth:32,textureheight:32},typeB:{visible_bounds_width:.5,visible_bounds_height:.5,bones:[{pivot:[-.5,0,0],cubes:[{origin:[-1,0,-8e-4],size:[2,6,6],uv:[0,20]},{origin:[0,-5,-8e-4],size:[0,5,6],uv:[20,21]},{origin:[0,6,-8e-4],size:[0,5,6],uv:[20,10]}],name:"body"},{pivot:[0,0,6],cubes:[{origin:[0,8e-4,6],size:[0,6,5],uv:[21,16]}],name:"tailfin",parent:"body"},{pivot:[.5,0,1],bind_pose_rotation:[0,-35,0],cubes:[{origin:[2.05673,0,2.35152],size:[2,2,0],uv:[2,12]}],name:"leftFin",parent:"body"},{pivot:[-.5,0,1],bind_pose_rotation:[0,35,0],cubes:[{origin:[-4.05673,0,2.35152],size:[2,2,0],uv:[2,16]}],name:"rightFin",parent:"body"}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.tropicalfish"],spawn_egg:{texture:"spawn_egg",texture_index:44}},vindicator:{identifier:"minecraft:vindicator",min_engine_version:"1.8.0",materials:{default:"vindicator"},textures:{default:"textures/entity/illager/vindicator"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22]},{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]}]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],mirror:!0,cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,46]}]},{name:"rightItem",pivot:[-5.5,16,.5],neverRender:!0,parent:"rightArm"},{name:"leftArm",parent:"body",pivot:[5,22,0],mirror:!0,cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,46]}]}]}},spawn_egg:{texture:"spawn_egg",texture_index:39},render_controllers:["controller.render.vindicator"],enable_attachables:!0},wandering_trader:{identifier:"minecraft:wandering_trader",materials:{default:"wandering_trader"},textures:{default:"textures/entity/wandering_trader"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"helmet",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[32,0],inflate:.5}]},{name:"brim",parent:"head",pivot:[0,24,0],bind_pose_rotation:[-90,0,0],cubes:[{origin:[-8,16,-6],size:[16,16,1],uv:[30,47],inflate:.1}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",locators:{lead_hold:[0,40,0]},cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]},{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22],mirror:!0}]},{name:"held_item",parent:"arms",pivot:[0,0,0]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22],mirror:!0}]}]}},render_controllers:["controller.render.wandering_trader"],spawn_egg:{texture:"spawn_egg_wandering_trader"}},wither:{identifier:"minecraft:wither",min_engine_version:"1.8.0",materials:{default:"wither_boss",armor:"wither_boss_armor"},textures:{default:"textures/entity/wither/wither",armor_white:"textures/entity/wither/wither_armor",armor_blue:"textures/entity/wither/wither_armor",invulnerable:"textures/entity/wither/wither_invulnerable"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:4,visible_bounds_offset:[0,2,0],texturewidth:64,textureheight:64,bones:[{name:"upperBodyPart1",cubes:[{origin:[-10,17.1,-.5],size:[20,3,3],uv:[0,16]}]},{name:"upperBodyPart2",parent:"upperBodyPart1",pivot:[-2,17.1,-.5],cubes:[{origin:[-2,7.1,-.5],size:[3,10,3],uv:[0,22]},{origin:[-6,13.6,0],size:[11,2,2],uv:[24,22]},{origin:[-6,11.1,0],size:[11,2,2],uv:[24,22]},{origin:[-6,8.6,0],size:[11,2,2],uv:[24,22]}]},{name:"upperBodyPart3",parent:"upperBodyPart2",pivot:[0,24,0],cubes:[{origin:[0,18,0],size:[3,6,3],uv:[12,22]}]},{name:"head1",parent:"upperBodyPart1",pivot:[0,20,0],cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0]}]},{name:"head2",parent:"upperBodyPart1",pivot:[-9,18,-1],cubes:[{origin:[-12,18,-4],size:[6,6,6],uv:[32,0]}]},{name:"head3",parent:"upperBodyPart1",pivot:[9,18,-1],cubes:[{origin:[6,18,-4],size:[6,6,6],uv:[32,0]}]}]},armor:{visible_bounds_width:3,visible_bounds_height:4,visible_bounds_offset:[0,2,0],texturewidth:64,textureheight:64,bones:[{name:"upperBodyPart1",cubes:[{origin:[-10,17.1,-.5],size:[20,3,3],uv:[0,16]}],inflate:2},{name:"upperBodyPart2",parent:"upperBodyPart1",pivot:[-2,17.1,-.5],cubes:[{origin:[-2,7.1,-.5],size:[3,10,3],uv:[0,22]},{origin:[-6,13.6,0],size:[11,2,2],uv:[24,22]},{origin:[-6,11.1,0],size:[11,2,2],uv:[24,22]},{origin:[-6,8.6,0],size:[11,2,2],uv:[24,22]}],inflate:2},{name:"upperBodyPart3",parent:"upperBodyPart2",pivot:[0,24,0],cubes:[{origin:[0,18,0],size:[3,6,3],uv:[12,22]}],inflate:2},{name:"head1",parent:"upperBodyPart1",pivot:[0,20,0],cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0]}],inflate:2},{name:"head2",parent:"upperBodyPart1",pivot:[-9,18,-1],cubes:[{origin:[-12,18,-4],size:[6,6,6],uv:[32,0]}],inflate:2},{name:"head3",parent:"upperBodyPart1",pivot:[9,18,-1],cubes:[{origin:[6,18,-4],size:[6,6,6],uv:[32,0]}],inflate:2}]}},render_controllers:["controller.render.wither_boss","controller.render.wither_boss_armor_white","controller.render.wither_boss_armor_blue"]},wither_skeleton:{identifier:"minecraft:wither_skeleton",min_engine_version:"1.8.0",materials:{default:"skeleton"},textures:{default:"textures/entity/skeleton/wither_skeleton"},geometry:{default:{texturewidth:64,textureheight:32,visible_bounds_width:1.5,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],bones:[{name:"body",parent:"waist",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}]},{name:"waist",pivot:[0,12,0]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}]},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}]},{name:"rightItem",parent:"rightArm",pivot:[-1,-45,-5],neverRender:!0},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5],neverRender:!0},{name:"rightLeg",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}]},{name:"leftLeg",parent:"body",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0}]}},render_controllers:["controller.render.wither_skeleton"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:29}},wither_skull:{identifier:"minecraft:wither_skull",materials:{default:"wither_skull"},textures:{default:"textures/entity/wither/wither"},geometry:{default:{bones:[{name:"head",cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,35]}]}],visible_bounds_width:1,visible_bounds_height:1,texturewidth:64,textureheight:64}},render_controllers:["controller.render.wither_skull"]},zoglin:{identifier:"minecraft:zoglin",materials:{default:"zoglin"},textures:{default:"textures/entity/hoglin/zoglin"},geometry:{default:{bones:[{name:"body",pivot:[0,19,-3],cubes:[{origin:[-8,11,-7],size:[16,14,26],inflate:.02,uv:[1,1]},{origin:[0,22,-10],size:[0,10,19],inflate:.02,uv:[90,33]}],locators:{lead:[0,20,-5]}},{name:"head",parent:"body",pivot:[0,22,-5],rotation:[50,0,0],cubes:[{origin:[-7,21,-24],size:[14,6,19],uv:[61,1]},{origin:[-8,22,-19],size:[2,11,2],uv:[1,13]},{origin:[6,22,-19],size:[2,11,2],uv:[1,13]}]},{name:"right_ear",parent:"head",pivot:[-7,27,-7],rotation:[0,0,-50],cubes:[{origin:[-13,26,-10],size:[6,1,4],uv:[1,1]}]},{name:"left_ear",parent:"head",pivot:[7,27,-7],rotation:[0,0,50],cubes:[{origin:[7,26,-10],size:[6,1,4],uv:[1,6]}]},{name:"leg_back_right",pivot:[6,8,17],cubes:[{origin:[-8,0,13],size:[5,11,5],uv:[21,45]}]},{name:"leg_back_left",pivot:[-6,8,17],cubes:[{origin:[3,0,13],size:[5,11,5],uv:[0,45]}]},{name:"leg_front_right",pivot:[-6,12,-3],cubes:[{origin:[-8,0,-6],size:[6,14,6],uv:[66,42]}]},{name:"leg_front_left",pivot:[6,12,-3],cubes:[{origin:[2,0,-6],size:[6,14,6],uv:[41,42]}]}],visible_bounds_width:4,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:64}},spawn_egg:{base_color:"#c66e55",overlay_color:"#e6e6e6"},render_controllers:["controller.render.zoglin"]},zombie:{identifier:"minecraft:zombie",min_engine_version:"1.8.0",materials:{default:"zombie"},textures:{default:"textures/entity/zombie/zombie"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],mirror:!0,parent:"body"}]}},spawn_egg:{texture:"spawn_egg",texture_index:12},scripts:{pre_animation:["variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;"]},animations:{humanoid_big_head:{loop:!0,bones:{head:{scale:1.4}}},look_at_target_default:{loop:!0,bones:{head:{relative_to:{rotation:"entity"},rotation:["query.target_x_rotation","query.target_y_rotation",0]}}},look_at_target_gliding:{loop:!0,bones:{head:{rotation:[-45,"query.target_y_rotation",0]}}},look_at_target_swimming:{loop:!0,bones:{head:{rotation:["math.lerp(query.target_x_rotation, -45.0, variable.swim_amount)","query.target_y_rotation",0]}}},move:{loop:!0,bones:{leftarm:{rotation:["variable.tcos0",0,0]},leftleg:{rotation:["variable.tcos0 * -1.4",0,0]},rightarm:{rotation:["-variable.tcos0",0,0]},rightleg:{rotation:["variable.tcos0 * 1.4",0,0]}}},"riding.arms":{loop:!0,bones:{leftarm:{rotation:[-36,0,0]},rightarm:{rotation:[-36,0,0]}}},"riding.legs":{loop:!0,bones:{leftleg:{rotation:["-72.0 - this","-18.0 - this","-this"]},rightleg:{rotation:["-72.0 - this","18.0 - this","-this"]}}},holding:{loop:!0,bones:{leftarm:{rotation:["variable.is_holding_left ? (-this * 0.5 - 18.0) : 0.0",0,0]},rightarm:{rotation:["variable.is_holding_right ? (-this * 0.5 - 18.0) : 0.0",0,0]}}},brandish_spear:{loop:!0,bones:{rightarm:{rotation:["this * -0.5 - 157.5 - 22.5 * variable.charge_amount","-this",0]}}},charging:{loop:!0,bones:{rightarm:{rotation:["22.5 * variable.charge_amount - this","-this",0]}}},"attack.rotations":{loop:!0,bones:{body:{rotation:[0,"math.sin(math.sqrt(variable.attack_time) * 360) * 11.46 - this",0]},leftarm:{rotation:["math.sin(math.sqrt(variable.attack_time) * 360) * 11.46",0,0]},rightarm:{rotation:["math.sin(1.0 - math.pow(1.0 - variable.attack_time, 3.0) * 180.0) * (variable.is_brandishing_spear ? -1.0 : 1.0 )","variable.is_brandishing_spear ? 0.0 : (math.sin(math.sqrt(variable.attack_time) * 360) * 11.46) * 2.0",0]}}},sneaking:{loop:!0,bones:{body:{rotation:["0.5 - this",0,0]},head:{position:[0,1,0]},leftarm:{rotation:[72,0,0]},leftleg:{position:[0,-3,4]},rightarm:{rotation:[72,0,0]},rightleg:{position:[0,-3,4]}}},bob:{loop:!0,bones:{leftarm:{rotation:[0,0,"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) *-1.0"]},rightarm:{rotation:[0,0,"(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},damage_nearby_mobs:{loop:!0,bones:{leftarm:{rotation:["-45.0-this","-this","-this"]},leftleg:{rotation:["45.0-this","-this","-this"]},rightarm:{rotation:["45.0-this","-this","-this"]},rightleg:{rotation:["-45.0-this","-this","-this"]}}},bow_and_arrow:{loop:!0,bones:{leftarm:{rotation:["query.target_x_rotation - 90.0 - math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation + 28.65","-(math.cos(query.life_time * 103.2) * 2.865) - 2.865"]},rightarm:{rotation:["query.target_x_rotation - 90.0 + math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation - 5.73","(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},use_item_progress:{loop:!0,bones:{rightarm:{rotation:["variable.use_item_startup_progress * -60.0 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -22.5 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -5.625 + variable.use_item_interval_progress * 11.25"]}}},zombie_attack_bare_hand:{loop:!0,bones:{leftarm:{rotation:["-90.0 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) - (math.sin(query.life_time * 76.776372) * 2.865) - this","5.73 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 0.6) - this","math.cos(query.life_time * 103.13244) * -2.865 - 2.865 - this"]},rightarm:{rotation:["90.0 * (variable.is_brandishing_spear - 1.0) - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) + (math.sin(query.life_time * 76.776372) * 2.865) - this","(math.sin(variable.attack_time * 180.0) * 57.3) * 0.6 - 5.73 - this","math.cos(query.life_time * 103.13244) * 2.865 + 2.865 - this"]}}},swimming:{loop:!0,bones:{body:{position:[0,"variable.swim_amount * -10.0 - this","variable.swim_amount * 9.0 - this"],rotation:["variable.swim_amount * (90.0 + query.target_x_rotation)",0,0]},leftarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) - (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, 14.325, variable.swim_amount) - (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},leftleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0 + 180.0) * 0.3, variable.swim_amount)",0,0]},rightarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) + (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, -14.325, variable.swim_amount) + (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},rightleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0) * 0.3, variable.swim_amount)",0,0]}}}},animation_controllers:{humanoid_baby_big_head:{initial_state:"default",states:{baby:{animations:["humanoid_big_head"],transitions:[{default:"!query.is_baby"}]},default:{transitions:[{baby:"query.is_baby"}]}}},look_at_target:{initial_state:"default",states:{default:{animations:["look_at_target_default"],transitions:[{gliding:"query.is_gliding"},{swimming:"query.is_swimming"}]},gliding:{animations:["look_at_target_gliding"],transitions:[{swimming:"query.is_swimming"},{default:"!query.is_gliding"}]},swimming:{animations:["look_at_target_swimming"],transitions:[{gliding:"query.is_gliding"},{default:"!query.is_swimming"}]}}},move:{initial_state:"default",states:{default:{animations:["move"]}}},riding:{initial_state:"default",states:{default:{transitions:[{riding:"query.is_riding"}]},riding:{animations:["riding.arms","riding.legs"],transitions:[{default:"!query.is_riding"}]}}},holding:{initial_state:"default",states:{default:{animations:["holding"]}}},brandish_spear:{initial_state:"default",states:{brandish_spear:{animations:["brandish_spear"],transitions:[{default:"!variable.is_brandishing_spear"}]},default:{transitions:[{brandish_spear:"variable.is_brandishing_spear"}]}}},charging:{initial_state:"default",states:{charging:{animations:["charging"],transitions:[{default:"!query.is_charging"}]},default:{transitions:[{charging:"query.is_charging"}]}}},attack:{initial_state:"default",states:{attacking:{animations:["attack.rotations"],transitions:[{default:"variable.attack_time < 0.0"}]},default:{transitions:[{attacking:"variable.attack_time >= 0.0"}]}}},sneaking:{initial_state:"default",states:{default:{transitions:[{sneaking:"query.is_sneaking"}]},sneaking:{animations:["sneaking"],transitions:[{default:"!query.is_sneaking"}]}}},bob:{initial_state:"default",states:{default:{animations:["bob"]}}},damage_nearby_mobs:{initial_state:"default",states:{damage_nearby_mobs:{animations:["damage_nearby_mobs"],transitions:[{default:"!variable.damage_nearby_mobs"}]},default:{transitions:[{damage_nearby_mobs:"variable.damage_nearby_mobs"}]}}},bow_and_arrow:{initial_state:"default",states:{bow_and_arrow:{animations:["bow_and_arrow"],transitions:[{default:"!query.has_target"}]},default:{transitions:[{bow_and_arrow:"query.has_target"}]}}},use_item_progress:{initial_state:"default",states:{default:{transitions:[{use_item_progress:"( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"}]},use_item_progress:{animations:["use_item_progress"],transitions:[{default:"( variable.use_item_interval_progress <= 0.0 ) && ( variable.use_item_startup_progress <= 0.0 )"}]}}},zombie_attack_bare_hand:{initial_state:"default",states:{default:{transitions:[{is_bare_hand:"variable.is_holding_left != 1.0"}]},is_bare_hand:{animations:["zombie_attack_bare_hand"],transitions:[{default:"variable.is_holding_left == 1.0"}]}}},swimming:{initial_state:"default",states:{default:{transitions:[{is_swimming:"variable.swim_amount > 0.0"}]},is_swimming:{animations:["swimming"],transitions:[{default:"variable.swim_amount <= 0.0"}]}}}},render_controllers:["controller.render.zombie"],enable_attachables:!0},zombified_piglin:{identifier:"minecraft:zombie_pigman",min_engine_version:"1.8.0",materials:{default:"zombie"},textures:{default:"textures/entity/piglin/zombified_piglin"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]},{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.25}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-5,24,-4],size:[10,8,8],uv:[0,0],inflate:-.02},{origin:[-2,24,-5],size:[4,4,1],uv:[31,1]},{origin:[2,24,-5],size:[1,2,1],uv:[2,4]},{origin:[-3,24,-5],size:[1,2,1],uv:[2,0]}],inflate:-.02},{name:"leftear",parent:"head",pivot:[5,30,0],rotation:[0,0,-30],cubes:[{origin:[4,25,-2],size:[1,5,4],uv:[51,6]}]},{name:"rightear",parent:"head",pivot:[-5,30,0],rotation:[0,0,30],cubes:[{origin:[-5,25,-2],size:[1,5,4],uv:[39,6]}]},{name:"hat",parent:"head",pivot:[0,24,0]},{name:"rightarm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]},{origin:[-8,12,-2],size:[4,12,4],uv:[40,32],inflate:.25}]},{name:"rightItem",parent:"rightarm",pivot:[-1,-45,-5]},{name:"leftarm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[32,48]},{origin:[4,12,-2],size:[4,12,4],uv:[48,48],inflate:.25}]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]},{name:"rightleg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,16]},{origin:[-4,0,-2],size:[4,12,4],uv:[0,32],inflate:.25}]},{name:"leftleg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[16,48]},{origin:[0,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]}],visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:64}},spawn_egg:{texture:"spawn_egg",texture_index:13},render_controllers:["controller.render.zombie_pigman"],enable_attachables:!0}};x();R();M();k();var Ie={};G5(Ie,{allay:()=>rs,arrow:()=>Ms,axolotl:()=>ns,blaze:()=>ss,boat:()=>Ls,camel:()=>os,cat:()=>as,chicken:()=>vs,cod:()=>ls,creeper:()=>cs,dolphin:()=>ds,ender_dragon:()=>us,enderman:()=>fs,endermite:()=>hs,fox:()=>ms,frog:()=>ps,ghast:()=>gs,goat:()=>bs,guardian:()=>ys,horse:()=>_s,llama:()=>ws,minecart:()=>As,parrot:()=>Es,piglin:()=>xs,pillager:()=>Rs,rabbit:()=>ks,shulker:()=>Ts,sniffer:()=>Ss,spider:()=>Cs,tadpole:()=>Bs,turtle:()=>Ps,vex:()=>Is,villager:()=>Hs,warden:()=>Os,witch:()=>zs,wolf:()=>Ds,zombie_villager:()=>Fs});x();R();M();k();var rs=`# Made in Blockbench 4.9.4
|
|
860
860
|
mtllib materials.mtl
|
|
861
861
|
|
|
862
862
|
o head
|
|
@@ -1180,7 +1180,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
|
|
|
1180
1180
|
f 56/156/39 51/155/39 49/154/39 54/153/39
|
|
1181
1181
|
f 55/160/40 56/159/40 54/158/40 53/157/40
|
|
1182
1182
|
f 54/164/41 49/163/41 50/162/41 53/161/41
|
|
1183
|
-
f 55/168/42 52/167/42 51/166/42 56/165/42`;var
|
|
1183
|
+
f 55/168/42 52/167/42 51/166/42 56/165/42`;var ns=`# Made in Blockbench 4.9.4
|
|
1184
1184
|
mtllib materials.mtl
|
|
1185
1185
|
|
|
1186
1186
|
o body
|
|
@@ -1688,7 +1688,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
1688
1688
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
1689
1689
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
1690
1690
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
1691
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
1691
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var ss=`# Made in Blockbench 4.9.4
|
|
1692
1692
|
mtllib materials.mtl
|
|
1693
1693
|
|
|
1694
1694
|
o upperBodyParts0
|
|
@@ -2288,7 +2288,7 @@ f 99/296/74 100/295/74 98/294/74 97/293/74
|
|
|
2288
2288
|
f 104/300/75 99/299/75 97/298/75 102/297/75
|
|
2289
2289
|
f 103/304/76 104/303/76 102/302/76 101/301/76
|
|
2290
2290
|
f 102/308/77 97/307/77 98/306/77 101/305/77
|
|
2291
|
-
f 103/312/78 100/311/78 99/310/78 104/309/78`;var
|
|
2291
|
+
f 103/312/78 100/311/78 99/310/78 104/309/78`;var os=`# Made in Blockbench 4.9.4
|
|
2292
2292
|
mtllib materials.mtl
|
|
2293
2293
|
|
|
2294
2294
|
o body
|
|
@@ -3348,7 +3348,7 @@ f 179/536/134 180/535/134 178/534/134 177/533/134
|
|
|
3348
3348
|
f 184/540/135 179/539/135 177/538/135 182/537/135
|
|
3349
3349
|
f 183/544/136 184/543/136 182/542/136 181/541/136
|
|
3350
3350
|
f 182/548/137 177/547/137 178/546/137 181/545/137
|
|
3351
|
-
f 183/552/138 180/551/138 179/550/138 184/549/138`;var
|
|
3351
|
+
f 183/552/138 180/551/138 179/550/138 184/549/138`;var as=`# Made in Blockbench 4.9.4
|
|
3352
3352
|
mtllib materials.mtl
|
|
3353
3353
|
|
|
3354
3354
|
o body
|
|
@@ -3856,7 +3856,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
3856
3856
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
3857
3857
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
3858
3858
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
3859
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
3859
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var vs=`# Made in Blockbench 4.9.4
|
|
3860
3860
|
mtllib materials.mtl
|
|
3861
3861
|
|
|
3862
3862
|
o body
|
|
@@ -4226,7 +4226,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
4226
4226
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
4227
4227
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
4228
4228
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
4229
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
4229
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var ls=`# Made in Blockbench 4.9.4
|
|
4230
4230
|
mtllib materials.mtl
|
|
4231
4231
|
|
|
4232
4232
|
o body
|
|
@@ -4596,7 +4596,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
4596
4596
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
4597
4597
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
4598
4598
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
4599
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
4599
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var cs=`# Made in Blockbench 4.9.4
|
|
4600
4600
|
mtllib materials.mtl
|
|
4601
4601
|
|
|
4602
4602
|
o Body
|
|
@@ -4874,7 +4874,7 @@ f 43/128/32 44/127/32 42/126/32 41/125/32
|
|
|
4874
4874
|
f 48/132/33 43/131/33 41/130/33 46/129/33
|
|
4875
4875
|
f 47/136/34 48/135/34 46/134/34 45/133/34
|
|
4876
4876
|
f 46/140/35 41/139/35 42/138/35 45/137/35
|
|
4877
|
-
f 47/144/36 44/143/36 43/142/36 48/141/36`;var
|
|
4877
|
+
f 47/144/36 44/143/36 43/142/36 48/141/36`;var ds=`# Made in Blockbench 4.9.4
|
|
4878
4878
|
mtllib materials.mtl
|
|
4879
4879
|
|
|
4880
4880
|
o body
|
|
@@ -5244,7 +5244,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
5244
5244
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
5245
5245
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
5246
5246
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
5247
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
5247
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var us=`# Made in Blockbench 4.9.4
|
|
5248
5248
|
mtllib materials.mtl
|
|
5249
5249
|
|
|
5250
5250
|
o neck
|
|
@@ -8236,7 +8236,7 @@ f 515/1544/386 516/1543/386 514/1542/386 513/1541/386
|
|
|
8236
8236
|
f 520/1548/387 515/1547/387 513/1546/387 518/1545/387
|
|
8237
8237
|
f 519/1552/388 520/1551/388 518/1550/388 517/1549/388
|
|
8238
8238
|
f 518/1556/389 513/1555/389 514/1554/389 517/1553/389
|
|
8239
|
-
f 519/1560/390 516/1559/390 515/1558/390 520/1557/390`;var
|
|
8239
|
+
f 519/1560/390 516/1559/390 515/1558/390 520/1557/390`;var fs=`# Made in Blockbench 4.9.4
|
|
8240
8240
|
mtllib materials.mtl
|
|
8241
8241
|
|
|
8242
8242
|
o Head
|
|
@@ -8560,7 +8560,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
|
|
|
8560
8560
|
f 56/156/39 51/155/39 49/154/39 54/153/39
|
|
8561
8561
|
f 55/160/40 56/159/40 54/158/40 53/157/40
|
|
8562
8562
|
f 54/164/41 49/163/41 50/162/41 53/161/41
|
|
8563
|
-
f 55/168/42 52/167/42 51/166/42 56/165/42`;var
|
|
8563
|
+
f 55/168/42 52/167/42 51/166/42 56/165/42`;var hs=`# Made in Blockbench 4.9.4
|
|
8564
8564
|
mtllib materials.mtl
|
|
8565
8565
|
|
|
8566
8566
|
o section_2
|
|
@@ -8746,7 +8746,7 @@ f 27/80/20 28/79/20 26/78/20 25/77/20
|
|
|
8746
8746
|
f 32/84/21 27/83/21 25/82/21 30/81/21
|
|
8747
8747
|
f 31/88/22 32/87/22 30/86/22 29/85/22
|
|
8748
8748
|
f 30/92/23 25/91/23 26/90/23 29/89/23
|
|
8749
|
-
f 31/96/24 28/95/24 27/94/24 32/93/24`;var
|
|
8749
|
+
f 31/96/24 28/95/24 27/94/24 32/93/24`;var ms=`# Made in Blockbench 4.9.4
|
|
8750
8750
|
mtllib materials.mtl
|
|
8751
8751
|
|
|
8752
8752
|
o body
|
|
@@ -9208,7 +9208,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
|
|
|
9208
9208
|
f 80/228/57 75/227/57 73/226/57 78/225/57
|
|
9209
9209
|
f 79/232/58 80/231/58 78/230/58 77/229/58
|
|
9210
9210
|
f 78/236/59 73/235/59 74/234/59 77/233/59
|
|
9211
|
-
f 79/240/60 76/239/60 75/238/60 80/237/60`;var
|
|
9211
|
+
f 79/240/60 76/239/60 75/238/60 80/237/60`;var ps=`# Made in Blockbench 4.9.4
|
|
9212
9212
|
mtllib materials.mtl
|
|
9213
9213
|
|
|
9214
9214
|
o body
|
|
@@ -9946,7 +9946,7 @@ f 123/368/92 124/367/92 122/366/92 121/365/92
|
|
|
9946
9946
|
f 128/372/93 123/371/93 121/370/93 126/369/93
|
|
9947
9947
|
f 127/376/94 128/375/94 126/374/94 125/373/94
|
|
9948
9948
|
f 126/380/95 121/379/95 122/378/95 125/377/95
|
|
9949
|
-
f 127/384/96 124/383/96 123/382/96 128/381/96`;var
|
|
9949
|
+
f 127/384/96 124/383/96 123/382/96 128/381/96`;var gs=`# Made in Blockbench 4.9.4
|
|
9950
9950
|
mtllib materials.mtl
|
|
9951
9951
|
|
|
9952
9952
|
o body
|
|
@@ -10408,7 +10408,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
|
|
|
10408
10408
|
f 80/228/57 75/227/57 73/226/57 78/225/57
|
|
10409
10409
|
f 79/232/58 80/231/58 78/230/58 77/229/58
|
|
10410
10410
|
f 78/236/59 73/235/59 74/234/59 77/233/59
|
|
10411
|
-
f 79/240/60 76/239/60 75/238/60 80/237/60`;var
|
|
10411
|
+
f 79/240/60 76/239/60 75/238/60 80/237/60`;var bs=`# Made in Blockbench 4.9.4
|
|
10412
10412
|
mtllib materials.mtl
|
|
10413
10413
|
|
|
10414
10414
|
o left_back_leg
|
|
@@ -11008,7 +11008,7 @@ f 99/296/74 100/295/74 98/294/74 97/293/74
|
|
|
11008
11008
|
f 104/300/75 99/299/75 97/298/75 102/297/75
|
|
11009
11009
|
f 103/304/76 104/303/76 102/302/76 101/301/76
|
|
11010
11010
|
f 102/308/77 97/307/77 98/306/77 101/305/77
|
|
11011
|
-
f 103/312/78 100/311/78 99/310/78 104/309/78`;var
|
|
11011
|
+
f 103/312/78 100/311/78 99/310/78 104/309/78`;var ys=`# Made in Blockbench 4.9.4
|
|
11012
11012
|
mtllib materials.mtl
|
|
11013
11013
|
|
|
11014
11014
|
o head
|
|
@@ -12022,7 +12022,7 @@ f 171/512/128 172/511/128 170/510/128 169/509/128
|
|
|
12022
12022
|
f 176/516/129 171/515/129 169/514/129 174/513/129
|
|
12023
12023
|
f 175/520/130 176/519/130 174/518/130 173/517/130
|
|
12024
12024
|
f 174/524/131 169/523/131 170/522/131 173/521/131
|
|
12025
|
-
f 175/528/132 172/527/132 171/526/132 176/525/132`;var
|
|
12025
|
+
f 175/528/132 172/527/132 171/526/132 176/525/132`;var _s=`# Made in Blockbench 4.9.4
|
|
12026
12026
|
mtllib materials.mtl
|
|
12027
12027
|
|
|
12028
12028
|
o Body
|
|
@@ -13082,7 +13082,7 @@ f 179/536/134 180/535/134 178/534/134 177/533/134
|
|
|
13082
13082
|
f 184/540/135 179/539/135 177/538/135 182/537/135
|
|
13083
13083
|
f 183/544/136 184/543/136 182/542/136 181/541/136
|
|
13084
13084
|
f 182/548/137 177/547/137 178/546/137 181/545/137
|
|
13085
|
-
f 183/552/138 180/551/138 179/550/138 184/549/138`;var
|
|
13085
|
+
f 183/552/138 180/551/138 179/550/138 184/549/138`;var ws=`# Made in Blockbench 4.9.4
|
|
13086
13086
|
mtllib materials.mtl
|
|
13087
13087
|
|
|
13088
13088
|
o head
|
|
@@ -13590,7 +13590,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
13590
13590
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
13591
13591
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
13592
13592
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
13593
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
13593
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var As=`# Made in Blockbench 4.9.4
|
|
13594
13594
|
mtllib materials.mtl
|
|
13595
13595
|
|
|
13596
13596
|
o bottom
|
|
@@ -13822,7 +13822,7 @@ f 35/104/26 36/103/26 34/102/26 33/101/26
|
|
|
13822
13822
|
f 40/108/27 35/107/27 33/106/27 38/105/27
|
|
13823
13823
|
f 39/112/28 40/111/28 38/110/28 37/109/28
|
|
13824
13824
|
f 38/116/29 33/115/29 34/114/29 37/113/29
|
|
13825
|
-
f 39/120/30 36/119/30 35/118/30 40/117/30`;var
|
|
13825
|
+
f 39/120/30 36/119/30 35/118/30 40/117/30`;var Es=`# Made in Blockbench 4.9.4
|
|
13826
13826
|
mtllib materials.mtl
|
|
13827
13827
|
|
|
13828
13828
|
o body
|
|
@@ -14330,7 +14330,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
14330
14330
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
14331
14331
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
14332
14332
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
14333
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
14333
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var xs=`# Made in Blockbench 4.9.4
|
|
14334
14334
|
mtllib materials.mtl
|
|
14335
14335
|
|
|
14336
14336
|
o Body
|
|
@@ -15068,7 +15068,7 @@ f 123/368/92 124/367/92 122/366/92 121/365/92
|
|
|
15068
15068
|
f 128/372/93 123/371/93 121/370/93 126/369/93
|
|
15069
15069
|
f 127/376/94 128/375/94 126/374/94 125/373/94
|
|
15070
15070
|
f 126/380/95 121/379/95 122/378/95 125/377/95
|
|
15071
|
-
f 127/384/96 124/383/96 123/382/96 128/381/96`;var
|
|
15071
|
+
f 127/384/96 124/383/96 123/382/96 128/381/96`;var Rs=`# Made in Blockbench 4.9.4
|
|
15072
15072
|
mtllib materials.mtl
|
|
15073
15073
|
|
|
15074
15074
|
o Body
|
|
@@ -15438,7 +15438,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
15438
15438
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
15439
15439
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
15440
15440
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
15441
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
15441
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var ks=`# Made in Blockbench 4.9.4
|
|
15442
15442
|
mtllib materials.mtl
|
|
15443
15443
|
|
|
15444
15444
|
o rearFootLeft
|
|
@@ -15992,7 +15992,7 @@ f 91/272/68 92/271/68 90/270/68 89/269/68
|
|
|
15992
15992
|
f 96/276/69 91/275/69 89/274/69 94/273/69
|
|
15993
15993
|
f 95/280/70 96/279/70 94/278/70 93/277/70
|
|
15994
15994
|
f 94/284/71 89/283/71 90/282/71 93/281/71
|
|
15995
|
-
f 95/288/72 92/287/72 91/286/72 96/285/72`;var
|
|
15995
|
+
f 95/288/72 92/287/72 91/286/72 96/285/72`;var Ms=`# Aspose.3D Wavefront OBJ Exporter
|
|
15996
15996
|
# Copyright 2004-2024 Aspose Pty Ltd.
|
|
15997
15997
|
# File created: 02/12/2025 20:01:28
|
|
15998
15998
|
|
|
@@ -16052,7 +16052,7 @@ f 5/8/5 6/4/6 8/3/7 7/5/8
|
|
|
16052
16052
|
f 9/11/9 10/7/10 12/6/11 11/12/12
|
|
16053
16053
|
#3 polygons
|
|
16054
16054
|
|
|
16055
|
-
`;var
|
|
16055
|
+
`;var Ts=`# Made in Blockbench 4.9.4
|
|
16056
16056
|
mtllib materials.mtl
|
|
16057
16057
|
|
|
16058
16058
|
o base
|
|
@@ -16192,7 +16192,7 @@ f 19/56/14 20/55/14 18/54/14 17/53/14
|
|
|
16192
16192
|
f 24/60/15 19/59/15 17/58/15 22/57/15
|
|
16193
16193
|
f 23/64/16 24/63/16 22/62/16 21/61/16
|
|
16194
16194
|
f 22/68/17 17/67/17 18/66/17 21/65/17
|
|
16195
|
-
f 23/72/18 20/71/18 19/70/18 24/69/18`;var
|
|
16195
|
+
f 23/72/18 20/71/18 19/70/18 24/69/18`;var Ss=`# Made in Blockbench 4.9.4
|
|
16196
16196
|
mtllib materials.mtl
|
|
16197
16197
|
|
|
16198
16198
|
o body
|
|
@@ -16884,7 +16884,7 @@ f 115/344/86 116/343/86 114/342/86 113/341/86
|
|
|
16884
16884
|
f 120/348/87 115/347/87 113/346/87 118/345/87
|
|
16885
16885
|
f 119/352/88 120/351/88 118/350/88 117/349/88
|
|
16886
16886
|
f 118/356/89 113/355/89 114/354/89 117/353/89
|
|
16887
|
-
f 119/360/90 116/359/90 115/358/90 120/357/90`;var
|
|
16887
|
+
f 119/360/90 116/359/90 115/358/90 120/357/90`;var Cs=`# Made in Blockbench 4.9.4
|
|
16888
16888
|
mtllib materials.mtl
|
|
16889
16889
|
|
|
16890
16890
|
o head
|
|
@@ -17392,7 +17392,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
17392
17392
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
17393
17393
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
17394
17394
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
17395
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
17395
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var Bs=`# Made in Blockbench 4.9.4
|
|
17396
17396
|
mtllib materials.mtl
|
|
17397
17397
|
|
|
17398
17398
|
o body
|
|
@@ -17486,7 +17486,7 @@ f 11/32/8 12/31/8 10/30/8 9/29/8
|
|
|
17486
17486
|
f 16/36/9 11/35/9 9/34/9 14/33/9
|
|
17487
17487
|
f 15/40/10 16/39/10 14/38/10 13/37/10
|
|
17488
17488
|
f 14/44/11 9/43/11 10/42/11 13/41/11
|
|
17489
|
-
f 15/48/12 12/47/12 11/46/12 16/45/12`;var
|
|
17489
|
+
f 15/48/12 12/47/12 11/46/12 16/45/12`;var Ps=`# Made in Blockbench 4.9.4
|
|
17490
17490
|
mtllib materials.mtl
|
|
17491
17491
|
|
|
17492
17492
|
o body
|
|
@@ -17856,7 +17856,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
17856
17856
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
17857
17857
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
17858
17858
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
17859
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
17859
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var Is=`# Made in Blockbench 4.9.4
|
|
17860
17860
|
mtllib materials.mtl
|
|
17861
17861
|
|
|
17862
17862
|
o body
|
|
@@ -18180,7 +18180,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
|
|
|
18180
18180
|
f 56/156/39 51/155/39 49/154/39 54/153/39
|
|
18181
18181
|
f 55/160/40 56/159/40 54/158/40 53/157/40
|
|
18182
18182
|
f 54/164/41 49/163/41 50/162/41 53/161/41
|
|
18183
|
-
f 55/168/42 52/167/42 51/166/42 56/165/42`;var
|
|
18183
|
+
f 55/168/42 52/167/42 51/166/42 56/165/42`;var Hs=`# Made in Blockbench 4.9.4
|
|
18184
18184
|
mtllib materials.mtl
|
|
18185
18185
|
|
|
18186
18186
|
o body
|
|
@@ -18688,7 +18688,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
18688
18688
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
18689
18689
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
18690
18690
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
18691
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
18691
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var Os=`# Made in Blockbench 4.9.4
|
|
18692
18692
|
mtllib materials.mtl
|
|
18693
18693
|
|
|
18694
18694
|
o body
|
|
@@ -19150,7 +19150,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
|
|
|
19150
19150
|
f 80/228/57 75/227/57 73/226/57 78/225/57
|
|
19151
19151
|
f 79/232/58 80/231/58 78/230/58 77/229/58
|
|
19152
19152
|
f 78/236/59 73/235/59 74/234/59 77/233/59
|
|
19153
|
-
f 79/240/60 76/239/60 75/238/60 80/237/60`;var
|
|
19153
|
+
f 79/240/60 76/239/60 75/238/60 80/237/60`;var zs=`# Made in Blockbench 4.9.4
|
|
19154
19154
|
mtllib materials.mtl
|
|
19155
19155
|
|
|
19156
19156
|
o head
|
|
@@ -19796,7 +19796,7 @@ f 107/320/80 108/319/80 106/318/80 105/317/80
|
|
|
19796
19796
|
f 112/324/81 107/323/81 105/322/81 110/321/81
|
|
19797
19797
|
f 111/328/82 112/327/82 110/326/82 109/325/82
|
|
19798
19798
|
f 110/332/83 105/331/83 106/330/83 109/329/83
|
|
19799
|
-
f 111/336/84 108/335/84 107/334/84 112/333/84`;var
|
|
19799
|
+
f 111/336/84 108/335/84 107/334/84 112/333/84`;var Ds=`# Made in Blockbench 4.9.4
|
|
19800
19800
|
mtllib materials.mtl
|
|
19801
19801
|
|
|
19802
19802
|
o head
|
|
@@ -20304,7 +20304,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
20304
20304
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
20305
20305
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
20306
20306
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
20307
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
20307
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var Fs=`# Made in Blockbench 4.9.4
|
|
20308
20308
|
mtllib materials.mtl
|
|
20309
20309
|
|
|
20310
20310
|
o Body
|
|
@@ -20766,7 +20766,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
|
|
|
20766
20766
|
f 80/228/57 75/227/57 73/226/57 78/225/57
|
|
20767
20767
|
f 79/232/58 80/231/58 78/230/58 77/229/58
|
|
20768
20768
|
f 78/236/59 73/235/59 74/234/59 77/233/59
|
|
20769
|
-
f 79/240/60 76/239/60 75/238/60 80/237/60`;var
|
|
20769
|
+
f 79/240/60 76/239/60 75/238/60 80/237/60`;var Ls=`# Made in Blockbench 4.9.4
|
|
20770
20770
|
mtllib materials.mtl
|
|
20771
20771
|
|
|
20772
20772
|
o bottom
|
|
@@ -21182,9 +21182,9 @@ f 67/200/50 68/199/50 66/198/50 65/197/50
|
|
|
21182
21182
|
f 72/204/51 67/203/51 65/202/51 70/201/51
|
|
21183
21183
|
f 71/208/52 72/207/52 70/206/52 69/205/52
|
|
21184
21184
|
f 70/212/53 65/211/53 66/210/53 69/209/53
|
|
21185
|
-
f 71/216/54 68/215/54 67/214/54 72/213/54`;var ar={allay:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAV1BMVEUAAAA4jNkuh9Ypg9FBnNpCm9r///+c/P+A/P9k+/9N8/hM6f9Q2f8+5eo94PdG0P821+4s1ewiz/8syf8ox/8bxPNNq+wQwf8os+hCnNpCm9oep9s0h8D7j8AOAAAABnRSTlMAoKCg3PODq/XXAAAA60lEQVR42tWP0W7DIAxFb9OtwdA6xQ3rzZL//84BD0nRljzsZdqxZCx8hLio3Lz4GwtYMWLDi4jnPM+vwogNKTTC43Elr6vgRMQ1wvM5ktsbvRPXN38wGxKHMmnI9M65vgxavwsg2WCpCvlSg6iqlCF4ceKbFEGZVC+5NFFXYUtxZzILl1xmiffoxUcA5DUHKULZp6iqsQzU6KNWYcxBUMnp8A2mwWxAhTPR0qRYFs6sDT+zTMZpWj5pO8L0wamexJ9xXvm10J27rrQ94dSdOqC0PSFXPV4JRuwRzIxGHMB38O14j4N9Wf4/vgDzpRGDwkNeQQAAAABJRU5ErkJggg==",axolotl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAP1BMVE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XRSTlMAQObYZgAAATFJREFUeNrtk9FuwyAMRVMa7jWzwf3/rx3QLmsiOlpV2lOPk+BYypFRzLIs53A6hXA617sSzsurEABTSkRPsLxGAIEYI0ACiCAC4tqp5fbARGApJavRsLoggLHGyrWvmAoOIPSWtiamgmw7MgIhcQuAM0G+U+TcBERcY+wNgJwJPO9wBAq3Blo+E+wM7ghSIRqkVGaCPV3w9RsTQUVAMRMC+MlkUHusISVfLlkoW8ZRbRmTRFXNTG9YZ1wdCoTqXsy8dNysuJtQ7Z6JoBTV0rlmrk3gB0zHW2gCU7XS6ZlrugrKxp+Ccuyg3ATljscC0eLtM/d+aX+tVfOy46GAQwGfFsiwA5HnBRwK+O4W/k/w/m+U4SDJ84MkMhxlmY7y8TCVGy8fpsR+WnXDGuPq8mHIN8fuL8tkDiT4AAAAAElFTkSuQmCC",parrot:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAP1BMVEUAAAD/////7nn/6j3/5TPGxsa7u7vZra23t7ewsLCoqKienp6ZmZmWlpaRkZGQkJD3cwmGhoYlJSUPDw8AAAD7udxiAAAAAXRSTlMAQObYZgAAANJJREFUeNrN0tEKwjAMBdDGxpnbZqtx/v+32jYMN9QKPnkhYdBDk0EDHSIQ0CGBDkEV/pFgahtgBhxEZu7nSGj1Ajg6SAmpVQe4M98hgHCMVUAgqklbObgyXwGhXczUWlXg10Z+bj/4i3X19gra1KJrDfVGakcARdFyqyEHS353w35J2oGiBRO8++miqrU2MJdZIN6pJy+Lz3Cgs04yeaees6qeByMypZQo548jLDdl9mnE8D18B+EyBiG4+AGMduBwCi2/g+BiAAJ/BTwEW/4XPABsMA1LwNN2rAAAAABJRU5ErkJggg==",piglin:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAWlBMVEUAAAD/gID/////7aj/5bX12iryuobMzIPCwnTooHTVlXreihzJgmWHh1e6ZkWtVTKiWTplXEOhPjiESzOXQ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47T6gAbRObaNvYNjhpbIyxzIsw42War8a4U/M8Nod5vQdibNs4DC0MGzNgpzGlJEiTLfMQUIwYNo68I3WexO2BdgCgQ3awNVlJuzrcGpP5FVkhckCIRLGLuwVaTaopJLyBGuK9gPmptRbfNFMc1qozZfFCglQKoIgDOeagA7Ym3zEOXa7MN1gASBBRlQwZQ96JOBwF4MCeidg5puQ4YMELPNgO5UeXsWVEgAYVJlMALkIBKIAAwHnH0SI8FE2xybddYr5tmzZFJAwAeWYIorcACzE5KC4wBwDLYVgu24gwPeR57KlFHpN1XRsiZgehACKz2wUJ+xnOF7uu/1pcL77Kq6caZUD2/0ZFAk9zM9XrfYvrb1L1TPXvNbFnhwqQEPOKZbVKaZW0aWIpvy+bZVOypUYT7vFx9tGz9zOcFuDN/+gIHIEjcASOwBH44cB/1lQM4ZNhKecAAAAASUVORK5CYII="};x();R();T();k();import*as z0 from"three";var vr=class{constructor(t,e){this.object=t;this.animations=e;u(this,"clock",new z0.Clock);u(this,"animatedObjects",new Set);u(this,"state")}createAnimationState(){let t=new z0.AnimationMixer(this.object),e=new Map;for(let i of this.animations)e.set(i.name,t.clipAction(i));return this.state={mixer:t,animations:this.animations,actions:e,speed:1,loop:!0},this.object.traverse(i=>{if(i instanceof z0.Mesh||i instanceof z0.Line||i instanceof z0.Points||i instanceof z0.Sprite){let r=i.onBeforeRender;i.onBeforeRender=(s,o,a,v,l,c)=>{let d=this.clock.getDelta();t.update(d),r?.(s,o,a,v,l,c)}}}),this.animatedObjects.add(this.object),this.state}playAnimation(t,e,i){let r=this.state.actions.get(t);if(!r)return!1;this.state.mixer.stopAllAction();let s=e??this.state.loop;return r.setLoop(s?z0.LoopRepeat:z0.LoopOnce,1/0),r.clampWhenFinished=!s,i===void 0?r.timeScale=this.state.speed:r.timeScale=i,r.reset().fadeIn(.1).play(),!0}updateAnimationParams(t,e){t!==void 0&&(this.state.speed=t),e!==void 0&&(this.state.loop=e);for(let i of this.state.actions.values())t!==void 0&&(i.timeScale=t),e!==void 0&&(i.setLoop(e?z0.LoopRepeat:z0.LoopOnce,1/0),i.clampWhenFinished=!e)}stopAnimations(){this.state.mixer.stopAllAction()}getDelta(){return this.clock.getDelta()}};function Is(n,t){let e=new vr(n,t);return e.createAnimationState(),e}function M8(n){return"parts"in n&&Array.isArray(n.parts)?n.parts:[n]}var S8={up:{dir:[0,1,0],u0:[0,0,1],v0:[0,0,0],u1:[1,0,1],v1:[0,0,1],corners:[[0,1,1,0,0],[1,1,1,1,0],[0,1,0,0,1],[1,1,0,1,1]]},down:{dir:[0,-1,0],u0:[1,0,1],v0:[0,0,0],u1:[2,0,1],v1:[0,0,1],corners:[[1,0,1,0,0],[0,0,1,1,0],[1,0,0,0,1],[0,0,0,1,1]]},east:{dir:[1,0,0],u0:[0,0,0],v0:[0,0,1],u1:[0,0,1],v1:[0,1,1],corners:[[1,1,1,0,0],[1,0,1,0,1],[1,1,0,1,0],[1,0,0,1,1]]},west:{dir:[-1,0,0],u0:[1,0,1],v0:[0,0,1],u1:[1,0,2],v1:[0,1,1],corners:[[0,1,0,0,0],[0,0,0,0,1],[0,1,1,1,0],[0,0,1,1,1]]},north:{dir:[0,0,-1],u0:[0,0,1],v0:[0,0,1],u1:[1,0,1],v1:[0,1,1],corners:[[1,0,0,0,1],[0,0,0,1,1],[1,1,0,0,0],[0,1,0,1,0]]},south:{dir:[0,0,1],u0:[1,0,2],v0:[0,0,1],u1:[2,0,2],v1:[0,1,1],corners:[[0,0,1,0,1],[1,0,1,1,1],[0,1,1,0,0],[1,1,1,1,0]]}};function Hs(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function C8(n,t,e,i,r=!1,s=64,o=64,a=!1,v=[]){let l=new J.Euler(0,0,0);i.rotation&&(l.x=-i.rotation[0]*Math.PI/180,l.y=-i.rotation[1]*Math.PI/180,l.z=-i.rotation[2]*Math.PI/180);for(let{dir:c,corners:d,u0:f,v0:m,u1:g,v1:b}of Object.values(S8)){let A=Math.floor(n.positions.length/3),_=c[0]!==0,w=[];for(let M of d){let S,C;r?(S=(i.uv[0]+M[3]*i.size[0])/s,C=(i.uv[1]+M[4]*i.size[1])/o):(S=(i.uv[0]+Hs(M[3]?g:f,i.size))/s,C=(i.uv[1]+Hs(M[4]?b:m,i.size))/o);let H=_&&a?M[0]^1:M[0],B=M[1],I=_&&a?M[2]^1:M[2],N=i.inflate??0,O=new J.Vector3(i.origin[0]+H*i.size[0]+(H?N:-N),i.origin[1]+B*i.size[1]+(B?N:-N),i.origin[2]+I*i.size[2]+(I?N:-N));O=O.applyEuler(l),O=O.sub(e.position),O=O.applyEuler(e.rotation),O=O.add(e.position),n.positions.push(O.x,O.y,O.z),n.normals.push(c[0],c[1],c[2]),w.push(S,C),n.skinIndices.push(t,0,0,0),n.skinWeights.push(1,0,0,0)}if(a)for(let M=0;M+1<d.length;M+=2){let S=M*2,C=w.slice(S,S+4);w[S]=C[2],w[S+1]=C[_?1:3],w[S+2]=C[0],w[S+3]=C[_?3:1]}n.uvs.push(...w),n.indices.push(A,A+1,A+2,A+2,A+1,A+3)}}function Bt(n,t,e,i={},r={}){let s=e.texturewidth??64,o=e.textureheight??64,a,v=t.startsWith("block:"),l=n?.material.map;if(v){if(!n)throw new Error("worldRenderer is required for block textures");let w=t.slice(6),M=n.resourcesManager.currentResources.blocksAtlasJson.textures[w];M&&(s=l?.image.width??s,o=l?.image.height??o,a=[M.u,M.v])}let c={},d={positions:[],normals:[],uvs:[],indices:[],skinIndices:[],skinWeights:[]},f=0;for(let w of e.bones){let M=new J.Bone;if(w.pivot&&(M.position.x=w.pivot[0],M.position.y=w.pivot[1],M.position.z=w.pivot[2]),w.bind_pose_rotation?(M.rotation.x=-w.bind_pose_rotation[0]*Math.PI/180,M.rotation.y=-w.bind_pose_rotation[1]*Math.PI/180,M.rotation.z=-w.bind_pose_rotation[2]*Math.PI/180):w.rotation&&(M.rotation.x=-w.rotation[0]*Math.PI/180,M.rotation.y=-w.rotation[1]*Math.PI/180,M.rotation.z=-w.rotation[2]*Math.PI/180),i.rotation?.[w.name]&&(M.rotation.x-=(i.rotation[w.name].x??0)*Math.PI/180,M.rotation.y-=(i.rotation[w.name].y??0)*Math.PI/180,M.rotation.z-=(i.rotation[w.name].z??0)*Math.PI/180),M.name=`bone_${w.name}`,c[w.name]=M,w.cubes)for(let S of w.cubes){let C=[];C8(d,f,M,S,v,s,o,w.mirror,C),C.length&&(r.errors??(r.errors=[]),r.errors.push(...C.map(H=>`Bone ${w.name}: ${H}`)))}f++}let m=[];for(let w of e.bones)w.parent&&c[w.parent]?c[w.parent].add(c[w.name]):m.push(c[w.name]);let g=new J.Skeleton(Object.values(c)),b=new J.BufferGeometry;b.setAttribute("position",new J.Float32BufferAttribute(d.positions,3)),b.setAttribute("normal",new J.Float32BufferAttribute(d.normals,3)),b.setAttribute("uv",new J.Float32BufferAttribute(d.uvs,2)),b.setAttribute("skinIndex",new J.Uint16BufferAttribute(d.skinIndices,4)),b.setAttribute("skinWeight",new J.Float32BufferAttribute(d.skinWeights,4)),b.setIndex(d.indices);let A=new J.MeshLambertMaterial({transparent:!0,alphaTest:.1,side:J.DoubleSide}),_=new J.SkinnedMesh(b,A);if(_.add(...m),_.bind(g),_.scale.set(1/16,1/16,1/16),a){let w=l.clone();w.offset.set(a[0],a[1]),w.needsUpdate=!0,A.map=w}else o1(t,w=>{A.map||(w.magFilter=J.NearestFilter,w.minFilter=J.NearestFilter,w.flipY=!1,w.wrapS=J.RepeatWrapping,w.wrapT=J.RepeatWrapping,A.map=w)},()=>{let w=A.map.image.width;w&&s!==w&&(A.map.repeat.x=s/w);let M=A.map.image.height;M&&o!==M&&(A.map.repeat.y=o/M),A.needsUpdate=!0});return _}var P8=[{pattern:"furnace_minecart",target:"minecart"},{pattern:"spawner_minecart",target:"minecart"},{pattern:"chest_minecart",target:"minecart"},{pattern:"hopper_minecart",target:"minecart"},{pattern:"command_block_minecart",target:"minecart"},{pattern:"tnt_minecart",target:"minecart"},{pattern:"glow_item_frame",target:"item_frame"},{pattern:"glow_squid",target:"squid"},{pattern:"trader_llama",target:"llama"},{pattern:"chest_boat",target:"boat"},{pattern:"spectral_arrow",target:"arrow"},{pattern:"husk",target:"zombie"},{pattern:"zombie_horse",target:"horse"},{pattern:"donkey",target:"horse"},{pattern:"skeleton_horse",target:"horse"},{pattern:"mule",target:"horse"},{pattern:"ocelot",target:"cat"},{pattern:/_minecraft$/,target:"minecraft"},{pattern:/_boat$/,target:"boat"},{pattern:/_raft$/,target:"boat"},{pattern:/_horse$/,target:"horse"},{pattern:/_zombie$/,target:"zombie"},{pattern:/_arrow$/,target:"zombie"}];function Os(n){for(let t of P8)if(typeof t.pattern=="string"){if(t.pattern===n)return t.target}else if(t.pattern.test(n))return t.target}var zs=n=>J3[n],Ds={zombie:1.85,husk:1.85,arrow:.0025},B8={zombie:new x1(0,1,0),husk:new x1(0,1,0),boat:new x1(0,-1,0),arrow:new x1(0,-.9,0)},Et=class{constructor(t,e,i,r={},s={}){u(this,"mesh");u(this,"animations");u(this,"animationControllers",[]);let o=e,a=Os(e);if(a&&(e=a,s.tempMap=a),r.customModel){let l=M8(r.customModel);this.mesh=new J.Object3D;for(let c=0;c<l.length;c++){let{modelPath:d,modelType:f,metadata:m}=l[c],g=new J.Object3D;switch(g.name=`custom_part_${c}`,f){case"gltf":{new A8().parseAsync(d,"").then(A=>{if(g.add(A.scene),m?.scale){let _=m.scale;g.scale.set(_,_,_)}if(m?.offset){let{x:_=0,y:w=0,z:M=0}=m.offset;g.position.set(_,w,M)}if(m?.texture){let _=new J.TextureLoader().load(m.texture);_.minFilter=J.NearestFilter,_.magFilter=J.NearestFilter,g.traverse(w=>{w instanceof J.Mesh&&(w.material=new J.MeshBasicMaterial({map:_,transparent:!0,alphaTest:.1}))})}if(A.animations?.length){this.animations=[...this.animations??[],...A.animations];let _=Is(g,A.animations);this.animationControllers.push(_);let w=m?.animation,M=m?.animationLoop??!0;w?_.playAnimation(w,M):_.playAnimation(A.animations[0].name,M)}}).catch(A=>{});break}case"obj":{let A=new Se().parse(d);if(m?.scale){let{scale:_}=m;A.scale.set(_,_,_)}if(m?.offset){let{x:_=0,y:w=0,z:M=0}=m.offset;A.position.set(_,w,M)}if(m?.texture){let _=new J.TextureLoader().load(m.texture);_.minFilter=J.NearestFilter,_.magFilter=J.NearestFilter;let w=new J.MeshBasicMaterial({map:_,transparent:!0,alphaTest:.1});A.traverse(M=>{M instanceof J.Mesh&&(M.material=w)})}g.add(A);break}case"bedrock":{let b=JSON.parse(d);if(m?.scale&&g.scale.set(m.scale,m.scale,m.scale),m?.offset){let{x:A=0,y:_=0,z:w=0}=m.offset;g.position.set(A,_,w)}for(let[A,_]of Object.entries(b.geometry)){let w=m?.textures?.[A]??b.textures?.[A];if(!w)continue;let M=Bt(i,w.endsWith(".png")||w.startsWith("data:image/")||w.startsWith("block:")?w:w+".png",_,r,s);M.name=`geometry_${A}`,g.add(M)}break}}this.mesh.add(g)}s.type=l.length===1?l[0].modelType:"special";return}if(Ce[e]){let l=new Se,c={zombie_horse:`textures/${t}/entity/horse/horse_zombie.png`,husk:E8,skeleton_horse:`textures/${t}/entity/horse/horse_skeleton.png`,donkey:`textures/${t}/entity/horse/donkey.png`,mule:`textures/${t}/entity/horse/mule.png`,ocelot:x8,arrow:R8,spectral_arrow:k8,tipped_arrow:T8},d=c[o]||c[e];d&&(s.textureMap=!0);let f=d||ar[e];if(ar[e]&&(s.isHardcodedTexture=!0),!f)throw new Error(`No texture for ${e}`);let m=new J.TextureLoader().load(f);m.minFilter=J.NearestFilter,m.magFilter=J.NearestFilter;let g=new J.MeshBasicMaterial({map:m,transparent:!0,alphaTest:.1}),b=l.parse(Ce[e]),A=Ds[o]||Ds[e];A&&b.scale.set(A,A,A);let _=B8[o];_&&b.position.set(_.x,_.y,_.z),b.traverse(w=>{w instanceof J.Mesh&&(w.material=g,w.name==="Head layer"&&(w.visible=!1),w.name==="Head"&&r.rotation?.head&&(w.rotation.x-=(r.rotation.head.x??0)*Math.PI/180,w.rotation.y-=(r.rotation.head.y??0)*Math.PI/180,w.rotation.z-=(r.rotation.head.z??0)*Math.PI/180))}),this.mesh=b,s.type="obj";return}let v=zs(e);if(v){this.mesh=new J.Object3D;for(let[l,c]of Object.entries(v.geometry)){let d=r.textures?.[l]??v.textures[l];if(!d)continue;let f=Bt(i,d.endsWith(".png")||d.startsWith("data:image/")||d.startsWith("block:")?d:d+".png",c,r,s);f.name=`geometry_${l}`,this.mesh.add(f)}s.type="bedrock"}}playAnimation(t,e=!1){if(!this.animationControllers.length)return;let i=!1;for(let r of this.animationControllers)r.playAnimation(t,e)&&(i=!0)}update(t){}static getStaticData(t){if(t=Os(t)||t,Ce[t])return{boneNames:[]};let e=zs(t);if(!e)throw new Error(`Unknown entity ${t}`);return{boneNames:Object.values(e.geometry).flatMap(i=>i.name)}}};globalThis.EntityMesh=Et;x();R();T();k();var Pe=n=>Math.max(0,Math.min(1,n)),Fs=(n,t,e)=>Math.max(t,Math.min(e,n)),tt=(n,t,e)=>n+(t-n)*e,H8=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function O8(n){let t=n?.elytra;if(!t)return;if(typeof t.updateRightWing=="function"){t.updateRightWing();return}if(typeof t.updateRightWingRotation=="function"){t.updateRightWingRotation();return}let e=t.leftWing,i=t.rightWing;!e?.rotation||!i?.rotation||typeof i.rotation.copy=="function"&&(i.rotation.copy(e.rotation),i.rotation.z*=-1)}var R1=class extends c1{constructor(){super(...arguments);u(this,"switchAnimationCallback");u(this,"isRunning",!1);u(this,"isMoving",!0);u(this,"isCrouched",!1);u(this,"moveAmount",0);u(this,"runAmount",0);u(this,"lookYaw",0);u(this,"lookPitch",0);u(this,"_dt",0);u(this,"_phase",0);u(this,"_idlePhase",0);u(this,"_moveBlend",0);u(this,"_runBlend",0);u(this,"_crouchBlend",0);u(this,"_lookYawBlend",0);u(this,"_lookPitchBlend",0);u(this,"_swingTime",null);u(this,"_swingDuration",.25);u(this,"_defaults",null)}update(e,i){this._dt=i,super.update(e,i)}swingArm(){this._swingTime=0}resetLocomotion(){this._moveBlend=0,this._runBlend=0,this._crouchBlend=0,this._phase=0}_captureDefaults(e){let i=e?.skin;this._defaults={playerRot:e?.rotation?.clone?.(),bodyPos:i?.body?.position?.clone?.(),bodyRot:i?.body?.rotation?.clone?.(),leftArmPos:i?.leftArm?.position?.clone?.(),leftArmRot:i?.leftArm?.rotation?.clone?.(),rightArmPos:i?.rightArm?.position?.clone?.(),rightArmRot:i?.rightArm?.rotation?.clone?.(),leftLegPos:i?.leftLeg?.position?.clone?.(),leftLegRot:i?.leftLeg?.rotation?.clone?.(),rightLegPos:i?.rightLeg?.position?.clone?.(),rightLegRot:i?.rightLeg?.rotation?.clone?.(),headPos:i?.head?.position?.clone?.(),headRot:i?.head?.rotation?.clone?.(),capePos:e?.cape?.position?.clone?.(),capeRot:e?.cape?.rotation?.clone?.(),elytraPos:e?.elytra?.position?.clone?.(),elytraRot:e?.elytra?.rotation?.clone?.()}}_applyDefaults(e){let i=this._defaults;if(!i)return;let r=e?.skin,s=e?.cape,o=e?.elytra;i.playerRot&&e?.rotation&&e.rotation.copy(i.playerRot),i.bodyPos&&r?.body?.position&&r.body.position.copy(i.bodyPos),i.bodyRot&&r?.body?.rotation&&r.body.rotation.copy(i.bodyRot),i.leftArmPos&&r?.leftArm?.position&&r.leftArm.position.copy(i.leftArmPos),i.leftArmRot&&r?.leftArm?.rotation&&r.leftArm.rotation.copy(i.leftArmRot),i.rightArmPos&&r?.rightArm?.position&&r.rightArm.position.copy(i.rightArmPos),i.rightArmRot&&r?.rightArm?.rotation&&r.rightArm.rotation.copy(i.rightArmRot),i.leftLegPos&&r?.leftLeg?.position&&r.leftLeg.position.copy(i.leftLegPos),i.leftLegRot&&r?.leftLeg?.rotation&&r.leftLeg.rotation.copy(i.leftLegRot),i.rightLegPos&&r?.rightLeg?.position&&r.rightLeg.position.copy(i.rightLegPos),i.rightLegRot&&r?.rightLeg?.rotation&&r.rightLeg.rotation.copy(i.rightLegRot),i.headPos&&r?.head?.position&&r.head.position.copy(i.headPos),i.headRot&&r?.head?.rotation&&r.head.rotation.copy(i.headRot),i.capePos&&s?.position&&s.position.copy(i.capePos),i.capeRot&&s?.rotation&&s.rotation.copy(i.capeRot),i.elytraPos&&o?.position&&o.position.copy(i.elytraPos),i.elytraRot&&o?.rotation&&o.rotation.copy(i.elytraRot)}animate(e){let i=this._dt||0;this._defaults||this._captureDefaults(e),this._applyDefaults(e);let r=typeof this.moveAmount=="number"?this.moveAmount:this.isMoving?1:0,s=typeof this.runAmount=="number"?this.runAmount:this.isRunning?1:0,o=Pe(r),a=Pe(s),v=this.isCrouched?1:0,l=Math.min(1,i*8),c=Math.min(1,i*6),d=Math.min(1,i*7);this._moveBlend+=(o-this._moveBlend)*l,this._runBlend+=(a-this._runBlend)*c,this._crouchBlend+=(v-this._crouchBlend)*d;let f=Pe(this._moveBlend),m=Pe(this._runBlend),g=Pe(this._crouchBlend),b=tt(8,10,m),A=tt(1,.55,g),_=b*A;this._phase+=i*_*f,this._phase+=i*_*f,this._idlePhase+=i*1.15;let w=this._phase+(m>.5?Math.PI*.5:0);if(this.switchAnimationCallback&&Math.abs(Math.sin(w))<.02){let O=this.switchAnimationCallback;this.switchAnimationCallback=null,O?.()}D8(e,g);let M=80*Math.PI/180,S=75*Math.PI/180,C=Fs(H8(this.lookYaw||0),-M,M),H=Fs(this.lookPitch||0,-S,S),B=Math.min(1,i*14);this._lookYawBlend+=(C-this._lookYawBlend)*B,this._lookPitchBlend+=(H-this._lookPitchBlend)*B,e?.skin?.head?.rotation&&(e.skin.head.rotation.y+=this._lookYawBlend,e.skin.head.rotation.x+=this._lookPitchBlend);let I=(1-f)*(1-.25*m);if(I>1e-4&&e?.skin){let N=Math.sin(this._idlePhase);e.skin.body.rotation.x+=N*.02*I,e.skin.head.rotation.x+=-N*.015*I,e.skin.leftArm.rotation.x+=N*.03*I,e.skin.rightArm.rotation.x+=-N*.03*I,e?.cape?.rotation&&(e.cape.rotation.x+=Math.sin(this._idlePhase*.7)*.03*I)}if(f>1e-4&&e?.skin){let N=tt(1,.85,g),O=tt(1,.7,g),j=Math.sin(w)*.5,q=Math.sin(w+Math.PI)*.5,$=Math.cos(w+Math.PI)*1.3,e0=Math.cos(w)*1.3;e.skin.leftLeg.rotation.x+=tt(j,$,m)*f*N,e.skin.rightLeg.rotation.x+=tt(q,e0,m)*f*N;let d0=Math.sin(w+Math.PI)*.5,l0=Math.sin(w)*.5,m0=Math.cos(w)*1.5,p0=Math.cos(w+Math.PI)*1.5;e.skin.leftArm.rotation.x+=tt(d0,m0,m)*f*O,e.skin.rightArm.rotation.x+=tt(l0,p0,m)*f*O;let w0=Math.PI*.02,n0=Math.PI*.1,Y=tt(w0,n0,m),o0=Math.cos(w)*.03+w0,g0=Math.cos(w+Math.PI)*.03-w0,L0=Math.cos(w)*.1+n0,H0=Math.cos(w+Math.PI)*.1-n0;e.skin.leftArm.rotation.z+=(tt(o0,L0,m)*f+Y*.15*f)*O,e.skin.rightArm.rotation.z+=(tt(g0,H0,m)*f-Y*.15*f)*O,this._defaults?.playerRot&&(e.rotation.z=this._defaults.playerRot.z+Math.cos(w+Math.PI)*.01*m*f);let X0=tt(Math.PI*.06,Math.PI*.3,m),u0=tt(Math.sin(w/1.5)*.06,Math.sin(w*2)*.1,m);e?.cape?.rotation&&(e.cape.rotation.x+=(X0+u0)*f)}if(this._swingTime!==null){this._swingTime+=i;let N=Math.min(this._swingTime/this._swingDuration,1);z8.animate(N,e,f>.2),N>=1&&(this._swingTime=null)}}},z8={animate(n,t,e){if(!t?.skin?.rightArm?.rotation)return;let i=n*18;if(t.skin.rightArm.rotation.x=-.4537860552*2+2*Math.sin(i+Math.PI)*.3,!e){let r=.01*Math.PI+.06;t.skin.rightArm.rotation.z=-Math.cos(i)*.403+r,t.skin.body.rotation.y=-Math.cos(i)*.06,t.skin.leftArm.rotation.x=Math.sin(i+Math.PI)*.077,t.skin.leftArm.rotation.z=-Math.cos(i)*.015+.13-.05,t.skin.leftArm.position.z=Math.cos(i)*.3,t.skin.leftArm.position.x=5-Math.cos(i)*.05}}};function D8(n,t){let e=n?.skin,i=n?.cape,r=n?.elytra;if(!e||!i)return;let s=Pe(t),o=Math.abs(Math.sin(s*Math.PI/2));if(o<=1e-6)return;e.body.rotation.x+=.4537860552*o,e.body.position.z+=(1.3256181-3.4500310377)*o,e.body.position.y+=-2.103677462*o,i.position.y+=-1.851236166577372*o,i.rotation.x+=.294220265771*o,i.position.z+=(3.786619432-3.4500310377)*o,r?.position&&r.position.copy(i.position),r?.rotation&&r.rotation.copy(i.rotation),r?.rotation&&(r.rotation.x-=10.8*Math.PI/180),r?.leftWing?.rotation&&(r.leftWing.rotation.z=tt(.72,.26179944+.4582006,o)),O8(n),e.head.position.y+=-3.618325234674*o;let a=.1*o,v=(3.618325234674-3.4500310377)*o,l=-2.53943318*o;e.leftArm.position.z+=v,e.rightArm.position.z+=v,e.leftArm.rotation.x+=.410367746202*o,e.rightArm.rotation.x+=.410367746202*o,e.leftArm.rotation.z+=a,e.rightArm.rotation.z+=-a,e.leftArm.position.y+=l,e.rightArm.position.y+=l,e.rightLeg.position.z+=-3.4500310377*o,e.leftLeg.position.z+=-3.4500310377*o}x();R();T();k();import{default as L8}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_1.png";import{default as U8}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_2.png";import{default as G8}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_1.png";import{default as N8}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_2.png";import{default as W8}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_1.png";import{default as V8}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_2.png";import{default as j8}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_1.png";import{default as Y8}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_2.png";import{default as Q8}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1.png";import{default as K8}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1_overlay.png";import{default as J8}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2.png";import{default as q8}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2_overlay.png";import{default as Z8}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_1.png";import{default as X8}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_2.png";import{default as $8}from"mc-assets/dist/other-textures/latest/models/armor/turtle_layer_1.png";import{default as Us}from"mc-assets/dist/other-textures/latest/entity/elytra.png";var It={skull:{bones:[{name:"head",pivot:[0,12,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0],inflate:1}]},{name:"overlay",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[32,0],inflate:1.2}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},head:{bones:[{name:"armor",pivot:[0,12,0]},{name:"head",parent:"armor",pivot:[0,12,0],cubes:[{origin:[-4,23,-4],size:[8,8,8],uv:[0,0],inflate:1}]},{name:"overlay",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,23,-4],size:[8,8,8],uv:[32,0],inflate:1.2}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},chest:{bones:[{name:"armor",pivot:[0,12,0]},{name:"body",parent:"armor",pivot:[0,13,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16],inflate:1}]},{name:"leftarm",parent:"armor",pivot:[5,10,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16],inflate:.85}]},{name:"rightarm",parent:"armor",pivot:[-5,10,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16],inflate:.85}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},legs:{bones:[{name:"armor",pivot:[0,12,0]},{name:"body",parent:"armor",pivot:[0,13,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16],inflate:.5}]},{name:"leftleg",parent:"armor",pivot:[1.9,1,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16],inflate:.5}]},{name:"rightleg",parent:"armor",pivot:[-1.9,1,0],cubes:[{origin:[-3.9,0,-2.01],size:[4,12,4],uv:[0,16],inflate:.5}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},feet:{bones:[{name:"armor",pivot:[0,12,0]},{name:"leftleg",parent:"armor",pivot:[1.9,1,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16],inflate:.8}]},{name:"rightleg",parent:"armor",pivot:[-1.9,1,0],cubes:[{origin:[-3.9,.01,-2.01],size:[4,12,4],uv:[0,16],inflate:.8}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32}};var Ls={leather_layer_1:Q8,leather_layer_1_overlay:K8,leather_layer_2:J8,leather_layer_2_overlay:q8,chainmail_layer_1:L8,chainmail_layer_2:U8,iron_layer_1:j8,iron_layer_2:Y8,diamond_layer_1:G8,diamond_layer_2:N8,golden_layer_1:W8,golden_layer_2:V8,netherite_layer_1:Z8,netherite_layer_2:X8,turtle_layer_1:$8};var A5=St(ut),t4=120,lr=n=>n*(Math.PI/180),cr=n=>Math.max(0,Math.min(1,n)),dr=(n,t,e)=>Math.max(t,Math.min(e,n)),Be=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function e4(n){return n<0&&(n=4294967295+n+1>>>0),n.toString(16)}function i4(n){if(n===void 0)return;if(parseInt(n,10)===0)return"rgba(0, 0, 0, 0)";let t=e4(parseInt(n,10));return t.length===8?`#${t.slice(2,8)}${t.slice(0,2)}`:`#${t}`}function Gs(n,t){return n===void 0?t:n instanceof W.Quaternion?n:Array.isArray(n)?new W.Quaternion(n[0],n[1],n[2],n[3]):new W.Quaternion(n.x,n.y,n.z,n.w)}function ft(n,t){return n===void 0?t??new W.Euler:n instanceof W.Euler?n:n.yaw!==void 0&&n.pitch!==void 0&&n.roll!==void 0?new W.Euler(-lr(n.pitch),-lr(n.yaw),lr(n.roll),"ZYX"):n.x!==void 0&&n.y!==void 0&&n.z!==void 0?new W.Euler(n.z,n.y,n.x,"ZYX"):Array.isArray(n)?new W.Euler(n[0],n[1],n[2]):t??new W.Euler}var k1=Math.PI*2;function Ns(n,t){let e=((t-n)%k1+k1)%k1;return e>Math.PI?e-k1:e}function Ys({username:n,nameTagBackgroundColor:t="rgba(0, 0, 0, 0.3)",nameTagTextOpacity:e=255},{fontFamily:i="mojangles"},r){let s=W0(64,64),o=js(r),a=s.getContext("2d");if(!a)throw new Error("Could not get 2d context");let v=48,l=5;a.font=`${v}px ${i}`;let c=String(typeof n=="string"?n:new o(n).toString()).split(`
|
|
21186
|
-
`),d=0;for(let m of c){let g=a.measureText(m).width+l*2;g>d&&(d=g)}if(s.width=d,s.height=(v+l)*c.length,a.fillStyle=t,a.fillRect(0,0,s.width,s.height),a.globalAlpha=e/255,!!fi(n,o,s,v,"white",-l+v))return a.globalAlpha=1,s}globalThis.getUsernameTexture=Ys;var M1=(n,t,e,i)=>{for(let v of e.children)v.name==="nametag"&&v.removeFromParent();if(n.username===void 0||n.username===null||(typeof n.username=="string"?n.username:new(js(i))(n.username).toString()).startsWith("EMPTY"))return;let s=Ys(n,t,i);if(!s)return;let o=new W.Texture(s);o.needsUpdate=!0;let a;if(n.nameTagFixed){let v=new W.PlaneGeometry,l=new W.MeshBasicMaterial({map:o});l.transparent=!0,a=new W.Mesh(v,l),a.rotation.set(n.pitch,W.MathUtils.degToRad(n.yaw+180),0),a.position.y+=n.height+.3}else{let v=new W.SpriteMaterial({map:o});a=new W.Sprite(v),a.position.y+=n.height+.6}return a.renderOrder=1e3,a.scale.set(s.width*.005,s.height*.005,1),n.nameTagRotationRight&&a.applyQuaternion(n.nameTagRotationRight),n.nameTagScale&&a.scale.multiply(n.nameTagScale),n.nameTagRotationLeft&&a.applyQuaternion(n.nameTagRotationLeft),n.nameTagTranslation&&a.position.add(n.nameTagTranslation),a.name="nametag",e.add(a),a},Ws={},r4=n=>n.charAt(0)===n.charAt(0).toUpperCase();function n4(n,t,e,i,r){if(t.name)try{let l=(r4(t.name)?Yi(t.name):t.name).toLowerCase(),c=new Et("1.16.4",l,e,r);if(c.mesh)return M1(t,i,c.mesh,e.version),c.mesh}catch(l){reportError?.(l)}if(!n||!(0,Vs.isEntityAttackable)(n,t))return;let s=new W.BoxGeometry(t.width,t.height,t.width);s.translate(0,t.height/2,0);let o=new W.MeshBasicMaterial({color:16711935}),a=new W.Mesh(s,o);return(Ws[t.name]=(Ws[t.name]||0)+1)<6&&M1({username:t.name,height:t.height},i,a,e.version),a}var S1=class{constructor(t,e){this.worldRenderer=t;this.mcData=e;u(this,"entities",{});u(this,"playerEntity",null);u(this,"entitiesOptions",{fontFamily:"mojangles"});u(this,"debugMode");u(this,"onSkinUpdate");u(this,"clock",new W.Clock);u(this,"currentlyRendering",!0);u(this,"cachedMapsImages",{});u(this,"itemFrameMaps",{});u(this,"pendingModelOverrides",new Map);u(this,"motionCache",new Map);u(this,"_wasThirdPerson",!1);u(this,"_tpBodyYaw",0);u(this,"_tpHasBodyYaw",!1);u(this,"uuidPerSkinUrlsCache",{});u(this,"currentSkinUrls",{});u(this,"loadedSkinEntityIds",new Set);u(this,"playerPerAnimation",{});this.debugMode="none",this.onSkinUpdate=()=>{},this.watchResourcesUpdates()}updateAutoWalkFlags(t,e,i,r){if(!e.playerObject?.animation)return;let s=e.playerObject.animation;if(i<=0)return;let o=r??e.position,a=this.motionCache.get(t);if(!a){this.motionCache.set(t,{pos:o.clone(),speed:0}),s.isMoving=!1,s.isRunning=!1,s.moveAmount=0,s.runAmount=0;return}let v=o.x-a.pos.x,l=o.z-a.pos.z;a.pos.copy(o);let c=Math.hypot(v,l)/Math.max(i,1e-6),d=1-Math.exp(-i*12);a.speed+=(c-a.speed)*d;let f=a.speed,m=(S,C,H)=>{let B=cr((H-S)/(C-S));return B*B*(3-2*B)},g=.08,b=.6,A=4.3,_=5.6,w=m(g,b,f),M=m(A,_,f);s.moveAmount=w,s.runAmount=M,s.isMoving=w>.15,s.isRunning=M>.55}getLocalSneak(){let t=this.worldRenderer.playerStateReactive;return t?.movementState==="SNEAKING"||t?.movementState==="CROUCHING"||!!t?.isSneaking||!!t?.sneaking||!!t?.isCrouching||!!t?.crouching||!!t?.controls?.sneak||!!t?.controlState?.sneak}updateThirdPersonHeadAndBody(t,e){let i=t.playerObject?.animation,r=this.worldRenderer.cameraShake.getBaseRotation(),s=r.yaw,o=r.pitch,a=cr(i?.moveAmount??(i?.isMoving?1:0)),v=cr(i?.runAmount??(i?.isRunning?1:0)),l=a>.15;if(this._tpHasBodyYaw||(this._tpHasBodyYaw=!0,this._tpBodyYaw=s),l){let g=1-Math.exp(-e*(18+10*v));this._tpBodyYaw=this._tpBodyYaw+Be(s-this._tpBodyYaw)*g,t.rotation.set(0,this._tpBodyYaw,0);let b=(25-8*v)*Math.PI/180,A=dr(Be(s-this._tpBodyYaw),-b,b);i&&"lookYaw"in i&&(i.lookYaw=A),i&&"lookPitch"in i&&(i.lookPitch=-o);return}let c=85*Math.PI/180,d=55*Math.PI/180,f=Be(s-this._tpBodyYaw);f=dr(f,-c,c);let m=Math.abs(f)-d;if(m>0){let g=m/(c-d),b=s-Math.sign(f)*d,A=1-Math.exp(-e*(6+10*g));this._tpBodyYaw=this._tpBodyYaw+Be(b-this._tpBodyYaw)*A,f=Be(s-this._tpBodyYaw),f=dr(f,-c,c)}else{let g=1-Math.exp(-e*5);this._tpBodyYaw=this._tpBodyYaw+Be(s-this._tpBodyYaw)*(g*.15)}t.rotation.set(0,this._tpBodyYaw,0),i&&"lookYaw"in i&&(i.lookYaw=f),i&&"lookPitch"in i&&(i.lookPitch=-o)}get entitiesByName(){let t={};for(let e of Object.values(this.entities))e.realName&&(t[e.realName]=t[e.realName]||[],t[e.realName].push(e));return t}get entitiesRenderingCount(){return Object.values(this.entities).filter(t=>t.visible).length}getDebugString(){let t=Object.keys(this.entities).length,e=this.entitiesRenderingCount,i=Object.values(this.entities).filter(s=>s.playerObject),r=i.filter(s=>s.visible);return`${e}/${t} ${r.length}/${i.length}`}handlePlayerEntity(t){if(!this.playerEntity){let e=new W.Group;e.originalEntity={...t,name:"player"};let i=new W.Group,r=this.setupPlayerObject(t,i,{});e.playerObject=r,e.add(i),e.name="player_entity",this.playerEntity=e,this.worldRenderer.scene.add(e),this.updatePlayerSkin(t.id,t.username,t.uuid??void 0,ut)}this.playerEntity.originalEntity={...t,name:"player"},t.position&&(this.worldRenderer.sceneOrigin.getWorldPosition(this.playerEntity)||this.worldRenderer.sceneOrigin.track(this.playerEntity),this.playerEntity.position.set(t.position.x,t.position.y,t.position.z)),t.yaw!==void 0&&(this.playerEntity.rotation.y=t.yaw),this.updateEntityEquipment(this.playerEntity,t)}clear(){for(let t of Object.values(this.entities))this.worldRenderer.sceneOrigin.removeAndUntrack(t),R0(t);this.entities={},this.currentSkinUrls={},this.motionCache.clear(),this._wasThirdPerson=!1,this._tpHasBodyYaw=!1,this.playerEntity&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.playerEntity),R0(this.playerEntity),this.playerEntity=null)}reloadEntities(){for(let t of Object.values(this.entities))this.update({...t.originalEntity,delete:!0},{}),this.update(t.originalEntity,{})}watchResourcesUpdates(){this.worldRenderer.resourcesManager.on("assetsTexturesUpdated",()=>this.reloadEntities()),this.worldRenderer.resourcesManager.on("assetsInventoryReady",()=>this.reloadEntities())}setDebugMode(t,e=null){this.debugMode=t;for(let i of e?[e]:Object.values(this.entities)){let r=i.children.find(s=>s.name==="debug");r.visible=!1,this.debugMode==="basic"&&(r.visible=!0)}}setRendering(t,e=null){this.currentlyRendering=t;for(let i of e?[e]:Object.values(this.entities))t?this.worldRenderer.scene.children.includes(i)||this.worldRenderer.scene.add(i):this.worldRenderer.scene.remove(i)}playEntityModelAnimation(t,e,i=!1){let r=this.entities[t];r&&r.traverse(s=>{s instanceof Et&&s.playAnimation(e,i)})}render(){let t=this.worldRenderer.worldRendererConfig.renderEntities;t!==this.currentlyRendering&&this.setRendering(t);let e=this.clock.getDelta(),i=Math.min(e,1/30),r=this.worldRenderer.viewerChunkPosition,s=10*10,o=this.worldRenderer.playerStateUtils.isThirdPerson();if(o!==this._wasThirdPerson){this._wasThirdPerson=o;let a=String(this.playerEntity?.originalEntity.id??"player_entity");this.motionCache.delete(a);let v=this.playerEntity?.playerObject?.animation;v?.resetLocomotion&&v.resetLocomotion(),this._tpHasBodyYaw=!1}for(let[a,v]of[...Object.entries(this.entities),["player_entity",this.playerEntity]]){if(!v)continue;let l=a==="player_entity",c=String(l?this.playerEntity?.originalEntity.id??"player_entity":a);if(l)if(v.visible=o,o){let f=this.worldRenderer.playerStateReactive.eyeHeight;v.position.set(this.worldRenderer.cameraWorldPos.x,this.worldRenderer.cameraWorldPos.y-f,this.worldRenderer.cameraWorldPos.z);let m=this.worldRenderer.playerStateReactive.position;if(m&&typeof m.x=="number")this.updateAutoWalkFlags(c,v,e,new W.Vector3(m.x,m.y,m.z));else{let g=this.worldRenderer.sceneOrigin.getWorldPosition(v);this.updateAutoWalkFlags(c,v,e,g?new W.Vector3(g.x,g.y,g.z):v.position)}this.updateThirdPersonHeadAndBody(v,i)}else{let f=this.worldRenderer.sceneOrigin.getWorldPosition(v);this.updateAutoWalkFlags(c,v,e,f?new W.Vector3(f.x,f.y,f.z):v.position)}else{let f=this.worldRenderer.sceneOrigin.getWorldPosition(v);this.updateAutoWalkFlags(c,v,e,f?new W.Vector3(f.x,f.y,f.z):v.position)}let{playerObject:d}=v;if(d?.animation){let f=d.animation,g=(Number(v.originalEntity?.metadata?.[0]??0)&2)!==0,b=this.getLocalSneak();"isCrouched"in f&&(f.isCrouched=l?b:g),d.animation.update(d,i)}if(v.traverse(f=>{f instanceof Et&&f.update(i)}),!l&&r&&v.position){let f=v.position.x-r.x,m=v.position.y-r.y,g=v.position.z-r.z,b=f*f+m*m+g*g;v.visible=!!(b<s||this.worldRenderer.shouldObjectVisible(v)),this.maybeRenderPlayerSkin(a)}v.visible&&this.syncArmorPositions(v)}}syncArmorPositions(t){t.playerObject&&t.traverse(e=>{if(!e.name.startsWith("geometry_armor_"))return;let{skin:i}=t.playerObject;switch(e.name){case"geometry_armor_head":e.children[0]?.children[0]&&e.children[0].children[0].rotation.set(-i.head.rotation.x,i.head.rotation.y,i.head.rotation.z,i.head.rotation.order);break;case"geometry_armor_legs":e.children[0]&&(e.children[0].children[2]&&e.children[0].children[2].rotation.set(-i.leftLeg.rotation.x,i.leftLeg.rotation.y,i.leftLeg.rotation.z,i.leftLeg.rotation.order),e.children[0].children[1]&&e.children[0].children[1].rotation.set(-i.rightLeg.rotation.x,i.rightLeg.rotation.y,i.rightLeg.rotation.z,i.rightLeg.rotation.order));break;case"geometry_armor_feet":e.children[0]&&(e.children[0].children[0]&&e.children[0].children[0].rotation.set(-i.rightLeg.rotation.x,i.rightLeg.rotation.y,i.rightLeg.rotation.z,i.rightLeg.rotation.order),e.children[0].children[1]&&e.children[0].children[1].rotation.set(-i.leftLeg.rotation.x,i.leftLeg.rotation.y,-i.leftLeg.rotation.z,i.leftLeg.rotation.order));break}})}getPlayerObject(t){return this.playerEntity?.originalEntity.id===t?this.playerEntity?.playerObject:this.entities[t]?.playerObject}isCanvasBlank(t){return!t.getContext("2d")?.getImageData(0,0,t.width,t.height).data.some(e=>e!==0)}async updatePlayerSkin(t,e,i,r,s=void 0){r!==ut&&this.loadedSkinEntityIds.add(String(t)),i&&((typeof r=="string"||typeof s=="string")&&(this.uuidPerSkinUrlsCache[i]={}),typeof r=="string"&&(this.uuidPerSkinUrlsCache[i].skinUrl=r),typeof s=="string"&&(this.uuidPerSkinUrlsCache[i].capeUrl=s),r===!0&&(r=this.uuidPerSkinUrlsCache[i]?.skinUrl??r),s??(s=this.uuidPerSkinUrlsCache[i]?.capeUrl));let a=this.getPlayerObject(t);if(!a)return;if(r===!0){if(!e)return;let l=await Ct(e,"skin");if(!this.getPlayerObject(t)||!l)return;r=l}if(typeof r!="string")throw new Error("Invalid skin url");if(this.currentSkinUrls[String(t)]===r){if(s){if(s===!0&&e){let l=await Ct(e,"cape");if(!this.getPlayerObject(t)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(t,s)}return}r!==ut&&(this.currentSkinUrls[String(t)]=r);let v=this.worldRenderer.worldRendererConfig.renderEars||e==="deadmau5";this.loadAndApplySkin(t,r,v).then(async()=>{if(s){if(s===!0&&e){let l=await Ct(e,"cape");if(!this.getPlayerObject(t)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(t,s)}}),a.cape.visible=!1,s||(a.backEquipment=null,a.elytra.map=null,a.cape.map&&a.cape.map.dispose(),a.cape.map=null)}async loadAndApplySkin(t,e,i){let r=this.getPlayerObject(t);if(r)try{let s;if(r=this.getPlayerObject(t),!r)return;let o,a;if(e===ut){o=await A5;let l=W0(64,64),c=l.getContext("2d");if(!c)throw new Error("Failed to get context");c.drawImage(o.image,0,0),a=l}else{let{canvas:l,image:c}=await Zt(e);s=c,o=new W.CanvasTexture(l),a=l}o.magFilter=W.NearestFilter,o.minFilter=W.NearestFilter,o.needsUpdate=!0,r.skin.map=o,r.skin.modelType=Ri(a),r.skin.isCustom=e!==ut;let v;if(s?i&&(v=document.createElement("canvas"),ki(v,s),i=!this.isCanvasBlank(v)):i=!1,i){let l=new W.CanvasTexture(v);l.magFilter=W.NearestFilter,l.minFilter=W.NearestFilter,l.needsUpdate=!0,r.ears.map=l,r.ears.visible=!0}else r.ears.map=null,r.ears.visible=!1;this.onSkinUpdate?.()}catch{}}async loadAndApplyCape(t,e){let i=this.getPlayerObject(t);if(i)try{let{canvas:r,image:s}=await Zt(e);if(i=this.getPlayerObject(t),!i)return;xi(r,s);let o=new W.CanvasTexture(r);o.magFilter=W.NearestFilter,o.minFilter=W.NearestFilter,o.needsUpdate=!0,i.cape.map=o,i.cape.visible=!0,i.elytra.map=o,this.onSkinUpdate?.(),i.backEquipment||(i.backEquipment="cape")}catch{}}debugSwingArm(){let t=Object.values(this.entities).find(i=>i.playerObject?.animation);if(!t||!t.playerObject?.animation)return;let e=t.playerObject.animation;e.swingArm&&e.swingArm()}playAnimation(t,e){let i=String(t);if(this.playerPerAnimation[i]===e)return;if(this.playerPerAnimation[i]=e,t==="player_entity"&&this.playerEntity?.playerObject){let{playerObject:s}=this.playerEntity;if(e==="oneSwing"){s.animation&&s.animation.swingArm&&s.animation.swingArm();return}s.animation&&s.animation.switchAnimationCallback!==void 0&&(s.animation.switchAnimationCallback=()=>{let o=s.animation;o&&(o.isMoving=e==="walking"||e==="running"||e==="crouchWalking",o.isRunning=e==="running",o.isCrouched=e==="crouch"||e==="crouchWalking")});return}let r=this.getPlayerObject(t);if(r){if(e==="oneSwing"){r.animation&&r.animation.swingArm&&r.animation.swingArm();return}r.animation&&r.animation.switchAnimationCallback!==void 0&&(r.animation.switchAnimationCallback=()=>{let s=r.animation;s&&(s.isMoving=e==="walking"||e==="running"||e==="crouchWalking",s.isRunning=e==="running",s.isCrouched=e==="crouch"||e==="crouchWalking")});return}if(this.playerEntity?.playerObject){let{playerObject:s}=this.playerEntity;if(e==="oneSwing"){s.animation&&s.animation.swingArm&&s.animation.swingArm();return}s.animation&&s.animation.switchAnimationCallback!==void 0&&(s.animation.switchAnimationCallback=()=>{let o=s.animation;o&&(o.isMoving=e==="walking"||e==="running"||e==="crouchWalking",o.isRunning=e==="running",o.isCrouched=e==="crouch"||e==="crouchWalking")})}}parseEntityLabel(t){if(t)try{if(t.type==="string")return t.value;let e=typeof t=="string"?_5.default.simplify(_5.default.parse(t)):fr.simplify(t);return Ni(e).map(this.textFromComponent).join("")}catch{return t}}textFromComponent(t){return typeof t=="string"?t:t.text??""}getItemMesh(t,e,i=!1,r){!t.nbt&&t.nbtData&&(t.nbt=t.nbtData);let s=this.worldRenderer.getItemRenderData(t,e);if(!(r&&r===s?.modelName)){if(s&&"resolvedModel"in s){let o=S3(this.worldRenderer.material,s.resolvedModel,s.modelName,this.worldRenderer.resourcesManager.currentResources.worldBlockProvider,this.worldRenderer.resourcesManager.currentResources.mcData),a=1;e["minecraft:display_context"]==="ground"?a=.5:e["minecraft:display_context"]==="thirdperson"&&(a=6),o.scale.set(a,a,a);let v=new W.Group;return v.add(o),{mesh:v,isBlock:!0,modelName:s.modelName}}if(s){let o=s.renderInfo?.texture==="blocks"?this.worldRenderer.material.map:this.worldRenderer.itemsTexture,{u:a,v,su:l,sv:c}=s,m=C3(o,{u:a,v,sizeX:l??1,sizeY:c??1},{faceCamera:i,use3D:!i}),g=1;return e["minecraft:display_context"]==="ground"?g=.5:e["minecraft:display_context"]==="thirdperson"&&(g=6),m.mesh.scale.set(g,g,g),{mesh:m.mesh,isBlock:!1,modelName:s.modelName,cleanup:m.cleanup}}}}setVisible(t,e){e?t.scale.set(1,1,1):t.scale.set(0,0,0)}update(t,e){let i=t.name==="player";(t.name==="zombie_villager"||t.name==="husk")&&(e.texture=`textures/1.16.4/entity/${t.name==="zombie_villager"?"zombie_villager/zombie_villager.png":`zombie/${t.name}.png`}`),t.name==="glow_item_frame"&&(e.textures||(e.textures=[]),e.textures.background="block:glow_item_frame");let r=this.entities[t.id],s=!r;if(t.delete){if(!r)return;r.userData._posTween?.stop(),r.additionalCleanup&&r.additionalCleanup(),r.traverse(m=>{m.additionalCleanup&&m.additionalCleanup()}),this.onRemoveEntity(t),this.worldRenderer.sceneOrigin.removeAndUntrack(r),R0(r),delete this.entities[t.id];return}let o;if(r===void 0){this.beforeEntityAdded(t);let m=new W.Group;if(m.originalEntity=t,t.name==="item"||t.name==="tnt"||t.name==="falling_block"||t.name==="snowball"||t.name==="egg"||t.name==="ender_pearl"||t.name==="experience_bottle"||t.name==="splash_potion"||t.name==="lingering_potion"){let A=t.name==="tnt"||t.type==="projectile"?{name:t.name}:t.name==="falling_block"?{blockState:t.objectData}:t.metadata?.find(_=>typeof _=="object"&&_?.itemCount);if(A){let _=this.getItemMesh(A,{"minecraft:display_context":"ground"},t.type==="projectile");if(_){if(o=_.mesh,t.name==="item"||t.type==="projectile"?(o.scale.set(.5,.5,.5),o.position.set(0,t.name==="item"?.2:.1,0)):(o.scale.set(2,2,2),o.position.set(0,.5,0)),t.name==="item"){let w=new W.Clock;o.onBeforeRender=()=>{let M=w.getDelta();o.rotation.y+=M}}m.additionalCleanup=()=>{_.cleanup&&_.cleanup()}}}}else if(i){let A=new W.Group,_=this.setupPlayerObject(t,A,e);if(m.playerObject=_,o=A,t.username){let w=M1(t,{fontFamily:"mojangles"},A,this.worldRenderer.version);w&&(w.position.y=_.position.y+_.scale.y*16+3,w.scale.multiplyScalar(12))}}else o=n4(this.mcData,t,this.worldRenderer,this.entitiesOptions,{...e,customModel:t.customModel});if(!o)return;o.name="mesh";let g=t.pos??t.position;this.worldRenderer.sceneOrigin.track(m),m.position.set(g.x,g.y,g.z);let b=new W.BoxHelper(o,t.type==="hostile"?16711680:t.type==="mob"?65280:t.type==="player"?255:16753920);b.name="debug",m.add(o),m.add(b),b.visible=!1,this.worldRenderer.scene.add(m),r=m,r.name="entity",r.realName=t.name,this.entities[t.id]=r,i&&this.updatePlayerSkin(t.id,t.username,e?.texture?t.uuid:void 0,e?.texture||ut),this.setDebugMode(this.debugMode,m),this.setRendering(this.currentlyRendering,m),this.afterAddEntity(t)}else o=r.children.find(m=>m.name==="mesh");this.updateEntityEquipment(r,t);let a=Qs(t,this.mcData),v=(t.metadata?.[0]??0)&32||this.worldRenderer.playerStateReactive.cameraSpectatingEntity===t.id&&this.worldRenderer.playerStateUtils.isSpectator();for(let m of o.children??[])m.name!=="nametag"&&(m.visible=!v);a.baby?r.scale.set(.5,.5,.5):r.scale.set(1,1,1);let l=T1("text_display",t,this.mcData),c=l?.text||a.custom_name_visible&&a.custom_name;if(t.name!=="player"&&c){let m=l&&(l.billboard_render_constraints==="fixed"||!l.billboard_render_constraints),g=l&&!(parseInt(l.style_flags,10)&4)?i4(l.background_color):void 0,b;if(l?.text_opacity){let A=parseInt(l?.text_opacity,10);b=A>0?A:256-A}M1({...t,username:typeof c=="string"?_5.default.simplify(_5.default.parse(c)):fr.simplify(c),nameTagBackgroundColor:g,nameTagTextOpacity:b,nameTagFixed:m,nameTagScale:l?.scale,nameTagTranslation:l&&(l.translation||new W.Vector3(0,0,0)),nameTagRotationLeft:Gs(l?.left_rotation),nameTagRotationRight:Gs(l?.right_rotation)},this.entitiesOptions,o,this.worldRenderer.version)}let d=T1("armor_stand",t,this.mcData);if(d){let m=(parseInt(d.client_flags,10)&1)!==0,g=(parseInt(d.client_flags,10)&4)!==0,b=(parseInt(d.client_flags,10)&8)===0,A=(parseInt(d.client_flags,10)&16)!==0;o.castShadow=!A,o.receiveShadow=!A,m?r.scale.set(.5,.5,.5):r.scale.set(1,1,1),r.traverse(_=>{switch(_.name){case"bone_baseplate":this.setVisible(_,b),_.rotation.y=-r.rotation.y;break;case"bone_head":d.head_pose&&_.setRotationFromEuler(ft(d.head_pose));break;case"bone_body":d.body_pose&&_.setRotationFromEuler(ft(d.body_pose));break;case"bone_rightarm":_.parent?.name!=="bone_armor"&&this.setVisible(_,g),d.left_arm_pose?_.setRotationFromEuler(ft(d.left_arm_pose)):_.setRotationFromEuler(ft({yaw:-10,pitch:-10,roll:0}));break;case"bone_leftarm":_.parent?.name!=="bone_armor"&&this.setVisible(_,g),d.right_arm_pose?_.setRotationFromEuler(ft(d.right_arm_pose)):_.setRotationFromEuler(ft({yaw:10,pitch:-10,roll:0}));break;case"bone_rightleg":d.left_leg_pose?_.setRotationFromEuler(ft(d.left_leg_pose)):_.setRotationFromEuler(ft({yaw:-1,pitch:-1,roll:0}));break;case"bone_leftleg":d.right_leg_pose?_.setRotationFromEuler(ft(d.right_leg_pose)):_.setRotationFromEuler(ft({yaw:1,pitch:1,roll:0}));break}})}let f=T1("item_frame",t,this.mcData);if(f||(f=T1("glow_item_frame",t,this.mcData)),f){let m=f?.item??t.metadata?.[8];if(o.scale.set(1,1,1),o.position.set(0,0,-.5),r.rotation.x=-t.pitch,r.children.find(g=>{if(g.name.startsWith("map_")){R0(g);let b=parseInt(g.name.split("_")[1],10);return this.itemFrameMaps[b]=this.itemFrameMaps[b]?.filter(A=>A!==g),g instanceof W.Mesh&&g.material?.map?.dispose(),!0}else if(g.name==="item")return R0(g),!0;return!1})?.removeFromParent(),m&&(m.itemId??m.blockId??0)!==0){let g=f.rotation??0,b=m.nbtData?.value?.map?.value??m.components?.find(A=>A.type==="map_id")?.data;if(b)o.scale.set(16/12,16/12,1),this.addMapModel(r,b,g);else{let A=this.getItemMesh(m,{"minecraft:display_context":"fixed"});A&&(A.mesh.position.set(0,0,-.05),A.isBlock?A.mesh.scale.set(.25,.25,.25):A.mesh.scale.set(.5,.5,.5),A.mesh.rotateY(Math.PI),A.mesh.rotateZ(-g*Math.PI/4),A.mesh.name="item",r.add(A.mesh))}}}t.username!==void 0&&(r.username=t.username),this.updateNameTagVisibility(r),this.updateEntityPosition(t,s,e)}updateEntityPosition(t,e,i){let r=this.entities[t.id];if(!r)return;let s=e?0:t4;if(t.position){let o=this.worldRenderer.sceneOrigin.getWorldPosition(r)??{x:t.position.x,y:t.position.y,z:t.position.z};r.userData._tweenTarget||(r.userData._tweenTarget={x:o.x,y:o.y,z:o.z}),r.userData._posTween?.stop(),r.userData._posTween=new O0(r.userData._tweenTarget).to({x:t.position.x,y:t.position.y,z:t.position.z},s).onUpdate(()=>{r.position.set(r.userData._tweenTarget.x,r.userData._tweenTarget.y,r.userData._tweenTarget.z)}).start()}if(typeof t.yaw=="number"&&Number.isFinite(t.yaw)){let o=Ns(r.rotation.y,t.yaw);new O0(r.rotation).to({y:r.rotation.y+o},s).start()}if(r?.playerObject&&i?.rotation?.head){let{playerObject:o}=r,a=i.rotation.head.y,v=typeof a=="number"&&Number.isFinite(a)?a:t.yaw,l=typeof v=="number"&&typeof t.yaw=="number"&&Number.isFinite(v)&&Number.isFinite(t.yaw)?Ns(t.yaw,v):0;o.skin.head.rotation.y=l;let c=i.rotation.head.x;o.skin.head.rotation.x=typeof c=="number"&&Number.isFinite(c)?-c:0}}afterAddEntity(t){}beforeEntityAdded(t){let e=this.pendingModelOverrides.get(t.id.toString());if(e){let{parts:i}=e;t.customModel=i.length===1?i[0]:{parts:i},this.pendingModelOverrides.delete(t.id.toString())}}maybeRenderPlayerSkin(t){let e=this.entities[t];if(t==="player_entity"&&(e=this.playerEntity,t=this.playerEntity?.originalEntity.id),!e||!e.playerObject||!e.visible)return;let i=128,r=this.worldRenderer.getCameraPosition(),s=this.worldRenderer.sceneOrigin.getWorldPosition(e),a=(s?new W.Vector3(s.x,s.y,s.z):e.position.clone().add(new W.Vector3(this.worldRenderer.sceneOrigin.x,this.worldRenderer.sceneOrigin.y,this.worldRenderer.sceneOrigin.z))).distanceTo(r);if(a<i&&a<this.worldRenderer.viewDistance*16){if(this.loadedSkinEntityIds.has(String(t)))return;this.updatePlayerSkin(t,e.playerObject.realUsername,e.playerObject.realPlayerUuid,!0,!0)}}onRemoveEntity(t){this.loadedSkinEntityIds.delete(t.id.toString()),delete this.currentSkinUrls[t.id.toString()],this.motionCache.delete(t.id.toString())}updateMap(t,e){this.cachedMapsImages[t]=e;let i=this.itemFrameMaps[t];if(i&&(i=i.filter(r=>r.parent),this.itemFrameMaps[t]=i,i))for(let r of i)r.material.map=this.loadMap(e),r.material.needsUpdate=!0,r.visible=!0}updateNameTagVisibility(t){let e=this.worldRenderer.playerStateReactive.team,i=t.originalEntity.team,r=i?.nameTagVisibility||"always",s=r==="always"||r==="hideForOwnTeam"&&i?.team!==e?.team||r==="hideForOtherTeams"&&(i?.team===e?.team||e===void 0);t.traverse(o=>{o.name==="nametag"&&(o.visible=s)})}addMapModel(t,e,i){let r=this.cachedMapsImages?.[e],s=null;r&&(s=this.loadMap(r));let o={transparent:!0,alphaTest:.1};s&&(o.map=s);let a=new W.MeshLambertMaterial(o),v=new W.Mesh(new W.PlaneGeometry(1,1),a);v.rotation.set(0,Math.PI,0),t.add(v);let l=!0;t.traverseVisible(c=>{c.name==="geometry_frame"&&(l=!1)}),l?v.position.set(0,0,.499):v.position.set(0,0,.437),v.rotateZ(Math.PI*2-i*Math.PI/2),v.name=`map_${e}`,s||(v.visible=!1),this.itemFrameMaps[e]||(this.itemFrameMaps[e]=[]),this.itemFrameMaps[e].push(v)}loadMap(t){let e=new W.TextureLoader().load(t);return e&&(e.magFilter=W.NearestFilter,e.minFilter=W.NearestFilter,e.needsUpdate=!0),e}addItemModel(t,e,i,r=!1){let s=`bone_${e}item`,o=`custom_item_${e}`;if(t.traverse(v=>{v.name===o&&(v.removeFromParent(),v.additionalCleanup&&v.additionalCleanup())}),!i)return;let a=this.getItemMesh(i,{"minecraft:display_context":"thirdperson"});a?.mesh&&t.traverse(v=>{if(v.name.toLowerCase()===s||v.name===`${e}Arm`){let l=new W.Object3D;l.additionalCleanup=()=>{a.cleanup&&a.cleanup()};let c=a.mesh;l.rotation.z=-Math.PI/16,a.isBlock?l.rotation.y=Math.PI/4:(c.rotation.z=-Math.PI/4,l.rotation.y=Math.PI/2,l.scale.multiplyScalar(2)),r&&(l.position.y=-8,l.position.z=5,l.position.x=e==="left"?1:-1,l.rotation.x=Math.PI),l.add(c),l.name=o,v.add(l)}})}handleDamageEvent(t,e){let i=this.entities[t]?.children.find(r=>r.name==="mesh");i&&i.traverse(r=>{if(r instanceof W.Mesh&&r.material.clone){r.material.clone().dispose(),r.material=r.material.clone();let o=r.material.color.clone();r.material.color.set(16711680),new O0(r.material.color).to(o,500).start()}})}raycastSceneDebug(){let t=new W.Raycaster;return t.setFromCamera(new W.Vector2(0,0),this.worldRenderer.camera),t.intersectObjects(this.worldRenderer.scene.children)[0]?.object}updateEntityModel(t,e,i,r){let s=Array.isArray(e)?e:[{modelPath:e,modelType:i,metadata:r}];this.pendingModelOverrides.set(t,{parts:s});let o=this.entities[t];o&&(this.update({...o.originalEntity,delete:!0},{}),this.update(o.originalEntity,{}))}setupPlayerObject(t,e,i){let r=new l5;r.realPlayerUuid=t.uuid??"",r.realUsername=t.username??"",r.position.set(0,16,0),r.traverse(o=>{o instanceof W.Mesh&&o.material instanceof W.MeshStandardMaterial&&(o.material.transparent=!0)}),e.add(r);let s=1/16;return e.scale.set(s,s,s),e.rotation.set(0,Math.PI,0),r.animation=new R1,r.animation.isMoving=!1,r}updateEntityEquipment(t,e){if(!t||!e.equipment)return;let i=e.type==="player";if(this.addItemModel(t,i?"right":"left",e.equipment[0],i),this.addItemModel(t,i?"left":"right",e.equipment[1],i),w5(this.worldRenderer,t,"feet",e.equipment[2]),w5(this.worldRenderer,t,"legs",e.equipment[3],2),w5(this.worldRenderer,t,"chest",e.equipment[4]),w5(this.worldRenderer,t,"head",e.equipment[5]),i&&t.playerObject){let{playerObject:r}=t;r.backEquipment=e.equipment.some(s=>s?.name==="elytra")?"elytra":"cape",r.backEquipment==="elytra"&&this.loadAndApplyCape(e.id,Us),r.cape.map===null&&(r.cape.visible=!1)}}};function Qs(n,t){let e=t?.entitiesByName[n.name];return new Proxy({},{get(i,r,s){if(typeof r!="string"||!e)return;let o=e.metadataKeys?.indexOf(r);return n.metadata?.[o??-1]}})}function T1(n,t,e){if(t.name===n)return Qs(t,e)}function w5(n,t,e,i,r=1,s=!1){if(!i){ur(t,e);return}let o=i.name.split("_"),a,v=e==="head"&&i.name==="player_head";if(v)if(ur(t,e),i.nbt){let g=fr.simplify(i.nbt);try{let b;if(g.SkullOwner?b=g.SkullOwner.Properties.textures[0]?.Value:b=g["minecraft:profile"]?.Properties?.find(A=>A.name==="textures")?.value,b){a=JSON.parse(F.from(b,"base64").toString()).textures?.SKIN?.url;let{skinTexturesProxy:_}=n.worldRendererConfig;_&&(a=a?.replace("http://textures.minecraft.net/",_).replace("https://textures.minecraft.net/",_))}}catch{}}else a=ut;let l=o[0];if(!a){let g=`${l}_layer_${r}${s?"_overlay":""}`;a=n.resourcesManager.currentResources.customTextures.armor?.textures[g]?.src??Ls[g]}if(!a||!It[e]){ur(t,e);return}let c=`geometry_armor_${e}${s?"_overlay":""}`,d=t.children.findLast(g=>g.name===c),f;if(d?(f=d.material,o1(a,g=>{g.magFilter=W.NearestFilter,g.minFilter=W.NearestFilter,g.flipY=!1,g.wrapS=W.MirroredRepeatWrapping,g.wrapT=W.MirroredRepeatWrapping,f.map=g})):(d=Bt(n,a,It[e]),e==="head"&&(d.children[0].position.y+=.01),d.name=c,f=d.material,v||(f.side=W.DoubleSide)),l==="leather"&&!s){let g=i.nbt?.value?.display?.value?.color?.value;if(g){let b=g>>16&255,A=g>>8&255,_=g&255;f.color.setRGB(b/255,A/255,_/255)}else f.color.setHex(11890001);w5(n,t,e,i,r,!0)}else f.color.setHex(16777215);let m=new W.Object3D;m.name=`armor_${e}${s?"_overlay":""}`,m.add(d),t.add(d)}function ur(n,t){for(let e of n.children)(e.name===`geometry_armor_${t}`||e.name===`geometry_armor_${t}_overlay`)&&e.removeFromParent()}var g5=async(n,t)=>{let e;if(!n&&!t)e=await A5;else{if(n||(n=await Ct(t,"skin")),!n)return;let{canvas:l}=await Zt(n);e=new G0.CanvasTexture(l)}e.magFilter=G0.NearestFilter,e.minFilter=G0.NearestFilter;let i=!1,s=s4(40,16,i?-2:-3,-2,-2,i?3:4,12,4,64,64),o=new G0.MeshStandardMaterial;o.map=e,o.needsUpdate=!0;let a=new G0.Mesh(s,o),v=new G0.Group;return v.add(a),v};function s4(n,t,e,i,r,s,o,a,v,l,c=!1){let d=e/16,f=i/16,m=r/16,g=(e+s)/16,b=(i+o)/16,A=(r+a)/16;c&&([d,g]=[g,d]);let _=[[d,f,m],[g,f,m],[g,b,m],[d,b,m],[d,f,A],[g,f,A],[g,b,A],[d,b,A]],w=n,M=n+a,S=n+a+s,C=n+a+s+s,H=n+a+s+a,B=n+a+s+a+s,I=t,N=t+a,O=t+a+o,j=[{vi:[5,4,0,1],uv:[M,I,S,N],n:[0,-1,0]},{vi:[2,3,7,6],uv:[S,N,C,I],n:[0,1,0]},{vi:[0,4,7,3],uv:[w,N,M,O],n:[-1,0,0]},{vi:[1,0,3,2],uv:[M,N,S,O],n:[0,0,-1]},{vi:[5,1,2,6],uv:[S,N,H,O],n:[1,0,0]},{vi:[4,5,6,7],uv:[H,N,B,O],n:[0,0,1]}],q=[],$=[],e0=[],d0=[];for(let m0=0;m0<j.length;m0++){let p0=j[m0],w0=m0*4,[n0,Y,o0,g0]=p0.uv,L0=[[o0/v,1-Y/l],[n0/v,1-Y/l],[n0/v,1-g0/l],[o0/v,1-g0/l]],H0=c?[3,2,1,0]:[0,1,2,3],X0=c?-p0.n[0]:p0.n[0];for(let u0=0;u0<4;u0++){let vt=_[p0.vi[H0[u0]]];q.push(vt[0],vt[1],vt[2]),$.push(L0[u0][0],L0[u0][1]),e0.push(X0,p0.n[1],p0.n[2])}d0.push(w0,w0+1,w0+2,w0,w0+2,w0+3)}let l0=new G0.BufferGeometry;return l0.setAttribute("position",new G0.Float32BufferAttribute(q,3)),l0.setAttribute("uv",new G0.Float32BufferAttribute($,2)),l0.setAttribute("normal",new G0.Float32BufferAttribute(e0,3)),l0.setIndex(d0),l0}x();R();T();k();x();R();T();k();import*as v0 from"three";import{subscribeKey as Ks}from"valtio/utils";x();R();T();k();import*as D0 from"three";var hr=async(n,t)=>{let e;if(!n&&!t)e=await A5;else{if(n||(n=await Ct(t,"skin")),!n)return;let{canvas:v}=await Zt(n);e=new D0.CanvasTexture(v)}e.magFilter=D0.NearestFilter,e.minFilter=D0.NearestFilter;let i=new D0.BoxGeometry,r=new D0.MeshStandardMaterial,s=!1,o=new D0.Mesh(i,r);o.scale.x=s?3:4,o.scale.y=12,o.scale.z=4,a4(i,40,16,s?3:4,12,4),r.map=e,r.needsUpdate=!0;let a=new D0.Group;return a.add(o),a.scale.set(.1,.1,.1),o.rotation.z=Math.PI,a};function o4(n,t,e,i,r,s,o,a){let v=(B,I,N,O)=>[new D0.Vector2(B/o,1-O/a),new D0.Vector2(N/o,1-O/a),new D0.Vector2(N/o,1-I/a),new D0.Vector2(B/o,1-I/a)],l=v(t+s,e,t+i+s,e+s),c=v(t+i+s,e,t+i*2+s,e+s),d=v(t,e+s,t+s,e+s+r),f=v(t+s,e+s,t+i+s,e+s+r),m=v(t+i+s,e+s,t+i+s*2,e+r+s),g=v(t+i+s*2,e+s,t+i*2+s*2,e+r+s),b=n.attributes.uv,A=[m[3],m[2],m[0],m[1]],_=[d[3],d[2],d[0],d[1]],w=[l[3],l[2],l[0],l[1]],M=[c[0],c[1],c[3],c[2]],S=[f[3],f[2],f[0],f[1]],C=[g[3],g[2],g[0],g[1]],H=[];for(let B of[A,_,w,M,S,C])for(let I of B)H.push(I.x,I.y);b.set(new Float32Array(H)),b.needsUpdate=!0}function a4(n,t,e,i,r,s){o4(n,t,e,i,r,s,64,64)}var Js={itemRight:{rotation:[0,-90,25],translation:[1.13,3.2,1.13],scale:[.68,.68,.68]},itemLeft:{rotation:[0,90,-25],translation:[1.13,3.2,1.13],scale:[.68,.68,.68]},blockRight:{rotation:[0,45,0],translation:[0,0,0],scale:[.4,.4,.4]},blockLeft:{rotation:[0,225,0],translation:[0,0,0],scale:[.4,.4,.4]}},E5=class{constructor(t,e=!1){this.worldRenderer=t;this.offHand=e;u(this,"holdingBlock");u(this,"blockSwapAnimation");u(this,"cameraGroup",new v0.Mesh);u(this,"objectOuterGroup",new v0.Group);u(this,"objectInnerGroup",new v0.Group);u(this,"holdingBlockInnerGroup",new v0.Group);u(this,"camera",new v0.PerspectiveCamera(75,1,.1,100));u(this,"stopUpdate",!1);u(this,"lastHeldItem");u(this,"lastHeldItemRenderKey");u(this,"isSwinging",!1);u(this,"nextIterStopCallbacks");u(this,"idleAnimator");u(this,"ready",!1);u(this,"lastUpdate",0);u(this,"playerHand");u(this,"offHandDisplay",!1);u(this,"offHandModeLegacy",!1);u(this,"swingAnimator");u(this,"config");u(this,"disposed",!1);u(this,"unsubs",[]);u(this,"lastItemModelName");u(this,"switchRequest",0);this.initCameraGroup(),this.unsubs.push(Ks(this.worldRenderer.playerStateReactive,"heldItemMain",()=>{this.offHand||this.updateItem()})),this.unsubs.push(Ks(this.worldRenderer.playerStateReactive,"heldItemOff",()=>{this.offHand&&this.updateItem()})),this.config=t.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||hr().then(i=>{this.disposed||(this.playerHand=i,this.updateItem())}).then(()=>{if(this.disposed)return;let i=b1(async()=>hr(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",r=>{r&&(this.playerHand=r,this.updateItem())},r=>{R0(r,!0)});this.unsubs.push(i)})}updateItem(){if(!this.ready)return;let t=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;t?this.setNewItem(t):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new v0.Mesh}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(t,e,i,r){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage?this.swingAnimator?.update():this.idleAnimator?.update(),this.blockSwapAnimation?.switcher.update();let o=new v0.Scene;o.add(this.cameraGroup),this.updateCameraGroup(),o.add(i.clone()),o.add(r.clone());let a=e.getSize(new v0.Vector2),v=Math.min(a.width,a.height),l=a.width-v,{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),e.autoClear=!1,e.clearDepth(),this.offHandDisplay)e.setViewport(0,0,v,v);else{let d=a.width-v;e.setViewport(d,0,v,v)}e.render(o,this.camera),e.setViewport(0,0,a.width,a.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(t){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new te(()=>({y:this.objectInnerGroup.position.y}),(s,o)=>{s==="y"&&(this.objectInnerGroup.position.y=o)},{y:16})});let e=t,i=this.objectInnerGroup.position.y+this.objectInnerGroup.scale.y*1.5*(e==="appeared"?1:-1),r=!1;return new Promise(s=>{this.blockSwapAnimation.switcher.transitionTo({y:i},e,()=>{r||s(!0)},()=>{r=!0,s(!1)})})}isDifferentItem(t){return this.lastHeldItemRenderKey!==Te(this.worldRenderer,t)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:t}=this;this.cameraGroup.position.copy(t.position),this.cameraGroup.rotation.copy(t.rotation);let e=1,{position:i,scale:r}=this.getHandHeld3d(),s=-i.z,o=this.offHandModeLegacy?-1:1;this.objectOuterGroup.position.set(s*i.x*e*o,s*i.y,-s);let a=r*2.22*.2;this.objectOuterGroup.scale.set(a,a,a)}async createItemModel(t){if(this.lastUpdate=performance.now(),!t||t.type==="hand"&&!this.playerHand)return;let e;if(t.type==="item"||t.type==="block"){let r=this.worldRenderer.entities.getItemMesh({...t.fullItem,itemId:t.id},_1(this.worldRenderer),!1,this.lastItemModelName);if(r){let{mesh:s,isBlock:o,modelName:a}=r;o?(e=s,t.type="block"):(s.position.set(.5,.5,.5),e=s,t.type="item"),this.lastItemModelName=a}}else e=this.playerHand;if(!e)return;e.name="holdingBlock";let i=this.getHandHeld3d().rotation;return e.rotation.x=v0.MathUtils.degToRad(i.x),e.rotation.y=v0.MathUtils.degToRad(i.y),e.rotation.z=v0.MathUtils.degToRad(i.z),{model:e,type:t.type}}async replaceItemModel(t){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!t){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0;return}let e=await this.createItemModel(t);e&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=e.model,this.holdingBlockInnerGroup.add(e.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(t){let e=Te(this.worldRenderer,t),i=this.lastHeldItemRenderKey!==e;if(this.lastHeldItem=t,!i)return;this.lastHeldItemRenderKey=e,this.lastItemModelName=void 0;let r=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0}if(!t){this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(r!==this.switchRequest)return;let o=await this.createItemModel(t);if(!o||r!==this.switchRequest)return;let a=new v0.Group;this.holdingBlockInnerGroup.removeFromParent(),this.holdingBlockInnerGroup=new v0.Group,this.holdingBlockInnerGroup.add(o.model),a.add(this.holdingBlockInnerGroup),this.holdingBlock=o.model,this.objectInnerGroup=new v0.Group,this.objectInnerGroup.add(a),this.objectInnerGroup.position.set(-.5,-.5,-.5),s&&(this.objectInnerGroup.position.y-=this.objectInnerGroup.scale.y*1.5),Object.assign(a.position,{x:.5,y:.5,z:.5}),this.objectOuterGroup=new v0.Group,this.objectOuterGroup.add(this.objectInnerGroup),this.cameraGroup.add(this.objectOuterGroup);let v=this.getHandHeld3d().rotation;this.objectOuterGroup.rotation.y=v0.MathUtils.degToRad(v.yOuter),s&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator??(this.swingAnimator=new pr(this.holdingBlockInnerGroup)),this.swingAnimator.setHandMesh(this.holdingBlockInnerGroup),this.swingAnimator.type=o.type,this.config.viewBobbing&&(this.idleAnimator=new mr(this.holdingBlockInnerGroup,this.worldRenderer.playerStateReactive))}getHandHeld3d(){let t=this.lastHeldItem?.type??"hand",e=this.offHandModeLegacy?"Left":"Right",i=.8*1.15,r={x:.4,y:-.7,z:-.45},s={x:-32.4,y:42.8,z:-41.3,yOuter:0};if(t==="item"){let o=Js[`item${e}`];r={x:-.05,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},i=o.scale[0]*1.15}else if(t==="block"){let o=Js[`block${e}`];r={x:.4,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},i=o.scale[0]*1.15}return{rotation:s,position:r,scale:i}}dispose(){this.disposed=!0,this.ready=!1,this.unsubs.forEach(t=>t()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,R0(this.cameraGroup,!0),R0(this.objectOuterGroup,!0),R0(this.objectInnerGroup,!0),R0(this.holdingBlockInnerGroup,!0),this.holdingBlock=void 0,this.playerHand&&(R0(this.playerHand,!0),this.playerHand=void 0)}},mr=class{constructor(t,e){this.handMesh=t;this.playerState=e;u(this,"globalTime",0);u(this,"lastTime",0);u(this,"currentState");u(this,"targetState");u(this,"defaultPosition");u(this,"idleOffset",{y:0,rotationZ:0});u(this,"tween",new be);u(this,"idleTween",null);u(this,"stateSwitcher");u(this,"debugParams",{walkingSpeed:8,sprintingSpeed:16,walkingAmplitude:{x:1/30,y:1/10,rotationZ:.25},sprintingAmplitude:{x:1/30,y:1/10,rotationZ:.4}});u(this,"debugGui");u(this,"updated",!1);this.handMesh=t,this.globalTime=0,this.currentState="NOT_MOVING",this.targetState="NOT_MOVING",this.defaultPosition={x:t.position.x,y:t.position.y,z:t.position.z,rotationX:t.rotation.x,rotationY:t.rotation.y,rotationZ:t.rotation.z},this.stateSwitcher=new te(()=>({x:this.handMesh.position.x,y:this.handMesh.position.y,z:this.handMesh.position.z,rotationX:this.handMesh.rotation.x,rotationY:this.handMesh.rotation.y,rotationZ:this.handMesh.rotation.z}),(i,r)=>{switch(i){case"x":this.handMesh.position.x=r;break;case"y":this.handMesh.position.y=r;break;case"z":this.handMesh.position.z=r;break;case"rotationX":this.handMesh.rotation.x=r;break;case"rotationY":this.handMesh.rotation.y=r;break;case"rotationZ":this.handMesh.rotation.z=r;break}},{x:2,y:2,z:2,rotation:Math.PI}),this.debugGui=new At("idle_animator",this.debugParams)}startIdleAnimation(){this.idleTween&&this.idleTween.stop(),this.idleOffset.y=this.handMesh.position.y-this.defaultPosition.y,this.idleOffset.rotationZ=this.handMesh.rotation.z-this.defaultPosition.rotationZ,this.idleTween=new O0(this.idleOffset,this.tween).to({y:.05,rotationZ:.05},3e3).easing(I0.Sinusoidal.InOut).yoyo(!0).repeat(1/0).start()}stopIdleAnimation(){this.idleTween&&(this.idleTween.stop(),this.idleOffset.y=0,this.idleOffset.rotationZ=0)}getStateTransform(t,e){switch(t){case"NOT_MOVING":case"SNEAKING":return{x:this.defaultPosition.x,y:this.defaultPosition.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ};case"WALKING":case"SPRINTING":{let i=t==="SPRINTING"?this.debugParams.sprintingSpeed:this.debugParams.walkingSpeed,r=t==="SPRINTING"?this.debugParams.sprintingAmplitude:this.debugParams.walkingAmplitude;return{x:this.defaultPosition.x+Math.sin(e*i)*r.x,y:this.defaultPosition.y-Math.abs(Math.cos(e*i))*r.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ}}}}setState(t){if(t===this.targetState)return;this.targetState=t;let e=!1;if(this.currentState!==t){if(this.stopIdleAnimation(),!e){let i=this.getStateTransform(t,this.globalTime);this.stateSwitcher.transitionTo(i,t)}this.currentState=t}}update(){this.stateSwitcher.update();let t=performance.now(),e=(t-this.lastTime)/1e3;if(this.lastTime=t,!this.stateSwitcher.isTransitioning)switch(this.currentState){case"NOT_MOVING":case"SNEAKING":this.globalTime=Math.PI/4;break;case"SPRINTING":case"WALKING":this.globalTime+=e;break}if(this.playerState){let i=this.playerState.movementState;i!==this.targetState&&this.setState(i)}if(!this.stateSwitcher.isTransitioning&&(this.currentState==="NOT_MOVING"||this.currentState==="SNEAKING")&&(this.idleTween?.isPlaying()||this.startIdleAnimation(),this.tween.update(),this.handMesh.position.y=this.defaultPosition.y+this.idleOffset.y,this.handMesh.rotation.z=this.defaultPosition.rotationZ+this.idleOffset.rotationZ),!this.stateSwitcher.isTransitioning&&(this.currentState==="WALKING"||this.currentState==="SPRINTING")){let i=this.getStateTransform(this.currentState,this.globalTime);Object.assign(this.handMesh.position,i),Object.assign(this.handMesh.rotation,{x:i.rotationX,y:i.rotationY,z:i.rotationZ})}}getCurrentState(){return this.currentState}destroy(){this.stopIdleAnimation(),this.stateSwitcher.forceFinish()}},pr=class{constructor(t){this.handMesh=t;u(this,"PI",Math.PI);u(this,"animationTimer",0);u(this,"lastTime",0);u(this,"isAnimating",!1);u(this,"stopRequested",!1);u(this,"originalRotation");u(this,"originalPosition");u(this,"originalScale");u(this,"debugParams",{animationTime:250,animationStage:0,useClassicSwing:!0,itemSwingXPosScale:-.8,itemSwingYPosScale:.2,itemSwingZPosScale:-.2,itemHeightScale:-.6,itemPreswingRotY:45,itemSwingXRotAmount:-30,itemSwingYRotAmount:-35,itemSwingZRotAmount:-5,armSwingXPosScale:-.3,armSwingYPosScale:.4,armSwingZPosScale:-.4,armSwingYRotAmount:70,armSwingZRotAmount:-20,armHeightScale:-.6});u(this,"debugGui");u(this,"type","hand");this.handMesh=t,this.originalRotation=t.rotation.clone(),this.originalPosition=t.position.clone(),this.originalScale=t.scale.clone(),this.debugGui=new At("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01},itemSwingXPosScale:{min:-2,max:2,step:.1},itemSwingYPosScale:{min:-2,max:2,step:.1},itemSwingZPosScale:{min:-2,max:2,step:.1},itemHeightScale:{min:-2,max:2,step:.1},itemPreswingRotY:{min:-180,max:180,step:5},itemSwingXRotAmount:{min:-180,max:180,step:5},itemSwingYRotAmount:{min:-180,max:180,step:5},itemSwingZRotAmount:{min:-180,max:180,step:5},armSwingXPosScale:{min:-2,max:2,step:.1},armSwingYPosScale:{min:-2,max:2,step:.1},armSwingZPosScale:{min:-2,max:2,step:.1},armSwingYRotAmount:{min:-180,max:180,step:5},armSwingZRotAmount:{min:-180,max:180,step:5},armHeightScale:{min:-2,max:2,step:.1}})}setHandMesh(t){this.handMesh=t,this.originalRotation.copy(t.rotation),this.originalPosition.copy(t.position),this.originalScale.copy(t.scale)}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);return}let t=performance.now(),e=(t-this.lastTime)/1e3;this.lastTime=t,this.animationTimer+=e*1e3;let i=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(i>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);return}this.animationTimer=0;return}this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);let r=i,s=Math.sqrt(r),o=Math.sin(r*this.PI),a=Math.sin(s*this.PI);if(this.type==="hand"){let v=this.debugParams.armSwingXPosScale*a,l=this.debugParams.armSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.armSwingZPosScale*o;this.handMesh.position.x+=v,this.handMesh.position.y+=l+this.debugParams.armHeightScale*r,this.handMesh.position.z+=c,this.handMesh.rotation.y+=v0.MathUtils.degToRad(this.debugParams.armSwingYRotAmount*a),this.handMesh.rotation.z+=v0.MathUtils.degToRad(this.debugParams.armSwingZRotAmount*o)}else{let v=this.debugParams.itemSwingXPosScale*a,l=this.debugParams.itemSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.itemSwingZPosScale*o;this.handMesh.position.x+=v,this.handMesh.position.y+=l+this.debugParams.itemHeightScale*r,this.handMesh.position.z+=c,this.handMesh.rotation.y+=v0.MathUtils.degToRad(this.debugParams.itemPreswingRotY),this.handMesh.rotation.x+=v0.MathUtils.degToRad(this.debugParams.itemSwingXRotAmount*o),this.handMesh.rotation.y+=v0.MathUtils.degToRad(this.debugParams.itemSwingYRotAmount*a),this.handMesh.rotation.z+=v0.MathUtils.degToRad(this.debugParams.itemSwingZRotAmount*o)}}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}};function x5(n,t=!1){return n.displayOptions.inWorldRenderingConfig.handRenderer==="legacy"?new E5(n,t):new p5(n,t)}x();R();T();k();import*as Y0 from"three";import{Vec3 as gr}from"vec3";var qs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAALUlEQVR42mP4//8/IyWYYdSAwW6Ara3tf4oMmD179n9ChhD0AsiQ0Wgc7AYAAOqH+zNQ3r9kAAAAAElFTkSuQmCC";var Zs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOklEQVR42mP4//8/IyWYYdQA3AbY2tr+H1gDZs+e/R9mCD7D8IYBzBAQTXYgEvIKQQPw2T6aEqlkAADEA/W3ycLXvwAAAABJRU5ErkJggg==";var Xs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQklEQVR42mP4//8/IyWYYRgbYGtr+39wGQDiYzMUpwGzZ8+GawDRID4IkxSIMEOwaSQ6FgiFBW0NIOR8osJgBOQFALo37sVTOo/LAAAAAElFTkSuQmCC";var $s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWElEQVR42mP4//8/IyWYYXAbYGtr+59sA0CaZ8+eTZkBhNg4DQApQlYIcglMDN1VWA0AKYJpQvYONi/hDUSYIfjCgmA0EooJ2hmAK9CINgBXoA2xvEAMBgBGPud3dYZtOQAAAABJRU5ErkJggg==";var to="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVR42r1TQQrAMAxyD8tL89iMHgQJoQxHewi0UsWYFFX1/CkcF4iIsgUWOTM9ASV3F3rHF+v9rK4wEVnEFoFYbwmTbRZFFN9m0B9QZBfk2THaAhqktQdTkHYL9iZe+40vs7nda+BuVOMAAAAASUVORK5CYII=";var eo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR42rWTWwpAIQhEbWGu1MUaXRgQcXpyP8SIPI1jibu3l5DfAKrqyFgfAczsKxx5xJUCFGYFUZXMpOe9CAa8BOS+0U5UVbYQ6Siqbi0BFT0auTSRHZqNkE6BGXgEYKYtAczIbQAz8ukzXT3l3egz49IXvXQCVAAAAABJRU5ErkJggg==";var io="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeElEQVQ4jaWSQQ4AIQgD9WG8tI/tnkgaUgmuBw8YHcqERXK/nOUuI4JPAABMSESwA1qAQgAQwBygnfNjTaCpWoBzUlNZQJ07x9FUdgSlV5FaW4Cjq8isW8BJ2GgPtEuVdr0HKvLXHjiRI0An8jTKqo9dF000cnBzPgKuxXtbq/m1AAAAAElFTkSuQmCC";var ro="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVR42qWTSRKAMAgE8WF5KY/FygEL2yEp9cAhCz0wJBYRx58wbowxYsZngLvHjITsgNYpJySBrPIBUMqZSHhdSw+oQlgVa01U7VRQ7huTk67aUWZaVyaNZFsSQBCTVBW3KahLyo/lQ6KR1Y+2BTUyGqke1AXoxsSzpYlU3FW0/Exv1ie0hq53Bf15aAAAAABJRU5ErkJggg==";var no="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmklEQVR42o2SYQ6FMAiDeQfbSXdYXjSpqd869QeZQiilpbr7l2KM0cc75+xUV77YpGCjAPUqitMU3uCAXrsAlPSCcgJMbG4M0mQ1Etz/i0KlXQnmwyqpv1uH4h7fiws7ISneTYNEk0ImCxcAArGJrE4AXhypPtl7AqTdeJG8k3gHb0L6QfmK9WQTa59cSFdHRssKFHHngteV/wPDepaHIu0QVAAAAABJRU5ErkJggg==";var so="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVR42n2Tyw3AIAxD3cGYlGFTUSmV+2o4IEEAf2JQVV1rjDGq576ec5avWVdfWIW12aMPEJBEImoPv+CAvvcCODsVNWBS8wA4A5ndv1/ytciQvBLMyeTSHD3ZYXPXXH7Y0ZMdJvCxQJls5O6tKHlPPWGEfU58WZR6ive1kKSleFNC2kXGRnrcDqhTTOmPeP3pAZnTq6Oin4X0oXbfnNZu626Io6lqGCwAAAAASUVORK5CYII=";var C1=class{constructor(t){this.worldRenderer=t;u(this,"_cursorLinesHidden",!1);u(this,"cursorLineMaterial");u(this,"interactionLines",null);u(this,"prevColor");u(this,"blockBreakMesh");u(this,"breakTextures",[]);let e=[qs,Zs,Xs,$s,to,eo,io,ro,no,so];for(let r=0;r<10;r++)St(e[r]).then(s=>{s.magFilter=Y0.NearestFilter,s.minFilter=Y0.NearestFilter,this.breakTextures.push(s)});let i=new Y0.MeshBasicMaterial({transparent:!0,blending:Y0.MultiplyBlending,alphaTest:.5});this.blockBreakMesh=new Y0.Mesh(new Y0.BoxGeometry(1,1,1),i),this.blockBreakMesh.visible=!1,this.blockBreakMesh.renderOrder=999,this.blockBreakMesh.name="blockBreakMesh",this.worldRenderer.sceneOrigin.addAndTrack(this.blockBreakMesh),this.worldRenderer.onReactivePlayerStateUpdated("gameMode",()=>{this.updateLineMaterial()}),setTimeout(()=>{this.updateLineMaterial(),this.interactionLines&&this.setHighlightCursorBlock(this.interactionLines.blockPos,this.interactionLines.shapePositions,!0)})}get cursorLinesHidden(){return this._cursorLinesHidden}set cursorLinesHidden(t){this.interactionLines&&(this.interactionLines.mesh.visible=!t),this._cursorLinesHidden=t}updateLineMaterial(){let t=this.worldRenderer.playerStateReactive.gameMode==="creative",e=this.worldRenderer.renderer.getPixelRatio();this.cursorLineMaterial&&this.cursorLineMaterial.dispose(),this.cursorLineMaterial=new ie({color:(()=>{switch(this.worldRenderer.worldRendererConfig.highlightBlockColor){case"blue":return 4227327;case"classic":return 0;default:return t?4227327:0}})(),linewidth:Math.max(e*.7,1)*2}),this.prevColor=this.worldRenderer.worldRendererConfig.highlightBlockColor}updateBreakAnimation(t,e,i){if(this.hideBreakAnimation(),e===null||!t||!i)return;let{position:r,width:s,height:o,depth:a}=i,v=new gr(r.x,r.y,r.z);this.blockBreakMesh.scale.set(s*1.001,o*1.001,a*1.001),v.add(new gr(t.x,t.y,t.z)),this.blockBreakMesh.position.set(v.x,v.y,v.z),this.blockBreakMesh.visible=!0,this.blockBreakMesh.material.map=this.breakTextures[e]??this.breakTextures.at(-1),this.blockBreakMesh.material.needsUpdate=!0}hideBreakAnimation(){this.blockBreakMesh&&(this.blockBreakMesh.visible=!1)}updateDisplay(){if(this.cursorLineMaterial){let{renderer:t}=this.worldRenderer;this.cursorLineMaterial.resolution.set(t.domElement.width,t.domElement.height),this.cursorLineMaterial.dashOffset=performance.now()/750}}setHighlightCursorBlock(t,e,i=!1){if(t&&this.interactionLines&&t.equals(this.interactionLines.blockPos)&&b4(e??[],this.interactionLines.shapePositions??[])&&!i||(this.interactionLines!==null&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.interactionLines.mesh),this.interactionLines=null),t===null))return;let r=new Y0.Group;for(let{position:s,width:o,height:a,depth:v}of e??[]){let l=new gr(s.x,s.y,s.z),c=[1.0001*o,1.0001*a,1.0001*v],d=new Y0.BoxGeometry(...c),f=new ee().fromEdgesGeometry(new Y0.EdgesGeometry(d)),m=new y5(f,this.cursorLineMaterial);m.position.set(l.x,l.y,l.z),m.computeLineDistances(),r.add(m)}this.worldRenderer.sceneOrigin.addAndTrack(r),r.position.set(t.x,t.y,t.z),r.visible=!this.cursorLinesHidden,this.interactionLines={blockPos:t,mesh:r,shapePositions:e}}render(){this.prevColor!==this.worldRenderer.worldRendererConfig.highlightBlockColor&&this.updateLineMaterial(),this.updateDisplay()}},b4=(n,t)=>{if(n.length!==t.length)return!1;for(let[e,i]of n.entries())if(i!==t[e])return!1;return!0};x();R();T();k();x();R();T();k();var y4=Qe(Wi(),1);import oo from"prismarine-nbt";import{getItemDefinition as _4}from"mc-assets/dist/itemDefinitions";var w4=(n,t)=>{let e,i,r=n.name;r.includes(":")||(r=`minecraft:${r}`);let s=t.currentResources?.customItemModelNames[r];if(n.components){let o=new Map;for(let c of n.components)o.set(c.type,c);let a=o.get("custom_name")||o.get("item_name");a&&(e=typeof a.data=="string"?a.data:oo.simplify(a.data));let v=o.get("item_model");if(v&&(i=v.data),s){let c=o.get("custom_model_data");if(c?.data){let d;typeof c.data=="number"?d=c.data:typeof c.data=="object"&&"floats"in c.data&&Array.isArray(c.data.floats)&&c.data.floats.length>0&&(d=c.data.floats[0]),d&&s[d]&&(i=s[d])}}let l=o.get("lore");l&&(e??(e=n.displayName??n.name),e+=`
|
|
21187
|
-
${JSON.stringify(l.data)}`)}if(n.nbt){let o=oo.simplify(n.nbt),a=o.display?.Name;a&&(e=a),s&&o.CustomModelData&&s[o.CustomModelData]&&(i=s[o.CustomModelData])}return{customText:e,customModel:i}};var ao=(n,t,e,i)=>{let r=n.name,{customModel:s}=w4(n,e);s&&(r=s);let o=M2(i,{...t}),a=_4(e.currentResources.itemsDefinitionsStore,{name:r,version:e.currentResources.version,properties:o})?.model;return(a==="minecraft:special"?void 0:a)??r};x();R();T();k();var ho=Qe(uo(),1);import{versionToNumber as fo}from"mc-assets/dist/utils";var mo=(n,t,e=!1,i=!1)=>{let r=n.modelName,s=globalThis.loadedData.itemsByName[r];fo(t.currentResources.version)<fo("1.13")&&(r=(0,ho.getRenamedData)(s?"items":"blocks",r,t.currentResources.version,"1.13.1"));let o;if(!i){let v=t.currentResources?.guiAtlas?.json,l=d=>d&&v?.textures[d.replace("minecraft:","").replace("block/","").replace("blocks/","").replace("item/","").replace("items/","").replace("_inventory","")],c=l(r)??l(n.originalItemName);if(c){let d=c.u*v.width,f=c.v*v.height;return{texture:"gui",slice:[d,f,v.tileSize,v.tileSize],scale:.25,blockData:null,modelName:null}}}let a=v=>v.top??v;try{if(!t.currentResources?.itemsRenderer)throw new Error("Items renderer is not available");o=t.currentResources.itemsRenderer.getItemTexture(r,{},!1,i)??(n.originalItemName?t.currentResources.itemsRenderer.getItemTexture(n.originalItemName,{},!1,i):void 0)??t.currentResources.itemsRenderer.getItemTexture("item/missing_texture")}catch(v){reportError?.(`Failed to render item ${r} (original: ${n.originalItemName}) on ${t.currentResources.version} (resourcepack: TODO!): ${v.stack}`),o=a(t.currentResources.itemsRenderer.getItemTexture("errored"))}return o??(o=a(t.currentResources.itemsRenderer.getItemTexture("unknown"))),"type"in o?{texture:o.type,slice:o.slice,modelName:r,blockData:null,scale:null}:{texture:"blocks",blockData:o,modelName:r,slice:null,scale:null}};var po=(n,t,e,i)=>{let r=e.currentResources;if(!r)throw new Error("Resources not loaded");let s=n.itemId??n.blockId??n.name,{blockState:o}=n;try{let a=o?globalThis.loadedData.blocksByStateId[o]?.name:typeof s=="number"?globalThis.loadedData.items[s]?.name:s;if(!a)throw new Error(`Item not found: ${s}`);let v=ao({...n,name:a},t,e,i),l=mo({modelName:v},e,!1,!0);if(!l)throw new Error(`Failed to get render info for item ${a}`);let c=l.texture==="blocks"?r.blocksAtlasImage:r.itemsAtlasImage;if(l.blockData)return{resolvedModel:l.blockData.resolvedModel,modelName:l.modelName};if(l.slice){let[d,f,m,g]=l.slice,[b,A,_,w]=[d/c.width,f/c.height,m/c.width,g/c.height];return{u:b,v:A,su:_,sv:w,renderInfo:l,modelName:l.modelName}}throw new Error(`Invalid render info for item ${a}`)}catch(a){return reportError?.(a),{u:0,v:0,su:16/r.blocksAtlasImage.width,sv:16/r.blocksAtlasImage.width,modelName:"missing"}}};x();R();T();k();import*as He from"three";var B1=class{constructor(t){this.worldRenderer=t;u(this,"audioListener");u(this,"activeSounds",new Set);u(this,"audioContext");u(this,"soundVolumes",new Map);u(this,"baseVolume",1);t.onWorldSwitched.push(()=>{this.stopAll()}),t.onReactiveConfigUpdated("volume",e=>{this.changeVolume(e)})}initAudioListener(){this.audioListener||(this.audioListener=new He.AudioListener,this.worldRenderer.camera.add(this.audioListener))}playSound(t,e,i=1,r=1,s=500){this.initAudioListener();let o=new He.PositionalAudio(this.audioListener);this.activeSounds.add(o),this.soundVolumes.set(o,i);let a=new He.AudioLoader,v=Date.now();a.loadAsync(e).then(l=>{Date.now()-v>s||(o.setBuffer(l),o.setRefDistance(20),o.setVolume(i*this.baseVolume),o.setPlaybackRate(r),this.worldRenderer.sceneOrigin.addAndTrack(o),o.position.set(t.x,t.y,t.z),o.onEnded=()=>{this.worldRenderer.sceneOrigin.removeAndUntrack(o),o.source&&o.disconnect(),this.activeSounds.delete(o),this.soundVolumes.delete(o),a.manager.itemEnd(e)},o.play())})}stopAll(){for(let t of this.activeSounds)t&&(t.stop(),t.source&&t.disconnect(),this.worldRenderer.sceneOrigin.removeAndUntrack(t));this.activeSounds.clear(),this.soundVolumes.clear()}changeVolume(t){this.baseVolume=t;for(let[e,i]of this.soundVolumes)e.setVolume(i*this.baseVolume)}destroy(){this.stopAll(),this.audioListener&&(this.audioListener.removeFromParent(),this.audioListener=void 0)}playTestSound(){this.playSound(this.worldRenderer.camera.position,"/sound.mp3")}};x();R();T();k();import*as F0 from"three";var I1=class{constructor(t,e){this.worldRenderer=t;this.onRenderCallbacks=e;u(this,"rollAngle",0);u(this,"rollAnimation");u(this,"basePitch",0);u(this,"baseYaw",0);u(this,"cameraBobInput",null);e.push(()=>{this.update()})}get damageRollAmount(){return 5}get damageAnimDuration(){return 200}setCameraBobInput(t){this.cameraBobInput=t}setBaseRotation(t,e){this.basePitch=t,this.baseYaw=e,this.update()}getBaseRotation(){return{pitch:this.basePitch,yaw:this.baseYaw}}shakeFromDamage(t){let e=this.rollAngle,i=e+(t??(Math.random()<.5?-1:1))*this.damageRollAmount;this.rollAnimation={startTime:performance.now(),startRoll:e,targetRoll:i,duration:this.damageAnimDuration/2}}update(){if(this.worldRenderer.playerStateUtils.isSpectatingEntity()&&(this.rollAngle=0,this.rollAnimation=void 0),this.rollAnimation){let e=performance.now(),i=e-this.rollAnimation.startTime,r=Math.min(i/this.rollAnimation.duration,1);this.rollAnimation.returnToZero?(this.rollAngle=this.rollAnimation.startRoll*(1-this.easeInOut(r)),r===1&&(this.rollAnimation=void 0)):(this.rollAngle=this.rollAnimation.startRoll+(this.rollAnimation.targetRoll-this.rollAnimation.startRoll)*this.easeOut(r),r===1&&(this.rollAnimation={startTime:e,startRoll:this.rollAngle,targetRoll:0,duration:this.damageAnimDuration/2,returnToZero:!0}))}let t=this.worldRenderer.cameraObject;if(this.worldRenderer.cameraGroupVr){let e=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(0,1,0),this.baseYaw);t.setRotationFromQuaternion(e)}else{let e=this.addAntiZfightingOffset(this.basePitch),i=this.addAntiZfightingOffset(this.baseYaw),r=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(1,0,0),e),s=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(0,1,0),i),o=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(0,0,1),F0.MathUtils.degToRad(this.rollAngle)),a=new F0.Quaternion,v=new F0.Quaternion,l=this.worldRenderer.playerStateReactive.perspective;if(this.cameraBobInput){let d=y1(this.cameraBobInput);a=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(0,0,1),d.rotation.z),v=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(1,0,0),d.rotation.x),l==="first_person"&&this.worldRenderer.camera.position.set(d.position.x,d.position.y,0)}else l==="first_person"&&this.worldRenderer.camera.position.set(0,0,0);let c=s.multiply(r).multiply(o).multiply(a).multiply(v);t.setRotationFromQuaternion(c)}}easeOut(t){return 1-(1-t)*(1-t)}easeInOut(t){return t<.5?2*t*t:1-(-2*t+2)**2/2}addAntiZfightingOffset(t){let i=(t%(Math.PI*2)+Math.PI*2)%(Math.PI*2),r=.01;return Math.abs(i)<r||Math.abs(i-Math.PI/2)<r||Math.abs(i-Math.PI)<r||Math.abs(i-3*Math.PI/2)<r?t+.001:t}};x();R();T();k();import*as K from"three";var H1=class{constructor(t){this.worldRenderer=t;u(this,"customMedia",new Map);u(this,"lastCheck",0);u(this,"THROTTLE_TIME",100);this.worldRenderer.onWorldSwitched.push(()=>{this.onWorldGone()}),this.worldRenderer.onRender.push(()=>{this.render()}),this.worldRenderer.onReactiveConfigUpdated("volume",()=>{let{volume:e}=this.worldRenderer.worldRendererConfig;for(let[i,r]of this.customMedia.entries())r.positionalAudio&&r.positionalAudio.setVolume((r.props.volume??1)*e)})}onWorldGone(){for(let[t,e]of this.customMedia.entries())this.destroyMedia(t)}onWorldStop(){for(let[t,e]of this.customMedia.entries())this.setVideoPlaying(t,!1)}createErrorTexture(t,e,i=16777215,r="Failed to load"){let s=new OffscreenCanvas(100,100),o=100;s.width=o,s.height=o;let a=s.getContext("2d");if(!a)return new K.CanvasTexture(s);a.clearRect(0,0,s.width,s.height),a.fillStyle=`rgba(${i>>16&255}, ${i>>8&255}, ${i&255}, 1)`,a.fillRect(0,0,s.width,s.height),a.fillStyle="#ff0000",a.font="bold 10px sans-serif",a.textAlign="center",a.textBaseline="middle",a.fillText(r,s.width/2,s.height/2,s.width);let v=new K.CanvasTexture(s);return v.minFilter=K.LinearFilter,v.magFilter=K.LinearFilter,v}createBackgroundTexture(t,e,i=0,r=1){let s=new OffscreenCanvas(1,1);s.width=1,s.height=1;let o=s.getContext("2d");if(!o)return new K.CanvasTexture(s);let a=i>>16&255,v=i>>8&255,l=i&255;o.fillStyle=`rgba(${a}, ${v}, ${l}, ${r})`,o.fillRect(0,0,1,1);let c=new K.CanvasTexture(s);return c.minFilter=K.NearestFilter,c.magFilter=K.NearestFilter,c}validateOrigin(t,e){if(e===!0)return!0;if(e===!1)return!1;let i=new URL(t);return e.some(r=>i.origin.endsWith(r))}onPageInteraction(){for(let[t,e]of this.customMedia.entries())e.hadAutoPlayError&&(e.hadAutoPlayError=!1,this.playVideo(t))}addMedia(t,e){let i=structuredClone(e);this.destroyMedia(t);let r=!1;e.src.startsWith("https://disk.yandex.ru/i/")&&(r=!0,e.src=`/ya-image?url=${e.src}`);let{scene:s}=this.worldRenderer;e.allowOrigins!==void 0&&!this.validateOrigin(e.src,e.allowOrigins)&&(e.src="");let a=e.src.endsWith(".png")||e.src.endsWith(".jpg")||e.src.endsWith(".jpeg")||e.imageOverride;r&&!e.imageOverride&&fetch(e.src,{method:"HEAD"}).then(S=>{S.headers.get("content-type")?.startsWith("image/")&&(this.destroyMedia(t),this.addMedia(t,{...i,src:e.src,imageOverride:!0}))}).catch(console.error);let v,l;if(!a){v=document.createElement("video"),v.src=e.src.endsWith(".gif")?e.src.replace(".gif",".mp4"):e.src,v.loop=e.loop??!0;let S=(e.volume??1)*this.worldRenderer.worldRendererConfig.volume;v.volume=Math.min(S,1),v.playsInline=!0,v.crossOrigin="anonymous";let C=this.worldRenderer.soundSystem;if(C.initAudioListener(),!C.audioListener)throw new Error("Audio listener not initialized");l=new K.PositionalAudio(C.audioListener),l.setRefDistance(6),l.setVolume(S),this.worldRenderer.sceneOrigin.addAndTrack(l),l.position.set(e.position.x,e.position.y,e.position.z),l.setMediaElementSource(v),l.connect(),v.addEventListener("pause",()=>{l?.pause(),globalThis.tempSendVideoStop?.(t,"paused",v.currentTime)}),v.addEventListener("play",()=>{l?.play(),globalThis.tempSendVideoPlay?.(t)}),v.addEventListener("seeked",()=>{l&&v&&(l.offset=v.currentTime)}),v.addEventListener("stalled",()=>{globalThis.tempSendVideoStop?.(t,"stalled",v.currentTime)}),v.addEventListener("waiting",()=>{globalThis.tempSendVideoStop?.(t,"waiting",v.currentTime)}),v.addEventListener("error",({error:H})=>{globalThis.tempSendVideoStop?.(t,`error: ${H}`,v.currentTime)}),v.addEventListener("ended",()=>{globalThis.tempSendVideoStop?.(t,"ended",v.currentTime),e.loop||(v.currentTime=0,M.ended=!0)})}let c=this.createBackgroundTexture(e.size.width,e.size.height,e.background),d=S=>{let C=this.createErrorTexture(e.size.width,e.size.height,e.background,S);g.map=C,g.needsUpdate=!0},f=new K.PlaneGeometry(1,1),m=e.allowLighting?K.MeshLambertMaterial:K.MeshBasicMaterial,g=new m({map:c,transparent:!0,side:e.doubleSide?K.DoubleSide:K.FrontSide,alphaTest:.1}),b=v?new K.VideoTexture(v):new K.TextureLoader().load(e.src,()=>{this.customMedia.get(t)?.texture===b&&(g.map=b,g.needsUpdate=!0)},void 0,()=>d());b.minFilter=K.NearestFilter,b.magFilter=K.NearestFilter,b.generateMipmaps=!1;let A=new K.Mesh(f,g),{mesh:_}=this.positionMeshExact(A,K.MathUtils.degToRad((e.rotation??0)*90),e.position,e.size.width,e.size.height);s.add(_),v&&(A.onBeforeRender=()=>{v.readyState===v.HAVE_ENOUGH_DATA&&(!v.paused||!M?.hadAutoPlayError)&&(g.map!==b&&(g.map=b,g.needsUpdate=!0),b.needsUpdate=!0,l&&(l.position.copy(_.position),l.rotation.copy(_.rotation)))});let w=S=>{let C=f.attributes.uv.array;C[0]=S.startU,C[1]=S.startV,C[2]=S.endU,C[3]=S.startV,C[4]=S.endU,C[5]=S.endV,C[6]=S.startU,C[7]=S.endV,f.attributes.uv.needsUpdate=!0};e.uvMapping&&w(e.uvMapping);let M={mesh:_,video:v,texture:b,updateUVMapping:w,positionalAudio:l,props:i,hadAutoPlayError:!1,pausedBecuaseHidden:!1,ended:!1,handleError(S){if(M.destroyed)return;let C=H=>H;d(S.name==="NotAllowedError"||S.name==="AbortError"?C("Waiting for user interaction"):C("Failed to auto play"))}};return this.customMedia.set(t,M),v&&e.autoPlay&&this.playVideo(t,!0),t}playVideo(t,e=!1){let i=this.customMedia.get(t);if(i?.video){if(!e&&i.positionalAudio&&i.video.currentTime<1){let r=i.video.currentTime;this.addMedia(t,i.props),i.video.currentTime=r,i.props.autoPlay||this.playVideo(t,!0);return}i.video.play().then(()=>{i.hadAutoPlayError=!1}).catch(r=>{i.pausedBecuaseHidden||((r.name==="NotAllowedError"||r.name==="AbortError"||r.message?.includes("not allowed")&&!i.pausedBecuaseHidden)&&(i.hadAutoPlayError=!0),i.handleError(r))})}}render(){for(let[t,e]of this.customMedia.entries()){let i=e.mesh.visible;e.mesh.visible=this.worldRenderer.shouldObjectVisible(e.mesh)&&!e.mesh.forceHide,i!==e.mesh.visible&&e.video&&(e.mesh.visible?e.pausedBecuaseHidden&&(this.playVideo(t),e.pausedBecuaseHidden=!1):e.video.paused||(e.video.pause(),e.pausedBecuaseHidden=!0))}}setVideoPlaying(t,e){let i=this.customMedia.get(t);i?.video&&(e?this.playVideo(t):i.video.pause())}setVideoSeeking(t,e){let i=this.customMedia.get(t);i?.video&&(i.video.currentTime=e)}setVideoVolume(t,e){let i=this.customMedia.get(t);i?.video&&(i.video.volume=e)}setVideoSpeed(t,e){let i=this.customMedia.get(t);i?.video&&(i.video.playbackRate=e)}setControlMode(t,e,i){let r=this.customMedia.get(t);r?.video&&(r.props.controlMode={mouseButton:e,controlMode:i})}destroyMedia(t){let{scene:e}=this.worldRenderer,i=this.customMedia.get(t);if(i){i.destroyed=!0,i.video&&(i.video.pause(),i.video.src="",i.video.remove()),i.positionalAudio&&this.worldRenderer.sceneOrigin.removeAndUntrack(i.positionalAudio),this.worldRenderer.sceneOrigin.removeAndUntrack(i.mesh),i.texture.dispose();let r=i.mesh.children[0];r&&(r.geometry.dispose(),r.material instanceof K.Material&&r.material.dispose()),this.customMedia.delete(t)}}positionMeshExact(t,e,i,r,s,o=1){e===0&&(i.z+=.001),e===Math.PI/2&&(i.x-=.001),e===Math.PI&&(i.z-=.001),e===3*Math.PI/2&&(i.x+=.001),e===0&&(i.z+=1),e===Math.PI&&(i.x+=1),e===3*Math.PI/2&&(i.z+=1,i.x+=1),t.matrix.identity(),t.position.set(0,0,0),t.rotation.set(0,0,0),t.scale.set(1,1,1),t.rotateY(e),(e===Math.PI/2||e===3*Math.PI/2)&&(t.rotateZ(-Math.PI),t.rotateX(-Math.PI)),t.scale.set(r,s,o),t.geometry.translate(.5,.5,0),t.geometry.attributes.position.needsUpdate=!0,this.worldRenderer.sceneOrigin.track(t),t.position.set(i.x,i.y,i.z);let a=new K.Group;a.add(t);let v=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711680}));v.position.set(i.x,i.y,i.z),a.add(v);let l=i.x+Math.cos(e)*r,c=i.z+Math.sin(e)*r,d=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:255}));d.position.set(i.x,i.y+s,i.z),a.add(d);let f=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16776960}));f.position.set(l,i.y,c),a.add(f);let m=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711935}));m.position.set(l,i.y+s,c),a.add(m);let g=new K.Vector3(this.worldRenderer.sceneOrigin.toSceneX(i.x),this.worldRenderer.sceneOrigin.toSceneY(i.y),this.worldRenderer.sceneOrigin.toSceneZ(i.z)),b=new K.ArrowHelper(new K.Vector3(Math.cos(e),0,Math.sin(e)),g,1,16711680);return a.add(b),{mesh:t,debugGroup:a}}createTestCanvasTexture(){let t=new OffscreenCanvas(100,100);t.width=100,t.height=100;let e=t.getContext("2d");return e?(e.font="10px Arial",e.fillStyle="red",e.fillText("Hello World",0,10),new K.CanvasTexture(t)):null}tryIntersectMedia(){if(Date.now()-this.lastCheck<this.THROTTLE_TIME)return;if(this.customMedia.size===0){this.worldRenderer.reactiveState.world.intersectMedia=null,this.worldRenderer.debugVideo=null,this.worldRenderer.cursorBlock.cursorLinesHidden=!1;return}this.lastCheck=Date.now();let{camera:t,scene:e}=this.worldRenderer,i=new K.Raycaster,r=new K.Vector2(0,0);i.setFromCamera(r,t);let s=i.intersectObjects(e.children,!0);if(s.length>0){let o=s[0],a=o.object;for(let[v,l]of this.customMedia.entries())if(a===l.mesh||l.mesh.children.includes(a)){let{uv:c}=o;if(c){let d={id:v,x:c.x,y:c.y};this.worldRenderer.reactiveState.world.intersectMedia=d,this.worldRenderer.debugVideo=l,this.worldRenderer.cursorBlock.cursorLinesHidden=!0;return}}}this.worldRenderer.reactiveState.world.intersectMedia=null,this.worldRenderer.debugVideo=null,this.worldRenderer.cursorBlock.cursorLinesHidden=!1}handleUserClick(t){let e=this.worldRenderer.reactiveState.world.intersectMedia;if(e){let{id:i,x:r,y:s}=e,o=this.customMedia.get(i),a=o?.props.controlMode;if(o?.video&&(a?.mouseButton==="both"||a?.mouseButton===t))switch(a?.controlMode){case"play_pause":{this.setVideoPlaying(i,o.video.paused);break}case"play_if_ended":{o.ended&&this.setVideoPlaying(i,!0);break}case"toggle_mute":{o.video.muted=!o.video.muted;break}}}}};x();R();T();k();import*as Ot from"three";x();R();T();k();import*as k0 from"three";var k4=1,go=10,ct={TARGET_SCREEN_PX:150,CANVAS_SIZE:256,LAYOUT:{DOT_Y:.3,NAME_Y:.45,DISTANCE_Y:.55},CANVAS_SCALE:2,ARROW:{enabledDefault:!1,pixelSize:50,paddingPx:50},DEFAULT_VISUAL_SCALE:1,DEFAULT_OPACITY:1};function yo(n){let t=n.color??16711680,e=n.depthTest??!1,i=n.visualScale??n.metadata?.visualScale??(typeof window>"u"?void 0:window.serverMetadata?.waypointVisualScale)??ct.DEFAULT_VISUAL_SCALE,r=n.opacity??n.metadata?.opacity??(typeof window>"u"?void 0:window.serverMetadata?.waypointOpacity)??ct.DEFAULT_OPACITY,s=W0(bo(),bo());O1(s,t,n.label??"","0m",i);let o=new k0.CanvasTexture(s);o.anisotropy=1,o.magFilter=k0.LinearFilter,o.minFilter=k0.LinearFilter;let a=new k0.SpriteMaterial({map:o,transparent:!0,opacity:1,depthTest:e,depthWrite:!1}),v=new k0.Sprite(a);v.position.set(0,0,0),v.renderOrder=10,v.material.opacity=r;let l=n.label??"",c="0m",d=Number.NaN,f,m,g,b,A=null,_=ct.ARROW.enabledDefault,w=new k0.Group;w.add(v);let{x:M,y:S,z:C}=n.position;w.position.set(M,S,C);function H(){o.needsUpdate=!0}function B(){if(!m||!g)return;let Y=m.width;g.clearRect(0,0,Y,Y),g.beginPath(),g.moveTo(Y*.15,Y*.5),g.lineTo(Y*.85,Y*.5),g.lineTo(Y*.5,Y*.15),g.closePath();let o0=`#${t.toString(16).padStart(6,"0")}`;g.lineWidth=6,g.strokeStyle="black",g.stroke(),g.fillStyle=o0,g.fill(),b&&(b.needsUpdate=!0)}function I(Y){t=Y,c="0m",d=0,O1(s,t,l,"0m",i),H(),f&&B()}function N(Y){l=Y??"",O1(s,t,l,c,i),H()}function O(Y,o0){o0!==c&&(c=o0,O1(s,t,Y,o0,i),H())}function j(Y){v.visible=Y}function q(Y,o0,g0){w.position.set(Y,o0,g0)}function $(Y,o0,g0,L0){let H0=o0*Math.PI/180,u0=Math.tan(H0/2)*2*g0*(ct.TARGET_SCREEN_PX*i/L0);v.scale.set(u0,u0,1)}function e0(){if(f)return;let Y=128;m=W0(Y,Y),g=m.getContext("2d"),B(),b=new k0.CanvasTexture(m),b.anisotropy=1,b.magFilter=k0.LinearFilter,b.minFilter=k0.LinearFilter;let o0=new k0.SpriteMaterial({map:b,transparent:!0,depthTest:!1,depthWrite:!1,opacity:r});f=new k0.Sprite(o0),f.renderOrder=12,f.visible=!1,A&&A.add(f)}function d0(Y){_=Y,!Y&&f&&(f.visible=!1)}function l0(Y){f?.parent&&f.parent.remove(f),A=Y,f&&Y&&Y.add(f)}function m0(Y,o0,g0){if(!_||(e0(),!f))return!0;let L0=n.metadata?.onlyLeftRight===!0,H0=new k0.Vector3;Y.getWorldDirection(H0);let X0=Y.up.clone().normalize(),u0=new k0.Vector3().copy(H0).cross(X0).normalize(),vt=new k0.Vector3().copy(u0).cross(H0).normalize(),We=new k0.Vector3().setFromMatrixPosition(Y.matrixWorld),Ve=new k0.Vector3(w.position.x,w.position.y,w.position.z).sub(We),Ut=Ve.dot(H0),Rt=Ve.dot(u0),Gt=Ve.dot(vt),D5=o0/g0,Nt=Y.fov*Math.PI/180,de=2*Math.atan(Math.tan(Nt/2)*D5),F5=Math.atan2(Rt,Ut),L5=Math.atan2(Gt,Ut);if(Ut>0&&Math.abs(F5)<=de/2&&Math.abs(L5)<=Nt/2)return f.visible=!1,!0;let q0=F5/(de/2),M0=L5/(Nt/2);Ut<=0&&(Math.abs(q0)>Math.abs(M0)?(q0=Math.sign(q0),M0=0):(q0=0,M0=Math.sign(M0))),L0&&(Math.abs(q0)>Math.abs(M0)||(q0=q0>=0?1:-1),M0=0);let ue=Math.max(Math.abs(q0),Math.abs(M0))||1,je=q0/ue,rt=M0/ue,fe=ct.ARROW.paddingPx,y=(je+1)*.5*o0,h=(1-rt)*.5*g0,p=Math.min(Math.max(y,fe),o0-fe),E=Math.min(Math.max(h,fe),g0-fe);je=p/o0*2-1,rt=-(E/g0)*2+1;let P=Math.max(2,Y.near*4),z=Math.tan(Nt/2)*P,G=z*D5,r0=We.clone().add(H0.clone().multiplyScalar(P)).add(u0.clone().multiplyScalar(je*G)).add(vt.clone().multiplyScalar(rt*z));f.visible=!0,f.position.copy(r0);let b0=Math.atan2(M0,q0);f.material.rotation=b0-Math.PI/2;let h0=Math.tan(Nt/2)*2*P*(ct.ARROW.pixelSize*i/g0);return f.scale.set(h0,h0,1),!1}function p0(Y){return Y.distanceTo(w.position)}function w0(Y,o0,g0,L0){let H0=p0(Y);$(Y,o0.fov,H0,L0);let X0=Math.round(H0/go)*go;X0!==d&&(d=X0,O(l,`${Math.max(0,X0)}m`));let u0=m0(o0,g0,L0);return j(u0),u0}function n0(){let Y=v.material;if(Y.map?.dispose(),Y.dispose(),f){f.parent&&f.parent.remove(f);let o0=f.material;o0.map?.dispose(),o0.dispose()}f=void 0,m=void 0,g=void 0,b=void 0}return{group:w,sprite:v,enableOffscreenArrow:d0,setArrowParent:l0,updateForCamera:w0,setColor:I,setLabel:N,updateDistanceText:O,setVisible:j,setPosition:q,dispose:n0}}function _o(){let n=globalThis.devicePixelRatio||1,t=Math.min(n,k4);return ct.CANVAS_SCALE*t}function bo(){return Math.round(ct.CANVAS_SIZE*_o())}function O1(n,t,e,i,r){let s=n.width,o=_o(),a=n.getContext("2d");a.clearRect(0,0,s,s);let v=s/2,l=Math.round(s*ct.LAYOUT.DOT_Y),c=Math.round(s*.05*r),d=Math.max(2,Math.round(4*o*r)),f=c+d;a.beginPath(),a.arc(v,l,f,0,Math.PI*2),a.fillStyle=`#${t.toString(16).padStart(6,"0")}`,a.fill(),a.textAlign="center",a.textBaseline="middle";let m=Math.round(s*.08*r),g=Math.round(s*.06*r);a.font=`800 ${m}px mojangles`,a.lineWidth=Math.max(2,Math.round(3*o*r));let b=Math.round(s*ct.LAYOUT.NAME_Y);a.strokeStyle="black",a.strokeText(e,v,b),a.fillStyle="white",a.fillText(e,v,b),a.font=`800 ${g}px mojangles`,a.lineWidth=Math.max(2,Math.round(2*o*r));let A=Math.round(s*ct.LAYOUT.DISTANCE_Y);a.strokeStyle="black",a.strokeText(i,v,A),a.fillStyle="#CCCCCC",a.fillText(i,v,A)}var z1=class{constructor(t){this.worldRenderer=t;u(this,"waypoints",new Map);u(this,"waypointScene",new Ot.Scene);u(this,"lastCameraPosition",new Ot.Vector3);u(this,"lastUpdateTime",0);u(this,"UPDATE_THROTTLE_MS",16)}updateWaypoints(){let t=performance.now(),e=this.worldRenderer.getCameraPosition(),i=this.lastCameraPosition.distanceTo(e)>.5,r=t-this.lastUpdateTime>this.UPDATE_THROTTLE_MS;if(!i&&!r)return;this.lastCameraPosition.copy(e),this.lastUpdateTime=t;let s=this.worldRenderer.renderer.getSize(new Ot.Vector2);for(let o of this.waypoints.values()){let a=new Ot.Vector3(o.x,o.y,o.z),v=e.distanceTo(a),l=(!o.minDistance||v>=o.minDistance)&&(o.maxDistance===1/0||v<=o.maxDistance);o.sprite.setVisible(l),l&&(o.sprite.setPosition(this.worldRenderer.sceneOrigin.toSceneX(o.x),this.worldRenderer.sceneOrigin.toSceneY(o.y),this.worldRenderer.sceneOrigin.toSceneZ(o.z)),o.sprite.updateForCamera(this.worldRenderer.getCameraPosition(),this.worldRenderer.camera,s.width,s.height))}}render(){this.waypoints.size!==0&&(this.updateWaypoints(),this.worldRenderer.renderer.render(this.waypointScene,this.worldRenderer.camera))}addWaypoint(t,e,i,r,s={}){this.removeWaypoint(t);let o=s.color??16711680,{label:a,metadata:v}=s,l=s.minDistance??0,c=s.maxDistance??1/0,d=yo({position:new Ot.Vector3(e,i,r),color:o,label:a||t,metadata:v});d.enableOffscreenArrow(!0),d.setArrowParent(this.waypointScene),this.waypointScene.add(d.group),this.waypoints.set(t,{id:t,x:e+.5,y:i+.5,z:r+.5,minDistance:l,maxDistance:c,color:o,label:a,sprite:d})}removeWaypoint(t){let e=this.waypoints.get(t);e&&(this.waypointScene.remove(e.sprite.group),e.sprite.dispose(),this.waypoints.delete(t))}clear(){for(let t of this.waypoints.keys())this.removeWaypoint(t)}testWaypoint(){this.addWaypoint("Test Point",0,70,0,{color:65280,label:"Test Point"}),this.addWaypoint("Spawn",0,64,0,{color:16776960,label:"Spawn"}),this.addWaypoint("Far Point",100,70,100,{color:255,label:"Far Point"}),this.addWaypoint("Far Point 2",180,170,100,{color:255,label:"Far Point 2"}),this.addWaypoint("Far Point 3",1e3,100,1e3,{color:255,label:"Far Point 3"})}getWaypoint(t){return this.waypoints.get(t)}getAllWaypoints(){return[...this.waypoints.values()]}setWaypointColor(t,e){let i=this.waypoints.get(t);i&&(i.sprite.setColor(e),i.color=e)}setWaypointLabel(t,e){let i=this.waypoints.get(t);i&&(i.label=e,i.sprite.setLabel(e))}};x();R();T();k();import*as E0 from"three";import{Vec3 as R5}from"vec3";var A0=class A0{constructor(t){this.worldRenderer=t;u(this,"explosions",new Map);u(this,"particleGeometry");u(this,"particleMaterials",[]);u(this,"testModeTimer");u(this,"explosionCounter",0);this.particleGeometry=new E0.BoxGeometry(A0.DEFAULT_PARTICLE_SIZE,A0.DEFAULT_PARTICLE_SIZE,A0.DEFAULT_PARTICLE_SIZE),this.createParticleMaterials()}createParticleMaterials(){let t=[16711680,65280,255,16776960,16711935,65535,16753920,8388736,16761035,16777215];for(let e of t){let i=new E0.MeshBasicMaterial({color:e,transparent:!0,opacity:1});this.particleMaterials.push(i)}}getRandomMaterial(){return this.particleMaterials[Math.floor(Math.random()*this.particleMaterials.length)]}createExplosion(t,e=1,i,r=A0.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],a=Math.floor(A0.DEFAULT_PARTICLE_COUNT*e),v;if(A0.DEBUG_SHOW_EXPLOSION_CENTER){let c=.5*e,d=new E0.SphereGeometry(c,8,8),f=new E0.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});v=new E0.Mesh(d,f),v.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(t.x,t.y,t.z)}for(let c=0;c<a;c++){let d=Math.random()*Math.PI*2,f=Math.sqrt(Math.random())*A0.VELOCITY_FACTOR*e,m=new R5(f*Math.cos(d),Math.random()*.5-.25,f*Math.sin(d));c<5;let g=i===void 0?this.getRandomMaterial().clone():new E0.MeshBasicMaterial({color:i,transparent:!0,opacity:1}),b=new E0.Mesh(this.particleGeometry,g);b.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(b),b.position.set(t.x,t.y,t.z),c<5;let A={position:t.clone(),velocity:m,color:new E0.Color(g.color),life:1,maxLife:1,mesh:b};o.push(A)}let l={id:s,position:t.clone(),particles:o,startTime:Date.now(),duration:r,size:e,debugSphere:v};return this.explosions.set(s,l),l}createExplosionFacingCamera(t,e=1,i,r=A0.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],a=Math.floor(A0.DEFAULT_PARTICLE_COUNT*e),v;if(A0.DEBUG_SHOW_EXPLOSION_CENTER){let f=.5*e,m=new E0.SphereGeometry(f,8,8),g=new E0.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});v=new E0.Mesh(m,g),v.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(t.x,t.y,t.z)}let l=this.worldRenderer.getCameraPosition(),c=new R5(l.x-t.x,l.y-t.y,l.z-t.z).normalize();for(let f=0;f<a;f++){let m=Math.random()*Math.PI*2,g=Math.sqrt(Math.random())*A0.VELOCITY_FACTOR*e,b=new R5(g*Math.cos(m),g*Math.sin(m),0),A=new R5(b.x*c.x-b.z*c.z,b.y,b.x*c.z+b.z*c.x);f<5;let _=i===void 0?this.getRandomMaterial().clone():new E0.MeshBasicMaterial({color:i,transparent:!0,opacity:1}),w=new E0.Mesh(this.particleGeometry,_);w.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(w),w.position.set(t.x,t.y,t.z);let M={position:t.clone(),velocity:A,color:new E0.Color(_.color),life:1,maxLife:1,mesh:w};o.push(M)}let d={id:s,position:t.clone(),particles:o,startTime:Date.now(),duration:r,size:e,debugSphere:v};return this.explosions.set(s,d),d}explode(t,e=1,i,r){return this.createExplosion(t,e,i,r).id}explodeFacingCamera(t,e=1,i,r){return this.createExplosionFacingCamera(t,e,i,r).id}startTestMode(){let t=this.worldRenderer.getCameraPosition(),e=new R5(t.x,t.y+10,t.z);this.testModeTimer=setInterval(()=>{let i=.8+Math.random()*.4,r=[16711680,65280,255,16776960,16711935,65535,16753920],s=r[Math.floor(Math.random()*r.length)];this.explodeFacingCamera(e,i,s)},A0.TEST_INTERVAL)}updateParticle(t,e,i){let r=t.mesh.position.x===t.position.x&&t.mesh.position.y===t.position.y&&t.mesh.position.z===t.position.z;r&&t.life>.95,t.velocity.y+=A0.GRAVITY;let s=t.position.clone(),o=e/1e3;t.position.add(t.velocity.scaled(o)),t.mesh.position.set(t.position.x,t.position.y,t.position.z);let a=t.life;t.life-=e/i;let v=Math.max(0,t.life);if(t.mesh.material instanceof E0.MeshBasicMaterial&&(t.mesh.material.opacity=v),r&&a>.95){let l=t.position.distanceTo(s)}return t.life>0}render(){let t=Date.now(),e=16.67;this.explosions.size>0&&Math.random()<.01;for(let[i,r]of this.explosions.entries()){let s=t-r.startTime;if(s>=r.duration){this.removeExplosion(i);continue}s%2e3<16,r.particles=r.particles.filter(o=>this.updateParticle(o,e,r.duration)),r.particles.length===0&&this.removeExplosion(i)}}removeExplosion(t){let e=this.explosions.get(t);if(e){for(let i of e.particles)this.worldRenderer.sceneOrigin.removeAndUntrack(i.mesh),i.mesh.material instanceof E0.Material&&i.mesh.material.dispose();e.debugSphere&&(this.worldRenderer.sceneOrigin.removeAndUntrack(e.debugSphere),e.debugSphere.geometry.dispose(),e.debugSphere.material instanceof E0.Material&&e.debugSphere.material.dispose()),this.explosions.delete(t)}}stopTestMode(){this.testModeTimer&&(clearInterval(this.testModeTimer),this.testModeTimer=void 0)}destroy(){this.stopTestMode();for(let t of this.explosions.keys())this.removeExplosion(t);for(let t of this.particleMaterials)t.dispose();this.particleGeometry.dispose()}};u(A0,"DEFAULT_PARTICLE_COUNT",50),u(A0,"DEFAULT_PARTICLE_SIZE",.05),u(A0,"DEFAULT_EXPLOSION_DURATION",6e3),u(A0,"GRAVITY",-.005),u(A0,"VELOCITY_FACTOR",1.5),u(A0,"TEST_INTERVAL",1e3),u(A0,"DEBUG_SHOW_EXPLOSION_CENTER",!0),u(A0,"DEBUG_SHOW_PARTICLE_TRAILS",!1);var D1=A0;x();R();T();k();import*as re from"three";import{Vec3 as br}from"vec3";var F1=class n{constructor(t,e,i,r){this.worldRenderer=t;this.updateCamera=e;this.updateFov=i;this.getInitialState=r;u(this,"isRunning",!1);u(this,"currentScript",null);u(this,"currentPointIndex",0);u(this,"currentTweens",[]);u(this,"startTime",0);u(this,"totalDuration",0);u(this,"currentPosition",{x:0,y:0,z:0});u(this,"currentRotation",{yaw:0,pitch:0});u(this,"currentFov",75)}startScript(t){if(this.isRunning||!t.points||t.points.length===0)return!1;this.currentScript=t,this.isRunning=!0,this.currentPointIndex=0,this.startTime=performance.now(),this.totalDuration=t.points.reduce((i,r)=>i+r.duration,0);let e=this.getInitialState();return this.currentPosition={x:e.position.x,y:e.position.y,z:e.position.z},this.currentRotation={yaw:e.yaw,pitch:e.pitch},this.currentFov=e.fov,this.moveToPoint(0),!0}stopScript(){if(this.isRunning){for(let t of this.currentTweens)t.stop();this.currentTweens=[],this.isRunning=!1,this.currentScript=null,this.currentPointIndex=0}}runExampleScripts(t){let e=this.worldRenderer.getCameraPosition(),i=new br(e.x,e.y,e.z),r=n.createCircularFlyby(i,30,20,15e3),s=n.createSpiralDescent(i.offset(0,50,0),i,3,12e3),o=n.createBuildingTour([{pos:i.offset(-20,10,-20),lookAt:i,duration:3e3},{pos:i.offset(20,15,-20),lookAt:i,duration:3e3},{pos:i.offset(20,20,20),lookAt:i,duration:3e3},{pos:i.offset(-20,25,20),lookAt:i,duration:3e3}]),a=[r,s,o];return this.startScript(a[t]),{circular:r,spiral:s,buildingTour:o}}moveToPoint(t){if(!this.currentScript||t>=this.currentScript.points.length){this.handleScriptComplete();return}let e=this.currentScript.points[t],{duration:i}=e,r={x:e.x,y:e.y,z:e.z},s={yaw:e.yaw,pitch:e.pitch},o=e.fov??this.currentFov;if(e.lookAt){let d=new re.Vector3(e.lookAt.x,e.lookAt.y,e.lookAt.z),f=new re.Vector3(e.x,e.y,e.z),m=d.sub(f).normalize();s.yaw=Math.atan2(-m.x,-m.z),s.pitch=Math.asin(m.y)}let a=this.getEasingFunction(e.easing||"easeInOut"),v=new O0(this.currentPosition).to(r,i).easing(a).onUpdate(()=>{this.updateCamera(new br(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),l=new O0(this.currentRotation).to(this.wrapRotation(s),i).easing(a).onUpdate(()=>{this.updateCamera(new br(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),c=null;if(Math.abs(o-this.currentFov)>.1){let d={fov:this.currentFov};c=new O0(d).to({fov:o},i).easing(a).onUpdate(()=>{this.currentFov=d.fov,this.updateFov(this.currentFov)})}this.currentTweens=[v,l],c&&this.currentTweens.push(c),v.start(),l.start(),c?.start(),v.onComplete(()=>{this.currentPointIndex++,this.currentScript?.onPointReached?.(t,e),this.isRunning&&this.moveToPoint(this.currentPointIndex)})}wrapRotation(t){let e=t.yaw,i=e-this.currentRotation.yaw;i>Math.PI?e-=2*Math.PI:i<-Math.PI&&(e+=2*Math.PI);let r=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,t.pitch));return{yaw:e,pitch:r}}getEasingFunction(t){switch(t){case"linear":return I0.Linear.None;case"easeIn":return I0.Quadratic.In;case"easeOut":return I0.Quadratic.Out;case"easeInOut":return I0.Quadratic.InOut;case"smoothstep":return I0.Cubic.InOut;case"bounce":return I0.Bounce.Out;default:return I0.Quadratic.InOut}}handleScriptComplete(){if(!this.currentScript)return;let t=this.currentScript;t.loop?(this.currentPointIndex=0,this.moveToPoint(0)):(t.onComplete?.(),this.stopScript())}get running(){return this.isRunning}get progress(){if(!this.isRunning||this.totalDuration===0)return 0;let t=performance.now()-this.startTime;return Math.min(t/this.totalDuration,1)}get currentScriptName(){return this.currentScript?.name}static createCircularFlyby(t,e,i,r){let s=[];for(let a=0;a<=8;a++){let v=a/8*Math.PI*2,l=t.x+Math.cos(v)*e,c=t.z+Math.sin(v)*e,d=t.y+i;s.push({x:l,y:d,z:c,yaw:v+Math.PI/2,pitch:-.2,duration:r/8,easing:"smoothstep",lookAt:{x:t.x,y:t.y,z:t.z}})}return{name:"Circular Flyby",points:s,loop:!1}}static createSpiralDescent(t,e,i,r){let s=[],o=i*8,a=20;for(let v=0;v<=o;v++){let l=v/o,c=l*i*Math.PI*2,d=re.MathUtils.lerp(t.x,e.x,l)+Math.cos(c)*a*(1-l),f=re.MathUtils.lerp(t.z,e.z,l)+Math.sin(c)*a*(1-l),m=re.MathUtils.lerp(t.y,e.y,l);s.push({x:d,y:m,z:f,yaw:c+Math.PI/2,pitch:-.3*l,duration:r/o,easing:"easeInOut"})}return{name:"Spiral Descent",points:s,loop:!1}}static createBuildingTour(t){return{name:"Building Tour",points:t.map((i,r)=>({x:i.pos.x,y:i.pos.y,z:i.pos.z,yaw:0,pitch:0,duration:i.duration||3e3,easing:"smoothstep",lookAt:i.lookAt?{x:i.lookAt.x,y:i.lookAt.y,z:i.lookAt.z}:void 0})),loop:!1}}};x();R();T();k();import*as t0 from"three";var yr=.75,L1=class{constructor(t,e,i){this.scene=t;this.defaultSkybox=e;this.initialImage=i;u(this,"texture",null);u(this,"mesh",null);u(this,"skyMesh",null);u(this,"voidMesh",null);u(this,"worldTime",0);u(this,"partialTicks",0);u(this,"viewDistance",4);u(this,"temperature",yr);u(this,"inWater",!1);u(this,"waterBreathing",!1);u(this,"fogBrightness",0);u(this,"prevFogBrightness",0);u(this,"fogOrangeness",0);u(this,"distanceFactor",2.7);u(this,"brightnessAtPosition",1);u(this,"debugGui");this.debugGui=new At("skybox_renderer",this,["temperature","worldTime","inWater","waterBreathing","fogOrangeness","brightnessAtPosition","distanceFactor"],{brightnessAtPosition:{min:0,max:1,step:.01},temperature:{min:0,max:1,step:.01},worldTime:{min:0,max:24e3,step:1},fogOrangeness:{min:-1,max:1,step:.01},distanceFactor:{min:0,max:5,step:.01}}),i||this.createGradientSky()}async init(){this.initialImage&&await this.setSkyboxImage(this.initialImage)}async setSkyboxImage(t){this.texture&&this.texture.dispose();let e=new t0.TextureLoader;if(this.texture=await new Promise(i=>{e.load(t,r=>{r.mapping=t0.EquirectangularReflectionMapping,r.encoding=t0.sRGBEncoding,r.minFilter=t0.NearestFilter,r.magFilter=t0.NearestFilter,r.needsUpdate=!0,i(r)})}),this.mesh)this.mesh.material.map=this.texture,this.mesh.material.needsUpdate=!0;else{let i=new t0.SphereGeometry(500,60,40);i.scale(-1,1,1);let r=new t0.MeshBasicMaterial({map:this.texture,side:t0.FrontSide});this.mesh=new t0.Mesh(i,r),this.scene.add(this.mesh)}}update(t,e){e!==this.viewDistance&&(this.viewDistance=e,this.updateSkyColors()),this.mesh?this.mesh.position.set(0,0,0):this.skyMesh&&(this.skyMesh.position.set(0,0,0),this.voidMesh?.position.set(0,0,0),this.updateSkyColors())}updateTime(t,e=0){this.debugGui.visible||(this.worldTime=t,this.partialTicks=e,this.updateSkyColors())}updateViewDistance(t){this.viewDistance=t,this.updateSkyColors()}updateTemperature(t){this.debugGui.visible||(this.temperature=t,this.updateSkyColors())}updateWaterState(t,e){this.debugGui.visible||(this.inWater=t,this.waterBreathing=e,this.updateSkyColors())}updateDefaultSkybox(t){this.debugGui.visible||(this.defaultSkybox=t,this.updateSkyColors())}createGradientSky(){{let i=new t0.PlaneGeometry(768,768);i.rotateX(-Math.PI/2),i.translate(0,16,0);let r=new t0.MeshBasicMaterial({color:16777215,side:t0.DoubleSide,depthTest:!1});this.skyMesh=new t0.Mesh(i,r),this.scene.add(this.skyMesh)}{let i=new t0.PlaneGeometry(768,768);i.rotateX(-Math.PI/2),i.translate(0,-16,0);let r=new t0.MeshBasicMaterial({color:16777215,side:t0.DoubleSide,depthTest:!1});this.voidMesh=new t0.Mesh(i,r),this.scene.add(this.voidMesh)}this.updateSkyColors()}getFogColor(t=0){let e=this.getCelestialAngle(t),i=Math.cos(e*Math.PI*2)*2+.5;i=Math.max(0,Math.min(1,i));let r=.7529412,s=.84705883,o=1;return r*=i*.94+.06,s*=i*.94+.06,o*=i*.91+.09,new t0.Vector3(r,s,o)}getSkyColor(t=0,e=0,i=0){let r=this.getCelestialAngle(i),s=Math.cos(r*3.141593*2)*2+.5;s<0&&(s=0),s>1&&(s=1);let o=this.getTemperature(t,e),a=this.getSkyColorByTemp(o),v=(a>>16&255)/255,l=(a>>8&255)/255,c=(a&255)/255;return new t0.Vector3(v*s,l*s,c*s)}calculateCelestialAngle(t,e){let r=(t%24e3+e)/24e3-.25;return r<0&&r++,r>1&&r--,r=1-(Math.cos(r*Math.PI)+1)/2,r+=(r-r)/3,r}getCelestialAngle(t){return this.calculateCelestialAngle(this.worldTime,t)}getTemperature(t,e){return this.temperature}getSkyColorByTemp(t){t/=3,t<-1&&(t=-1),t>1&&(t=1);let e=.6222222-t*.05,r=this.fogOrangeness>0?e+(.12-e)*this.fogOrangeness*.8:e+this.fogOrangeness*.1,s=.5+t*.1+Math.abs(this.fogOrangeness)*.3;return this.hsbToRgb(r,s,1)}hsbToRgb(t,e,i){let r=0,s=0,o=0;if(e===0)r=s=o=Math.floor(i*255+.5);else{let a=(t-Math.floor(t))*6,v=a-Math.floor(a),l=i*(1-e),c=i*(1-e*v),d=i*(1-e*(1-v));switch(Math.floor(a)){case 0:r=Math.floor(i*255+.5),s=Math.floor(d*255+.5),o=Math.floor(l*255+.5);break;case 1:r=Math.floor(c*255+.5),s=Math.floor(i*255+.5),o=Math.floor(l*255+.5);break;case 2:r=Math.floor(l*255+.5),s=Math.floor(i*255+.5),o=Math.floor(d*255+.5);break;case 3:r=Math.floor(l*255+.5),s=Math.floor(c*255+.5),o=Math.floor(i*255+.5);break;case 4:r=Math.floor(d*255+.5),s=Math.floor(l*255+.5),o=Math.floor(i*255+.5);break;case 5:r=Math.floor(i*255+.5),s=Math.floor(l*255+.5),o=Math.floor(c*255+.5);break}}return 4278190080|r<<16|s<<8|Math.trunc(o)}updateSkyColors(){if(!this.skyMesh||!this.voidMesh)return;if(!this.defaultSkybox){this.skyMesh.visible=!1,this.voidMesh.visible=!1,this.mesh&&(this.mesh.visible=!1);return}this.skyMesh.visible=!0,this.voidMesh.visible=!0,this.mesh&&(this.mesh.visible=!0),this.prevFogBrightness=this.fogBrightness;let t=this.viewDistance/32,e=this.brightnessAtPosition*(1-t)+t;if(this.fogBrightness+=(e-this.fogBrightness)*.1,this.inWater){let g=this.waterBreathing?100:5;this.scene.fog=new t0.Fog(new t0.Color(0,0,1),.0025,g),this.scene.background=new t0.Color(0,0,1),this.skyMesh.material.color.set(new t0.Color(0,0,1)),this.voidMesh.material.color.set(new t0.Color(0,0,.6));return}let i=this.viewDistance*16,r=1-(.25+.75*this.viewDistance/32)**.25,s=this.getCelestialAngle(this.partialTicks),o=this.getSkyColor(0,0,this.partialTicks),a=this.getFogColor(this.partialTicks),v=Math.cos(s*Math.PI*2)*2+.5,l=Math.max(0,Math.min(1,v)),c=this.prevFogBrightness+(this.fogBrightness-this.prevFogBrightness)*this.partialTicks,d=(a.x+(o.x-a.x)*r)*l*c,f=(a.y+(o.y-a.y)*r)*l*c,m=(a.z+(o.z-a.z)*r)*l*c;this.scene.background=new t0.Color(d,f,m),this.scene.fog=new t0.Fog(new t0.Color(d,f,m),.0025,i*this.distanceFactor),this.skyMesh.material.color.set(new t0.Color(o.x,o.y,o.z)),this.voidMesh.material.color.set(new t0.Color(o.x*.2+.04,o.y*.2+.04,o.z*.6+.1))}dispose(){this.texture&&this.texture.dispose(),this.mesh&&(this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.scene.remove(this.mesh)),this.skyMesh&&(this.skyMesh.geometry.dispose(),this.skyMesh.material.dispose(),this.scene.remove(this.skyMesh)),this.voidMesh&&(this.voidMesh.geometry.dispose(),this.voidMesh.material.dispose(),this.scene.remove(this.voidMesh))}};x();R();T();k();import*as i0 from"three";var T4=`
|
|
21185
|
+
f 71/216/54 68/215/54 67/214/54 72/213/54`;var dr={allay:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAV1BMVEUAAAA4jNkuh9Ypg9FBnNpCm9r///+c/P+A/P9k+/9N8/hM6f9Q2f8+5eo94PdG0P821+4s1ewiz/8syf8ox/8bxPNNq+wQwf8os+hCnNpCm9oep9s0h8D7j8AOAAAABnRSTlMAoKCg3PODq/XXAAAA60lEQVR42tWP0W7DIAxFb9OtwdA6xQ3rzZL//84BD0nRljzsZdqxZCx8hLio3Lz4GwtYMWLDi4jnPM+vwogNKTTC43Elr6vgRMQ1wvM5ktsbvRPXN38wGxKHMmnI9M65vgxavwsg2WCpCvlSg6iqlCF4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AABJRU5ErkJggg==",chicken:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgBAMAAABQs2O3AAAALVBMVEUAAAD////i4uL85XDT09PhzGLGxsbgu2nTrlrQqT/Bk0OWcjRjVkH/AAAAAADtfCsnAAAAAXRSTlMAQObYZgAAAO9JREFUeNrtzMFJxFAQxvFZrGAewaMwwxQg2IA7fMzZElQecxZswHZc7CAd2MM72IlJVoXEbATP+7998OMj2kmHW6LXQ9/T0AUt25UuB/D+dgQ317+AXLZ7OgxN4vmJ5vGxforGXhbgSj9ElFqjrxYXomN+GriqmqG1H3E3B7DmQN0A0Wpk0laqKlw2gKv9AdycbRNE1dgA1SOy0hTWQCIrgqaUlnGBqkLY4aeAq0FYfT/OFRBQVGERWQddAKh7ZuFVUCwqorow8166jgVzoBaZWV2FRZS5iM2BYwKwBzEfjJSYg/zOIx7hDk86948+AcUmS5dD8ZFCAAAAAElFTkSuQmCC",cod:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAJFBMVEX///8AAADr2sPWxa3KtJXCqIW2lmusiVmScVqEZVEiHyYAAAB2QJV6AAAAAnRSTlMAAHaTzTgAAACbSURBVHja7coxCsJAEIXh5w18RSRiZQT7sAS8Rgyz2kbYIN5CiDBbx8CewHM6QS3sLf1hivl4yMc626+ZCgKQzENVF6eSsaCVkRCRfCiZhFYwcM4t+13SqFdOwS6/Vw+5HA3qFyz7beOqriX9ezFsKmlcySn4lFKMMQiJGYWwR9VQyTnGmggh3M7eeyGBQ0u4TwZkR/C7P/weVk/OOkCzBdD8ogAAAABJRU5ErkJggg==",creeper:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgCAYAAACinX6EAAAK2klEQVR42tWZ61NU5/3And+L3zTNdDpT08Q0NiamOtFG8cJlQa4uy22vsCzLLrssgtw0KooIMcaqFFFRXOSiQjA11lwIVRF1QRBW7gIuy9H1pLgpM9SZ/hmf7j4zzXT6J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JQ9xvHCBwDCAkGE3r4P4f1bkuxB9ThRFR4FNCVFqQ9zFHp8wr7OX616XBsFUt+vUwbmf6M5ZtI6rYHgwqpfrQ4BUhb6eanv0rpba5dS32G8GwdOT1+f5iYjjQG/PvmHTwE/o5/Q5EFWhVnUNnc9FxBCfChgUd91/et7gDGu9AjgyNHnm8833wIQvgDoe7+A6to9CnQQvgQYgDwCmLqmGwhjS1Bh4scAMiQPgCZnse2zdmqbiHkS2Qm2URG11iEict47T6gAbRObaNvYNjhpbIyxzIsw42War8a4U/M8Nod5vQdibNs4DC0MGzNgpzGlJEiTLfMQUIwYNo68I3WexO2BdgCgQ3awNVlJuzrcGpP5FVkhckCIRLGLuwVaTaopJLyBGuK9gPmptRbfNFMc1qozZfFCglQKoIgDOeagA7Ym3zEOXa7MN1gASBBRlQwZQ96JOBwF4MCeidg5puQ4YMELPNgO5UeXsWVEgAYVJlMALkIBKIAAwHnH0SI8FE2xybddYr5tmzZFJAwAeWYIorcACzE5KC4wBwDLYVgu24gwPeR57KlFHpN1XRsiZgehACKz2wUJ+xnOF7uu/1pcL77Kq6caZUD2/0ZFAk9zM9XrfYvrb1L1TPXvNbFnhwqQEPOKZbVKaZW0aWIpvy+bZVOypUYT7vFx9tGz9zOcFuDN/+gIHIEjcASOwBH44cB/1lQM4ZNhKecAAAAASUVORK5CYII="};x();R();M();k();import*as z0 from"three";var ur=class{constructor(t,e){this.object=t;this.animations=e;u(this,"clock",new z0.Clock);u(this,"animatedObjects",new Set);u(this,"state")}createAnimationState(){let t=new z0.AnimationMixer(this.object),e=new Map;for(let i of this.animations)e.set(i.name,t.clipAction(i));return this.state={mixer:t,animations:this.animations,actions:e,speed:1,loop:!0},this.object.traverse(i=>{if(i instanceof z0.Mesh||i instanceof z0.Line||i instanceof z0.Points||i instanceof z0.Sprite){let r=i.onBeforeRender;i.onBeforeRender=(s,o,a,v,l,c)=>{let d=this.clock.getDelta();t.update(d),r?.(s,o,a,v,l,c)}}}),this.animatedObjects.add(this.object),this.state}playAnimation(t,e,i){let r=this.state.actions.get(t);if(!r)return!1;this.state.mixer.stopAllAction();let s=e??this.state.loop;return r.setLoop(s?z0.LoopRepeat:z0.LoopOnce,1/0),r.clampWhenFinished=!s,i===void 0?r.timeScale=this.state.speed:r.timeScale=i,r.reset().fadeIn(.1).play(),!0}updateAnimationParams(t,e){t!==void 0&&(this.state.speed=t),e!==void 0&&(this.state.loop=e);for(let i of this.state.actions.values())t!==void 0&&(i.timeScale=t),e!==void 0&&(i.setLoop(e?z0.LoopRepeat:z0.LoopOnce,1/0),i.clampWhenFinished=!e)}stopAnimations(){this.state.mixer.stopAllAction()}getDelta(){return this.clock.getDelta()}};function Us(n,t){let e=new ur(n,t);return e.createAnimationState(),e}function L8(n){return"parts"in n&&Array.isArray(n.parts)?n.parts:[n]}var U8={up:{dir:[0,1,0],u0:[0,0,1],v0:[0,0,0],u1:[1,0,1],v1:[0,0,1],corners:[[0,1,1,0,0],[1,1,1,1,0],[0,1,0,0,1],[1,1,0,1,1]]},down:{dir:[0,-1,0],u0:[1,0,1],v0:[0,0,0],u1:[2,0,1],v1:[0,0,1],corners:[[1,0,1,0,0],[0,0,1,1,0],[1,0,0,0,1],[0,0,0,1,1]]},east:{dir:[1,0,0],u0:[0,0,0],v0:[0,0,1],u1:[0,0,1],v1:[0,1,1],corners:[[1,1,1,0,0],[1,0,1,0,1],[1,1,0,1,0],[1,0,0,1,1]]},west:{dir:[-1,0,0],u0:[1,0,1],v0:[0,0,1],u1:[1,0,2],v1:[0,1,1],corners:[[0,1,0,0,0],[0,0,0,0,1],[0,1,1,1,0],[0,0,1,1,1]]},north:{dir:[0,0,-1],u0:[0,0,1],v0:[0,0,1],u1:[1,0,1],v1:[0,1,1],corners:[[1,0,0,0,1],[0,0,0,1,1],[1,1,0,0,0],[0,1,0,1,0]]},south:{dir:[0,0,1],u0:[1,0,2],v0:[0,0,1],u1:[2,0,2],v1:[0,1,1],corners:[[0,0,1,0,1],[1,0,1,1,1],[0,1,1,0,0],[1,1,1,1,0]]}};function Gs(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function G8(n,t,e,i,r=!1,s=64,o=64,a=!1,v=[]){let l=new J.Euler(0,0,0);i.rotation&&(l.x=-i.rotation[0]*Math.PI/180,l.y=-i.rotation[1]*Math.PI/180,l.z=-i.rotation[2]*Math.PI/180);for(let{dir:c,corners:d,u0:f,v0:m,u1:g,v1:b}of Object.values(U8)){let A=Math.floor(n.positions.length/3),_=c[0]!==0,w=[];for(let T of d){let S,C;r?(S=(i.uv[0]+T[3]*i.size[0])/s,C=(i.uv[1]+T[4]*i.size[1])/o):(S=(i.uv[0]+Gs(T[3]?g:f,i.size))/s,C=(i.uv[1]+Gs(T[4]?b:m,i.size))/o);let H=_&&a?T[0]^1:T[0],P=T[1],I=_&&a?T[2]^1:T[2],N=i.inflate??0,O=new J.Vector3(i.origin[0]+H*i.size[0]+(H?N:-N),i.origin[1]+P*i.size[1]+(P?N:-N),i.origin[2]+I*i.size[2]+(I?N:-N));O=O.applyEuler(l),O=O.sub(e.position),O=O.applyEuler(e.rotation),O=O.add(e.position),n.positions.push(O.x,O.y,O.z),n.normals.push(c[0],c[1],c[2]),w.push(S,C),n.skinIndices.push(t,0,0,0),n.skinWeights.push(1,0,0,0)}if(a)for(let T=0;T+1<d.length;T+=2){let S=T*2,C=w.slice(S,S+4);w[S]=C[2],w[S+1]=C[_?1:3],w[S+2]=C[0],w[S+3]=C[_?3:1]}n.uvs.push(...w),n.indices.push(A,A+1,A+2,A+2,A+1,A+3)}}function It(n,t,e,i={},r={}){let s=e.texturewidth??64,o=e.textureheight??64,a,v=t.startsWith("block:"),l=n?.material.map;if(v){if(!n)throw new Error("worldRenderer is required for block textures");let w=t.slice(6),T=n.resourcesManager.currentResources.blocksAtlasJson.textures[w];T&&(s=l?.image.width??s,o=l?.image.height??o,a=[T.u,T.v])}let c={},d={positions:[],normals:[],uvs:[],indices:[],skinIndices:[],skinWeights:[]},f=0;for(let w of e.bones){let T=new J.Bone;if(w.pivot&&(T.position.x=w.pivot[0],T.position.y=w.pivot[1],T.position.z=w.pivot[2]),w.bind_pose_rotation?(T.rotation.x=-w.bind_pose_rotation[0]*Math.PI/180,T.rotation.y=-w.bind_pose_rotation[1]*Math.PI/180,T.rotation.z=-w.bind_pose_rotation[2]*Math.PI/180):w.rotation&&(T.rotation.x=-w.rotation[0]*Math.PI/180,T.rotation.y=-w.rotation[1]*Math.PI/180,T.rotation.z=-w.rotation[2]*Math.PI/180),i.rotation?.[w.name]&&(T.rotation.x-=(i.rotation[w.name].x??0)*Math.PI/180,T.rotation.y-=(i.rotation[w.name].y??0)*Math.PI/180,T.rotation.z-=(i.rotation[w.name].z??0)*Math.PI/180),T.name=`bone_${w.name}`,c[w.name]=T,w.cubes)for(let S of w.cubes){let C=[];G8(d,f,T,S,v,s,o,w.mirror,C),C.length&&(r.errors??(r.errors=[]),r.errors.push(...C.map(H=>`Bone ${w.name}: ${H}`)))}f++}let m=[];for(let w of e.bones)w.parent&&c[w.parent]?c[w.parent].add(c[w.name]):m.push(c[w.name]);let g=new J.Skeleton(Object.values(c)),b=new J.BufferGeometry;b.setAttribute("position",new J.Float32BufferAttribute(d.positions,3)),b.setAttribute("normal",new J.Float32BufferAttribute(d.normals,3)),b.setAttribute("uv",new J.Float32BufferAttribute(d.uvs,2)),b.setAttribute("skinIndex",new J.Uint16BufferAttribute(d.skinIndices,4)),b.setAttribute("skinWeight",new J.Float32BufferAttribute(d.skinWeights,4)),b.setIndex(d.indices);let A=new J.MeshLambertMaterial({transparent:!0,alphaTest:.1,side:J.DoubleSide}),_=new J.SkinnedMesh(b,A);if(_.add(...m),_.bind(g),_.scale.set(1/16,1/16,1/16),a){let w=l.clone();w.offset.set(a[0],a[1]),w.needsUpdate=!0,A.map=w}else $5(t,w=>{A.map||(w.magFilter=J.NearestFilter,w.minFilter=J.NearestFilter,w.flipY=!1,w.wrapS=J.RepeatWrapping,w.wrapT=J.RepeatWrapping,A.map=w)},()=>{let w=A.map.image.width;w&&s!==w&&(A.map.repeat.x=s/w);let T=A.map.image.height;T&&o!==T&&(A.map.repeat.y=o/T),A.needsUpdate=!0});return _}var N8=[{pattern:"furnace_minecart",target:"minecart"},{pattern:"spawner_minecart",target:"minecart"},{pattern:"chest_minecart",target:"minecart"},{pattern:"hopper_minecart",target:"minecart"},{pattern:"command_block_minecart",target:"minecart"},{pattern:"tnt_minecart",target:"minecart"},{pattern:"glow_item_frame",target:"item_frame"},{pattern:"glow_squid",target:"squid"},{pattern:"trader_llama",target:"llama"},{pattern:"chest_boat",target:"boat"},{pattern:"spectral_arrow",target:"arrow"},{pattern:"husk",target:"zombie"},{pattern:"zombie_horse",target:"horse"},{pattern:"donkey",target:"horse"},{pattern:"skeleton_horse",target:"horse"},{pattern:"mule",target:"horse"},{pattern:"ocelot",target:"cat"},{pattern:/_minecraft$/,target:"minecraft"},{pattern:/_boat$/,target:"boat"},{pattern:/_raft$/,target:"boat"},{pattern:/_horse$/,target:"horse"},{pattern:/_zombie$/,target:"zombie"},{pattern:/_arrow$/,target:"zombie"}];function Ns(n){for(let t of N8)if(typeof t.pattern=="string"){if(t.pattern===n)return t.target}else if(t.pattern.test(n))return t.target}var Ws=n=>is[n],Vs={zombie:1.85,husk:1.85,arrow:.0025},W8={zombie:new B1(0,1,0),husk:new B1(0,1,0),boat:new B1(0,-1,0),arrow:new B1(0,-.9,0)},xt=class{constructor(t,e,i,r={},s={}){u(this,"mesh");u(this,"animations");u(this,"animationControllers",[]);let o=e,a=Ns(e);if(a&&(e=a,s.tempMap=a),r.customModel){let l=L8(r.customModel);this.mesh=new J.Object3D;for(let c=0;c<l.length;c++){let{modelPath:d,modelType:f,metadata:m}=l[c],g=new J.Object3D;switch(g.name=`custom_part_${c}`,f){case"gltf":{new I8().parseAsync(d,"").then(A=>{if(g.add(A.scene),m?.scale){let _=m.scale;g.scale.set(_,_,_)}if(m?.offset){let{x:_=0,y:w=0,z:T=0}=m.offset;g.position.set(_,w,T)}if(m?.texture){let _=new J.TextureLoader().load(m.texture);_.minFilter=J.NearestFilter,_.magFilter=J.NearestFilter,g.traverse(w=>{w instanceof J.Mesh&&(w.material=new J.MeshBasicMaterial({map:_,transparent:!0,alphaTest:.1}))})}if(A.animations?.length){this.animations=[...this.animations??[],...A.animations];let _=Us(g,A.animations);this.animationControllers.push(_);let w=m?.animation,T=m?.animationLoop??!0;w?_.playAnimation(w,T):_.playAnimation(A.animations[0].name,T)}}).catch(A=>{});break}case"obj":{let A=new Pe().parse(d);if(m?.scale){let{scale:_}=m;A.scale.set(_,_,_)}if(m?.offset){let{x:_=0,y:w=0,z:T=0}=m.offset;A.position.set(_,w,T)}if(m?.texture){let _=new J.TextureLoader().load(m.texture);_.minFilter=J.NearestFilter,_.magFilter=J.NearestFilter;let w=new J.MeshBasicMaterial({map:_,transparent:!0,alphaTest:.1});A.traverse(T=>{T instanceof J.Mesh&&(T.material=w)})}g.add(A);break}case"bedrock":{let b=JSON.parse(d);if(m?.scale&&g.scale.set(m.scale,m.scale,m.scale),m?.offset){let{x:A=0,y:_=0,z:w=0}=m.offset;g.position.set(A,_,w)}for(let[A,_]of Object.entries(b.geometry)){let w=m?.textures?.[A]??b.textures?.[A];if(!w)continue;let T=It(i,w.endsWith(".png")||w.startsWith("data:image/")||w.startsWith("block:")?w:w+".png",_,r,s);T.name=`geometry_${A}`,g.add(T)}break}}this.mesh.add(g)}s.type=l.length===1?l[0].modelType:"special";return}if(Ie[e]){let l=new Pe,c={zombie_horse:`textures/${t}/entity/horse/horse_zombie.png`,husk:H8,skeleton_horse:`textures/${t}/entity/horse/horse_skeleton.png`,donkey:`textures/${t}/entity/horse/donkey.png`,mule:`textures/${t}/entity/horse/mule.png`,ocelot:O8,arrow:z8,spectral_arrow:D8,tipped_arrow:F8},d=c[o]||c[e];d&&(s.textureMap=!0);let f=d||dr[e];if(dr[e]&&(s.isHardcodedTexture=!0),!f)throw new Error(`No texture for ${e}`);let m=new J.TextureLoader().load(f);m.minFilter=J.NearestFilter,m.magFilter=J.NearestFilter;let g=new J.MeshBasicMaterial({map:m,transparent:!0,alphaTest:.1}),b=l.parse(Ie[e]),A=Vs[o]||Vs[e];A&&b.scale.set(A,A,A);let _=W8[o];_&&b.position.set(_.x,_.y,_.z),b.traverse(w=>{w instanceof J.Mesh&&(w.material=g,w.name==="Head layer"&&(w.visible=!1),w.name==="Head"&&r.rotation?.head&&(w.rotation.x-=(r.rotation.head.x??0)*Math.PI/180,w.rotation.y-=(r.rotation.head.y??0)*Math.PI/180,w.rotation.z-=(r.rotation.head.z??0)*Math.PI/180))}),this.mesh=b,s.type="obj";return}let v=Ws(e);if(v){this.mesh=new J.Object3D;for(let[l,c]of Object.entries(v.geometry)){let d=r.textures?.[l]??v.textures[l];if(!d)continue;let f=It(i,d.endsWith(".png")||d.startsWith("data:image/")||d.startsWith("block:")?d:d+".png",c,r,s);f.name=`geometry_${l}`,this.mesh.add(f)}s.type="bedrock"}}playAnimation(t,e=!1){if(!this.animationControllers.length)return;let i=!1;for(let r of this.animationControllers)r.playAnimation(t,e)&&(i=!0)}update(t){}static getStaticData(t){if(t=Ns(t)||t,Ie[t])return{boneNames:[]};let e=Ws(t);if(!e)throw new Error(`Unknown entity ${t}`);return{boneNames:Object.values(e.geometry).flatMap(i=>i.name)}}};globalThis.EntityMesh=xt;x();R();M();k();var He=n=>Math.max(0,Math.min(1,n)),js=(n,t,e)=>Math.max(t,Math.min(e,n)),tt=(n,t,e)=>n+(t-n)*e,j8=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function Y8(n){let t=n?.elytra;if(!t)return;if(typeof t.updateRightWing=="function"){t.updateRightWing();return}if(typeof t.updateRightWingRotation=="function"){t.updateRightWingRotation();return}let e=t.leftWing,i=t.rightWing;!e?.rotation||!i?.rotation||typeof i.rotation.copy=="function"&&(i.rotation.copy(e.rotation),i.rotation.z*=-1)}var P1=class extends g1{constructor(){super(...arguments);u(this,"switchAnimationCallback");u(this,"isRunning",!1);u(this,"isMoving",!0);u(this,"isCrouched",!1);u(this,"moveAmount",0);u(this,"runAmount",0);u(this,"lookYaw",0);u(this,"lookPitch",0);u(this,"_dt",0);u(this,"_phase",0);u(this,"_idlePhase",0);u(this,"_moveBlend",0);u(this,"_runBlend",0);u(this,"_crouchBlend",0);u(this,"_lookYawBlend",0);u(this,"_lookPitchBlend",0);u(this,"_swingTime",null);u(this,"_swingDuration",.25);u(this,"_defaults",null)}update(e,i){this._dt=i,super.update(e,i)}swingArm(){this._swingTime=0}resetLocomotion(){this._moveBlend=0,this._runBlend=0,this._crouchBlend=0,this._phase=0}_captureDefaults(e){let i=e?.skin;this._defaults={playerRot:e?.rotation?.clone?.(),bodyPos:i?.body?.position?.clone?.(),bodyRot:i?.body?.rotation?.clone?.(),leftArmPos:i?.leftArm?.position?.clone?.(),leftArmRot:i?.leftArm?.rotation?.clone?.(),rightArmPos:i?.rightArm?.position?.clone?.(),rightArmRot:i?.rightArm?.rotation?.clone?.(),leftLegPos:i?.leftLeg?.position?.clone?.(),leftLegRot:i?.leftLeg?.rotation?.clone?.(),rightLegPos:i?.rightLeg?.position?.clone?.(),rightLegRot:i?.rightLeg?.rotation?.clone?.(),headPos:i?.head?.position?.clone?.(),headRot:i?.head?.rotation?.clone?.(),capePos:e?.cape?.position?.clone?.(),capeRot:e?.cape?.rotation?.clone?.(),elytraPos:e?.elytra?.position?.clone?.(),elytraRot:e?.elytra?.rotation?.clone?.()}}_applyDefaults(e){let i=this._defaults;if(!i)return;let r=e?.skin,s=e?.cape,o=e?.elytra;i.playerRot&&e?.rotation&&e.rotation.copy(i.playerRot),i.bodyPos&&r?.body?.position&&r.body.position.copy(i.bodyPos),i.bodyRot&&r?.body?.rotation&&r.body.rotation.copy(i.bodyRot),i.leftArmPos&&r?.leftArm?.position&&r.leftArm.position.copy(i.leftArmPos),i.leftArmRot&&r?.leftArm?.rotation&&r.leftArm.rotation.copy(i.leftArmRot),i.rightArmPos&&r?.rightArm?.position&&r.rightArm.position.copy(i.rightArmPos),i.rightArmRot&&r?.rightArm?.rotation&&r.rightArm.rotation.copy(i.rightArmRot),i.leftLegPos&&r?.leftLeg?.position&&r.leftLeg.position.copy(i.leftLegPos),i.leftLegRot&&r?.leftLeg?.rotation&&r.leftLeg.rotation.copy(i.leftLegRot),i.rightLegPos&&r?.rightLeg?.position&&r.rightLeg.position.copy(i.rightLegPos),i.rightLegRot&&r?.rightLeg?.rotation&&r.rightLeg.rotation.copy(i.rightLegRot),i.headPos&&r?.head?.position&&r.head.position.copy(i.headPos),i.headRot&&r?.head?.rotation&&r.head.rotation.copy(i.headRot),i.capePos&&s?.position&&s.position.copy(i.capePos),i.capeRot&&s?.rotation&&s.rotation.copy(i.capeRot),i.elytraPos&&o?.position&&o.position.copy(i.elytraPos),i.elytraRot&&o?.rotation&&o.rotation.copy(i.elytraRot)}animate(e){let i=this._dt||0;this._defaults||this._captureDefaults(e),this._applyDefaults(e);let r=typeof this.moveAmount=="number"?this.moveAmount:this.isMoving?1:0,s=typeof this.runAmount=="number"?this.runAmount:this.isRunning?1:0,o=He(r),a=He(s),v=this.isCrouched?1:0,l=Math.min(1,i*8),c=Math.min(1,i*6),d=Math.min(1,i*7);this._moveBlend+=(o-this._moveBlend)*l,this._runBlend+=(a-this._runBlend)*c,this._crouchBlend+=(v-this._crouchBlend)*d;let f=He(this._moveBlend),m=He(this._runBlend),g=He(this._crouchBlend),b=tt(8,10,m),A=tt(1,.55,g),_=b*A;this._phase+=i*_*f,this._phase+=i*_*f,this._idlePhase+=i*1.15;let w=this._phase+(m>.5?Math.PI*.5:0);if(this.switchAnimationCallback&&Math.abs(Math.sin(w))<.02){let O=this.switchAnimationCallback;this.switchAnimationCallback=null,O?.()}K8(e,g);let T=80*Math.PI/180,S=75*Math.PI/180,C=js(j8(this.lookYaw||0),-T,T),H=js(this.lookPitch||0,-S,S),P=Math.min(1,i*14);this._lookYawBlend+=(C-this._lookYawBlend)*P,this._lookPitchBlend+=(H-this._lookPitchBlend)*P,e?.skin?.head?.rotation&&(e.skin.head.rotation.y+=this._lookYawBlend,e.skin.head.rotation.x+=this._lookPitchBlend);let I=(1-f)*(1-.25*m);if(I>1e-4&&e?.skin){let N=Math.sin(this._idlePhase);e.skin.body.rotation.x+=N*.02*I,e.skin.head.rotation.x+=-N*.015*I,e.skin.leftArm.rotation.x+=N*.03*I,e.skin.rightArm.rotation.x+=-N*.03*I,e?.cape?.rotation&&(e.cape.rotation.x+=Math.sin(this._idlePhase*.7)*.03*I)}if(f>1e-4&&e?.skin){let N=tt(1,.85,g),O=tt(1,.7,g),j=Math.sin(w)*.5,q=Math.sin(w+Math.PI)*.5,$=Math.cos(w+Math.PI)*1.3,e0=Math.cos(w)*1.3;e.skin.leftLeg.rotation.x+=tt(j,$,m)*f*N,e.skin.rightLeg.rotation.x+=tt(q,e0,m)*f*N;let d0=Math.sin(w+Math.PI)*.5,l0=Math.sin(w)*.5,m0=Math.cos(w)*1.5,p0=Math.cos(w+Math.PI)*1.5;e.skin.leftArm.rotation.x+=tt(d0,m0,m)*f*O,e.skin.rightArm.rotation.x+=tt(l0,p0,m)*f*O;let w0=Math.PI*.02,n0=Math.PI*.1,Y=tt(w0,n0,m),o0=Math.cos(w)*.03+w0,g0=Math.cos(w+Math.PI)*.03-w0,L0=Math.cos(w)*.1+n0,H0=Math.cos(w+Math.PI)*.1-n0;e.skin.leftArm.rotation.z+=(tt(o0,L0,m)*f+Y*.15*f)*O,e.skin.rightArm.rotation.z+=(tt(g0,H0,m)*f-Y*.15*f)*O,this._defaults?.playerRot&&(e.rotation.z=this._defaults.playerRot.z+Math.cos(w+Math.PI)*.01*m*f);let X0=tt(Math.PI*.06,Math.PI*.3,m),u0=tt(Math.sin(w/1.5)*.06,Math.sin(w*2)*.1,m);e?.cape?.rotation&&(e.cape.rotation.x+=(X0+u0)*f)}if(this._swingTime!==null){this._swingTime+=i;let N=Math.min(this._swingTime/this._swingDuration,1);Q8.animate(N,e,f>.2),N>=1&&(this._swingTime=null)}}},Q8={animate(n,t,e){if(!t?.skin?.rightArm?.rotation)return;let i=n*18;if(t.skin.rightArm.rotation.x=-.4537860552*2+2*Math.sin(i+Math.PI)*.3,!e){let r=.01*Math.PI+.06;t.skin.rightArm.rotation.z=-Math.cos(i)*.403+r,t.skin.body.rotation.y=-Math.cos(i)*.06,t.skin.leftArm.rotation.x=Math.sin(i+Math.PI)*.077,t.skin.leftArm.rotation.z=-Math.cos(i)*.015+.13-.05,t.skin.leftArm.position.z=Math.cos(i)*.3,t.skin.leftArm.position.x=5-Math.cos(i)*.05}}};function K8(n,t){let e=n?.skin,i=n?.cape,r=n?.elytra;if(!e||!i)return;let s=He(t),o=Math.abs(Math.sin(s*Math.PI/2));if(o<=1e-6)return;e.body.rotation.x+=.4537860552*o,e.body.position.z+=(1.3256181-3.4500310377)*o,e.body.position.y+=-2.103677462*o,i.position.y+=-1.851236166577372*o,i.rotation.x+=.294220265771*o,i.position.z+=(3.786619432-3.4500310377)*o,r?.position&&r.position.copy(i.position),r?.rotation&&r.rotation.copy(i.rotation),r?.rotation&&(r.rotation.x-=10.8*Math.PI/180),r?.leftWing?.rotation&&(r.leftWing.rotation.z=tt(.72,.26179944+.4582006,o)),Y8(n),e.head.position.y+=-3.618325234674*o;let a=.1*o,v=(3.618325234674-3.4500310377)*o,l=-2.53943318*o;e.leftArm.position.z+=v,e.rightArm.position.z+=v,e.leftArm.rotation.x+=.410367746202*o,e.rightArm.rotation.x+=.410367746202*o,e.leftArm.rotation.z+=a,e.rightArm.rotation.z+=-a,e.leftArm.position.y+=l,e.rightArm.position.y+=l,e.rightLeg.position.z+=-3.4500310377*o,e.leftLeg.position.z+=-3.4500310377*o}x();R();M();k();import{default as q8}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_1.png";import{default as Z8}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_2.png";import{default as X8}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_1.png";import{default as $8}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_2.png";import{default as t4}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_1.png";import{default as e4}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_2.png";import{default as i4}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_1.png";import{default as r4}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_2.png";import{default as n4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1.png";import{default as s4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1_overlay.png";import{default as o4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2.png";import{default as a4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2_overlay.png";import{default as v4}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_1.png";import{default as l4}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_2.png";import{default as c4}from"mc-assets/dist/other-textures/latest/models/armor/turtle_layer_1.png";import{default as Qs}from"mc-assets/dist/other-textures/latest/entity/elytra.png";var Ht={skull:{bones:[{name:"head",pivot:[0,12,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0],inflate:1}]},{name:"overlay",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[32,0],inflate:1.2}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},head:{bones:[{name:"armor",pivot:[0,12,0]},{name:"head",parent:"armor",pivot:[0,12,0],cubes:[{origin:[-4,23,-4],size:[8,8,8],uv:[0,0],inflate:1}]},{name:"overlay",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,23,-4],size:[8,8,8],uv:[32,0],inflate:1.2}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},chest:{bones:[{name:"armor",pivot:[0,12,0]},{name:"body",parent:"armor",pivot:[0,13,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16],inflate:1}]},{name:"leftarm",parent:"armor",pivot:[5,10,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16],inflate:.85}]},{name:"rightarm",parent:"armor",pivot:[-5,10,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16],inflate:.85}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},legs:{bones:[{name:"armor",pivot:[0,12,0]},{name:"body",parent:"armor",pivot:[0,13,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16],inflate:.5}]},{name:"leftleg",parent:"armor",pivot:[1.9,1,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16],inflate:.5}]},{name:"rightleg",parent:"armor",pivot:[-1.9,1,0],cubes:[{origin:[-3.9,0,-2.01],size:[4,12,4],uv:[0,16],inflate:.5}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},feet:{bones:[{name:"armor",pivot:[0,12,0]},{name:"leftleg",parent:"armor",pivot:[1.9,1,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16],inflate:.8}]},{name:"rightleg",parent:"armor",pivot:[-1.9,1,0],cubes:[{origin:[-3.9,.01,-2.01],size:[4,12,4],uv:[0,16],inflate:.8}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32}};var Ys={leather_layer_1:n4,leather_layer_1_overlay:s4,leather_layer_2:o4,leather_layer_2_overlay:a4,chainmail_layer_1:q8,chainmail_layer_2:Z8,iron_layer_1:i4,iron_layer_2:r4,diamond_layer_1:X8,diamond_layer_2:$8,golden_layer_1:t4,golden_layer_2:e4,netherite_layer_1:v4,netherite_layer_2:l4,turtle_layer_1:c4};var M5=St(ut),d4=120,fr=n=>n*(Math.PI/180),hr=n=>Math.max(0,Math.min(1,n)),mr=(n,t,e)=>Math.max(t,Math.min(e,n)),Oe=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function u4(n){return n<0&&(n=4294967295+n+1>>>0),n.toString(16)}function f4(n){if(n===void 0)return;if(parseInt(n,10)===0)return"rgba(0, 0, 0, 0)";let t=u4(parseInt(n,10));return t.length===8?`#${t.slice(2,8)}${t.slice(0,2)}`:`#${t}`}function Ks(n,t){return n===void 0?t:n instanceof W.Quaternion?n:Array.isArray(n)?new W.Quaternion(n[0],n[1],n[2],n[3]):new W.Quaternion(n.x,n.y,n.z,n.w)}function ht(n,t){return n===void 0?t??new W.Euler:n instanceof W.Euler?n:n.yaw!==void 0&&n.pitch!==void 0&&n.roll!==void 0?new W.Euler(-fr(n.pitch),-fr(n.yaw),fr(n.roll),"ZYX"):n.x!==void 0&&n.y!==void 0&&n.z!==void 0?new W.Euler(n.z,n.y,n.x,"ZYX"):Array.isArray(n)?new W.Euler(n[0],n[1],n[2]):t??new W.Euler}var I1=Math.PI*2;function Js(n,t){let e=((t-n)%I1+I1)%I1;return e>Math.PI?e-I1:e}function $s({username:n,nameTagBackgroundColor:t="rgba(0, 0, 0, 0.3)",nameTagTextOpacity:e=255},{fontFamily:i="mojangles"},r){let s=W0(64,64),o=Xs(r),a=s.getContext("2d");if(!a)throw new Error("Could not get 2d context");let v=48,l=5;a.font=`${v}px ${i}`;let c=String(typeof n=="string"?n:new o(n).toString()).split(`
|
|
21186
|
+
`),d=0;for(let m of c){let g=a.measureText(m).width+l*2;g>d&&(d=g)}if(s.width=d,s.height=(v+l)*c.length,a.fillStyle=t,a.fillRect(0,0,s.width,s.height),a.globalAlpha=e/255,!!_i(n,o,s,v,"white",-l+v))return a.globalAlpha=1,s}globalThis.getUsernameTexture=$s;var O1=(n,t,e,i)=>{for(let v of e.children)v.name==="nametag"&&v.removeFromParent();if(n.username===void 0||n.username===null||(typeof n.username=="string"?n.username:new(Xs(i))(n.username).toString()).startsWith("EMPTY"))return;let s=$s(n,t,i);if(!s)return;let o=new W.Texture(s);o.needsUpdate=!0;let a;if(n.nameTagFixed){let v=new W.PlaneGeometry,l=new W.MeshBasicMaterial({map:o});l.transparent=!0,a=new W.Mesh(v,l),a.rotation.set(n.pitch,W.MathUtils.degToRad(n.yaw+180),0),a.position.y+=n.height+.3}else{let v=new W.SpriteMaterial({map:o});a=new W.Sprite(v),a.position.y+=n.height+.6}return a.renderOrder=1e3,a.scale.set(s.width*.005,s.height*.005,1),n.nameTagRotationRight&&a.applyQuaternion(n.nameTagRotationRight),n.nameTagScale&&a.scale.multiply(n.nameTagScale),n.nameTagRotationLeft&&a.applyQuaternion(n.nameTagRotationLeft),n.nameTagTranslation&&a.position.add(n.nameTagTranslation),a.name="nametag",e.add(a),a},qs={},h4=n=>n.charAt(0)===n.charAt(0).toUpperCase();function m4(n,t,e,i,r){if(t.name)try{let l=(h4(t.name)?qi(t.name):t.name).toLowerCase(),c=new xt("1.16.4",l,e,r);if(c.mesh)return O1(t,i,c.mesh,e.version),c.mesh}catch(l){reportError?.(l)}if(!n||!(0,Zs.isEntityAttackable)(n,t))return;let s=new W.BoxGeometry(t.width,t.height,t.width);s.translate(0,t.height/2,0);let o=new W.MeshBasicMaterial({color:16711935}),a=new W.Mesh(s,o);return(qs[t.name]=(qs[t.name]||0)+1)<6&&O1({username:t.name,height:t.height},i,a,e.version),a}var z1=class{constructor(t,e){this.worldRenderer=t;this.mcData=e;u(this,"entities",{});u(this,"playerEntity",null);u(this,"entitiesOptions",{fontFamily:"mojangles"});u(this,"debugMode");u(this,"onSkinUpdate");u(this,"clock",new W.Clock);u(this,"currentlyRendering",!0);u(this,"cachedMapsImages",{});u(this,"itemFrameMaps",{});u(this,"pendingModelOverrides",new Map);u(this,"motionCache",new Map);u(this,"_wasThirdPerson",!1);u(this,"_tpBodyYaw",0);u(this,"_tpHasBodyYaw",!1);u(this,"uuidPerSkinUrlsCache",{});u(this,"currentSkinUrls",{});u(this,"loadedSkinEntityIds",new Set);u(this,"playerPerAnimation",{});this.debugMode="none",this.onSkinUpdate=()=>{},this.watchResourcesUpdates()}updateAutoWalkFlags(t,e,i,r){if(!e.playerObject?.animation)return;let s=e.playerObject.animation;if(i<=0)return;let o=r??e.position,a=this.motionCache.get(t);if(!a){this.motionCache.set(t,{pos:o.clone(),speed:0}),s.isMoving=!1,s.isRunning=!1,s.moveAmount=0,s.runAmount=0;return}let v=o.x-a.pos.x,l=o.z-a.pos.z;a.pos.copy(o);let c=Math.hypot(v,l)/Math.max(i,1e-6),d=1-Math.exp(-i*12);a.speed+=(c-a.speed)*d;let f=a.speed,m=(S,C,H)=>{let P=hr((H-S)/(C-S));return P*P*(3-2*P)},g=.08,b=.6,A=4.3,_=5.6,w=m(g,b,f),T=m(A,_,f);s.moveAmount=w,s.runAmount=T,s.isMoving=w>.15,s.isRunning=T>.55}getLocalSneak(){let t=this.worldRenderer.playerStateReactive;return t?.movementState==="SNEAKING"||t?.movementState==="CROUCHING"||!!t?.isSneaking||!!t?.sneaking||!!t?.isCrouching||!!t?.crouching||!!t?.controls?.sneak||!!t?.controlState?.sneak}updateThirdPersonHeadAndBody(t,e){let i=t.playerObject?.animation,r=this.worldRenderer.cameraShake.getBaseRotation(),s=r.yaw,o=r.pitch,a=hr(i?.moveAmount??(i?.isMoving?1:0)),v=hr(i?.runAmount??(i?.isRunning?1:0)),l=a>.15;if(this._tpHasBodyYaw||(this._tpHasBodyYaw=!0,this._tpBodyYaw=s),l){let g=1-Math.exp(-e*(18+10*v));this._tpBodyYaw=this._tpBodyYaw+Oe(s-this._tpBodyYaw)*g,t.rotation.set(0,this._tpBodyYaw,0);let b=(25-8*v)*Math.PI/180,A=mr(Oe(s-this._tpBodyYaw),-b,b);i&&"lookYaw"in i&&(i.lookYaw=A),i&&"lookPitch"in i&&(i.lookPitch=-o);return}let c=85*Math.PI/180,d=55*Math.PI/180,f=Oe(s-this._tpBodyYaw);f=mr(f,-c,c);let m=Math.abs(f)-d;if(m>0){let g=m/(c-d),b=s-Math.sign(f)*d,A=1-Math.exp(-e*(6+10*g));this._tpBodyYaw=this._tpBodyYaw+Oe(b-this._tpBodyYaw)*A,f=Oe(s-this._tpBodyYaw),f=mr(f,-c,c)}else{let g=1-Math.exp(-e*5);this._tpBodyYaw=this._tpBodyYaw+Oe(s-this._tpBodyYaw)*(g*.15)}t.rotation.set(0,this._tpBodyYaw,0),i&&"lookYaw"in i&&(i.lookYaw=f),i&&"lookPitch"in i&&(i.lookPitch=-o)}get entitiesByName(){let t={};for(let e of Object.values(this.entities))e.realName&&(t[e.realName]=t[e.realName]||[],t[e.realName].push(e));return t}get entitiesRenderingCount(){return Object.values(this.entities).filter(t=>t.visible).length}getDebugString(){let t=Object.keys(this.entities).length,e=this.entitiesRenderingCount,i=Object.values(this.entities).filter(s=>s.playerObject),r=i.filter(s=>s.visible);return`${e}/${t} ${r.length}/${i.length}`}handlePlayerEntity(t){if(!this.playerEntity){let e=new W.Group;e.originalEntity={...t,name:"player"};let i=new W.Group,r=this.setupPlayerObject(t,i,{});e.playerObject=r,e.add(i),e.name="player_entity",this.playerEntity=e,this.worldRenderer.scene.add(e),this.updatePlayerSkin(t.id,t.username,t.uuid??void 0,ut)}this.playerEntity.originalEntity={...t,name:"player"},t.position&&(this.worldRenderer.sceneOrigin.getWorldPosition(this.playerEntity)||this.worldRenderer.sceneOrigin.track(this.playerEntity),this.playerEntity.position.set(t.position.x,t.position.y,t.position.z)),t.yaw!==void 0&&(this.playerEntity.rotation.y=t.yaw),this.updateEntityEquipment(this.playerEntity,t)}clear(){for(let t of Object.values(this.entities))this.worldRenderer.sceneOrigin.removeAndUntrack(t),x0(t);this.entities={},this.currentSkinUrls={},this.motionCache.clear(),this._wasThirdPerson=!1,this._tpHasBodyYaw=!1,this.playerEntity&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.playerEntity),x0(this.playerEntity),this.playerEntity=null)}reloadEntities(){for(let t of Object.values(this.entities))this.update({...t.originalEntity,delete:!0},{}),this.update(t.originalEntity,{})}watchResourcesUpdates(){this.worldRenderer.resourcesManager.on("assetsTexturesUpdated",()=>this.reloadEntities()),this.worldRenderer.resourcesManager.on("assetsInventoryReady",()=>this.reloadEntities())}setDebugMode(t,e=null){this.debugMode=t;for(let i of e?[e]:Object.values(this.entities)){let r=i.children.find(s=>s.name==="debug");r.visible=!1,this.debugMode==="basic"&&(r.visible=!0)}}setRendering(t,e=null){this.currentlyRendering=t;for(let i of e?[e]:Object.values(this.entities))t?this.worldRenderer.scene.children.includes(i)||this.worldRenderer.scene.add(i):this.worldRenderer.scene.remove(i)}playEntityModelAnimation(t,e,i=!1){let r=this.entities[t];r&&r.traverse(s=>{s instanceof xt&&s.playAnimation(e,i)})}render(){let t=this.worldRenderer.worldRendererConfig.renderEntities;t!==this.currentlyRendering&&this.setRendering(t);let e=this.clock.getDelta(),i=Math.min(e,1/30),r=this.worldRenderer.viewerChunkPosition,s=10*10,o=this.worldRenderer.playerStateUtils.isThirdPerson();if(o!==this._wasThirdPerson){this._wasThirdPerson=o;let a=String(this.playerEntity?.originalEntity.id??"player_entity");this.motionCache.delete(a);let v=this.playerEntity?.playerObject?.animation;v?.resetLocomotion&&v.resetLocomotion(),this._tpHasBodyYaw=!1}for(let[a,v]of[...Object.entries(this.entities),["player_entity",this.playerEntity]]){if(!v)continue;let l=a==="player_entity",c=String(l?this.playerEntity?.originalEntity.id??"player_entity":a);if(l)if(v.visible=o,o){let f=this.worldRenderer.playerStateReactive.eyeHeight;v.position.set(this.worldRenderer.cameraWorldPos.x,this.worldRenderer.cameraWorldPos.y-f,this.worldRenderer.cameraWorldPos.z);let m=this.worldRenderer.playerStateReactive.position;if(m&&typeof m.x=="number")this.updateAutoWalkFlags(c,v,e,new W.Vector3(m.x,m.y,m.z));else{let g=this.worldRenderer.sceneOrigin.getWorldPosition(v);this.updateAutoWalkFlags(c,v,e,g?new W.Vector3(g.x,g.y,g.z):v.position)}this.updateThirdPersonHeadAndBody(v,i)}else{let f=this.worldRenderer.sceneOrigin.getWorldPosition(v);this.updateAutoWalkFlags(c,v,e,f?new W.Vector3(f.x,f.y,f.z):v.position)}else{let f=this.worldRenderer.sceneOrigin.getWorldPosition(v);this.updateAutoWalkFlags(c,v,e,f?new W.Vector3(f.x,f.y,f.z):v.position)}let{playerObject:d}=v;if(d?.animation){let f=d.animation,g=(Number(v.originalEntity?.metadata?.[0]??0)&2)!==0,b=this.getLocalSneak();"isCrouched"in f&&(f.isCrouched=l?b:g),d.animation.update(d,i)}if(v.traverse(f=>{f instanceof xt&&f.update(i)}),!l&&r&&v.position){let f=v.position.x-r.x,m=v.position.y-r.y,g=v.position.z-r.z,b=f*f+m*m+g*g;v.visible=!!(b<s||this.worldRenderer.shouldObjectVisible(v)),this.maybeRenderPlayerSkin(a)}v.visible&&this.syncArmorPositions(v)}}syncArmorPositions(t){t.playerObject&&t.traverse(e=>{if(!e.name.startsWith("geometry_armor_"))return;let{skin:i}=t.playerObject;switch(e.name){case"geometry_armor_head":e.children[0]?.children[0]&&e.children[0].children[0].rotation.set(-i.head.rotation.x,i.head.rotation.y,i.head.rotation.z,i.head.rotation.order);break;case"geometry_armor_legs":e.children[0]&&(e.children[0].children[2]&&e.children[0].children[2].rotation.set(-i.leftLeg.rotation.x,i.leftLeg.rotation.y,i.leftLeg.rotation.z,i.leftLeg.rotation.order),e.children[0].children[1]&&e.children[0].children[1].rotation.set(-i.rightLeg.rotation.x,i.rightLeg.rotation.y,i.rightLeg.rotation.z,i.rightLeg.rotation.order));break;case"geometry_armor_feet":e.children[0]&&(e.children[0].children[0]&&e.children[0].children[0].rotation.set(-i.rightLeg.rotation.x,i.rightLeg.rotation.y,i.rightLeg.rotation.z,i.rightLeg.rotation.order),e.children[0].children[1]&&e.children[0].children[1].rotation.set(-i.leftLeg.rotation.x,i.leftLeg.rotation.y,-i.leftLeg.rotation.z,i.leftLeg.rotation.order));break}})}getPlayerObject(t){return this.playerEntity?.originalEntity.id===t?this.playerEntity?.playerObject:this.entities[t]?.playerObject}isCanvasBlank(t){return!t.getContext("2d")?.getImageData(0,0,t.width,t.height).data.some(e=>e!==0)}async updatePlayerSkin(t,e,i,r,s=void 0){r!==ut&&this.loadedSkinEntityIds.add(String(t)),i&&((typeof r=="string"||typeof s=="string")&&(this.uuidPerSkinUrlsCache[i]={}),typeof r=="string"&&(this.uuidPerSkinUrlsCache[i].skinUrl=r),typeof s=="string"&&(this.uuidPerSkinUrlsCache[i].capeUrl=s),r===!0&&(r=this.uuidPerSkinUrlsCache[i]?.skinUrl??r),s??(s=this.uuidPerSkinUrlsCache[i]?.capeUrl));let a=this.getPlayerObject(t);if(!a)return;if(r===!0){if(!e)return;let l=await Ct(e,"skin");if(!this.getPlayerObject(t)||!l)return;r=l}if(typeof r!="string")throw new Error("Invalid skin url");if(this.currentSkinUrls[String(t)]===r){if(s){if(s===!0&&e){let l=await Ct(e,"cape");if(!this.getPlayerObject(t)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(t,s)}return}r!==ut&&(this.currentSkinUrls[String(t)]=r);let v=this.worldRenderer.worldRendererConfig.renderEars||e==="deadmau5";this.loadAndApplySkin(t,r,v).then(async()=>{if(s){if(s===!0&&e){let l=await Ct(e,"cape");if(!this.getPlayerObject(t)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(t,s)}}),a.cape.visible=!1,s||(a.backEquipment=null,a.elytra.map=null,a.cape.map&&a.cape.map.dispose(),a.cape.map=null)}async loadAndApplySkin(t,e,i){let r=this.getPlayerObject(t);if(r)try{let s;if(r=this.getPlayerObject(t),!r)return;let o,a;if(e===ut){o=await M5;let l=W0(64,64),c=l.getContext("2d");if(!c)throw new Error("Failed to get context");c.drawImage(o.image,0,0),a=l}else{let{canvas:l,image:c}=await Xt(e);s=c,o=new W.CanvasTexture(l),a=l}o.magFilter=W.NearestFilter,o.minFilter=W.NearestFilter,o.needsUpdate=!0,r.skin.map=o,r.skin.modelType=pi(a),r.skin.isCustom=e!==ut;let v;if(s?i&&(v=document.createElement("canvas"),gi(v,s),i=!this.isCanvasBlank(v)):i=!1,i){let l=new W.CanvasTexture(v);l.magFilter=W.NearestFilter,l.minFilter=W.NearestFilter,l.needsUpdate=!0,r.ears.map=l,r.ears.visible=!0}else r.ears.map=null,r.ears.visible=!1;this.onSkinUpdate?.()}catch{}}async loadAndApplyCape(t,e){let i=this.getPlayerObject(t);if(i)try{let{canvas:r,image:s}=await Xt(e);if(i=this.getPlayerObject(t),!i)return;mi(r,s);let o=new W.CanvasTexture(r);o.magFilter=W.NearestFilter,o.minFilter=W.NearestFilter,o.needsUpdate=!0,i.cape.map=o,i.cape.visible=!0,i.elytra.map=o,this.onSkinUpdate?.(),i.backEquipment||(i.backEquipment="cape")}catch{}}debugSwingArm(){let t=Object.values(this.entities).find(i=>i.playerObject?.animation);if(!t||!t.playerObject?.animation)return;let e=t.playerObject.animation;e.swingArm&&e.swingArm()}playAnimation(t,e){let i=String(t);if(this.playerPerAnimation[i]===e)return;if(this.playerPerAnimation[i]=e,t==="player_entity"&&this.playerEntity?.playerObject){let{playerObject:s}=this.playerEntity;if(e==="oneSwing"){s.animation&&s.animation.swingArm&&s.animation.swingArm();return}s.animation&&s.animation.switchAnimationCallback!==void 0&&(s.animation.switchAnimationCallback=()=>{let o=s.animation;o&&(o.isMoving=e==="walking"||e==="running"||e==="crouchWalking",o.isRunning=e==="running",o.isCrouched=e==="crouch"||e==="crouchWalking")});return}let r=this.getPlayerObject(t);if(r){if(e==="oneSwing"){r.animation&&r.animation.swingArm&&r.animation.swingArm();return}r.animation&&r.animation.switchAnimationCallback!==void 0&&(r.animation.switchAnimationCallback=()=>{let s=r.animation;s&&(s.isMoving=e==="walking"||e==="running"||e==="crouchWalking",s.isRunning=e==="running",s.isCrouched=e==="crouch"||e==="crouchWalking")});return}if(this.playerEntity?.playerObject){let{playerObject:s}=this.playerEntity;if(e==="oneSwing"){s.animation&&s.animation.swingArm&&s.animation.swingArm();return}s.animation&&s.animation.switchAnimationCallback!==void 0&&(s.animation.switchAnimationCallback=()=>{let o=s.animation;o&&(o.isMoving=e==="walking"||e==="running"||e==="crouchWalking",o.isRunning=e==="running",o.isCrouched=e==="crouch"||e==="crouchWalking")})}}parseEntityLabel(t){if(t)try{if(t.type==="string")return t.value;let e=typeof t=="string"?R5.default.simplify(R5.default.parse(t)):gr.simplify(t);return Yi(e).map(this.textFromComponent).join("")}catch{return t}}textFromComponent(t){return typeof t=="string"?t:t.text??""}getItemMesh(t,e,i=!1,r){!t.nbt&&t.nbtData&&(t.nbt=t.nbtData);let s=this.worldRenderer.getItemRenderData(t,e);if(!(r&&r===s?.modelName)){if(s&&"resolvedModel"in s){let o=z3(this.worldRenderer.material,s.resolvedModel,s.modelName,this.worldRenderer.resourcesManager.currentResources.worldBlockProvider,this.worldRenderer.resourcesManager.currentResources.mcData),a=1;e["minecraft:display_context"]==="ground"?a=.5:e["minecraft:display_context"]==="thirdperson"&&(a=6),o.scale.set(a,a,a);let v=new W.Group;return v.add(o),{mesh:v,isBlock:!0,modelName:s.modelName}}if(s){let o=s.renderInfo?.texture==="blocks"?this.worldRenderer.material.map:this.worldRenderer.itemsTexture,{u:a,v,su:l,sv:c}=s,m=D3(o,{u:a,v,sizeX:l??1,sizeY:c??1},{faceCamera:i,use3D:!i}),g=1;return e["minecraft:display_context"]==="ground"?g=.5:e["minecraft:display_context"]==="thirdperson"&&(g=6),m.mesh.scale.set(g,g,g),{mesh:m.mesh,isBlock:!1,modelName:s.modelName,cleanup:m.cleanup}}}}setVisible(t,e){e?t.scale.set(1,1,1):t.scale.set(0,0,0)}update(t,e){let i=t.name==="player";(t.name==="zombie_villager"||t.name==="husk")&&(e.texture=`textures/1.16.4/entity/${t.name==="zombie_villager"?"zombie_villager/zombie_villager.png":`zombie/${t.name}.png`}`),t.name==="glow_item_frame"&&(e.textures||(e.textures=[]),e.textures.background="block:glow_item_frame");let r=this.entities[t.id],s=!r;if(t.delete){if(!r)return;r.userData._posTween?.stop(),r.additionalCleanup&&r.additionalCleanup(),r.traverse(m=>{m.additionalCleanup&&m.additionalCleanup()}),this.onRemoveEntity(t),this.worldRenderer.sceneOrigin.removeAndUntrack(r),x0(r),delete this.entities[t.id];return}let o;if(r===void 0){this.beforeEntityAdded(t);let m=new W.Group;if(m.originalEntity=t,t.name==="item"||t.name==="tnt"||t.name==="falling_block"||t.name==="snowball"||t.name==="egg"||t.name==="ender_pearl"||t.name==="experience_bottle"||t.name==="splash_potion"||t.name==="lingering_potion"){let A=t.name==="tnt"||t.type==="projectile"?{name:t.name}:t.name==="falling_block"?{blockState:t.objectData}:t.metadata?.find(_=>typeof _=="object"&&_?.itemCount);if(A){let _=this.getItemMesh(A,{"minecraft:display_context":"ground"},t.type==="projectile");if(_){if(o=_.mesh,t.name==="item"||t.type==="projectile"?(o.scale.set(.5,.5,.5),o.position.set(0,t.name==="item"?.2:.1,0)):(o.scale.set(2,2,2),o.position.set(0,.5,0)),t.name==="item"){let w=new W.Clock;o.onBeforeRender=()=>{let T=w.getDelta();o.rotation.y+=T}}m.additionalCleanup=()=>{_.cleanup&&_.cleanup()}}}}else if(i){let A=new W.Group,_=this.setupPlayerObject(t,A,e);if(m.playerObject=_,o=A,t.username){let w=O1(t,{fontFamily:"mojangles"},A,this.worldRenderer.version);w&&(w.position.y=_.position.y+_.scale.y*16+3,w.scale.multiplyScalar(12))}}else o=m4(this.mcData,t,this.worldRenderer,this.entitiesOptions,{...e,customModel:t.customModel});if(!o)return;o.name="mesh";let g=t.pos??t.position;this.worldRenderer.sceneOrigin.track(m),m.position.set(g.x,g.y,g.z);let b=new W.BoxHelper(o,t.type==="hostile"?16711680:t.type==="mob"?65280:t.type==="player"?255:16753920);b.name="debug",m.add(o),m.add(b),b.visible=!1,this.worldRenderer.scene.add(m),r=m,r.name="entity",r.realName=t.name,this.entities[t.id]=r,i&&this.updatePlayerSkin(t.id,t.username,e?.texture?t.uuid:void 0,e?.texture||ut),this.setDebugMode(this.debugMode,m),this.setRendering(this.currentlyRendering,m),this.afterAddEntity(t)}else o=r.children.find(m=>m.name==="mesh");this.updateEntityEquipment(r,t);let a=to(t,this.mcData),v=(t.metadata?.[0]??0)&32||this.worldRenderer.playerStateReactive.cameraSpectatingEntity===t.id&&this.worldRenderer.playerStateUtils.isSpectator();for(let m of o.children??[])m.name!=="nametag"&&(m.visible=!v);a.baby?r.scale.set(.5,.5,.5):r.scale.set(1,1,1);let l=H1("text_display",t,this.mcData),c=l?.text||a.custom_name_visible&&a.custom_name;if(t.name!=="player"&&c){let m=l&&(l.billboard_render_constraints==="fixed"||!l.billboard_render_constraints),g=l&&!(parseInt(l.style_flags,10)&4)?f4(l.background_color):void 0,b;if(l?.text_opacity){let A=parseInt(l?.text_opacity,10);b=A>0?A:256-A}O1({...t,username:typeof c=="string"?R5.default.simplify(R5.default.parse(c)):gr.simplify(c),nameTagBackgroundColor:g,nameTagTextOpacity:b,nameTagFixed:m,nameTagScale:l?.scale,nameTagTranslation:l&&(l.translation||new W.Vector3(0,0,0)),nameTagRotationLeft:Ks(l?.left_rotation),nameTagRotationRight:Ks(l?.right_rotation)},this.entitiesOptions,o,this.worldRenderer.version)}let d=H1("armor_stand",t,this.mcData);if(d){let m=(parseInt(d.client_flags,10)&1)!==0,g=(parseInt(d.client_flags,10)&4)!==0,b=(parseInt(d.client_flags,10)&8)===0,A=(parseInt(d.client_flags,10)&16)!==0;o.castShadow=!A,o.receiveShadow=!A,m?r.scale.set(.5,.5,.5):r.scale.set(1,1,1),r.traverse(_=>{switch(_.name){case"bone_baseplate":this.setVisible(_,b),_.rotation.y=-r.rotation.y;break;case"bone_head":d.head_pose&&_.setRotationFromEuler(ht(d.head_pose));break;case"bone_body":d.body_pose&&_.setRotationFromEuler(ht(d.body_pose));break;case"bone_rightarm":_.parent?.name!=="bone_armor"&&this.setVisible(_,g),d.left_arm_pose?_.setRotationFromEuler(ht(d.left_arm_pose)):_.setRotationFromEuler(ht({yaw:-10,pitch:-10,roll:0}));break;case"bone_leftarm":_.parent?.name!=="bone_armor"&&this.setVisible(_,g),d.right_arm_pose?_.setRotationFromEuler(ht(d.right_arm_pose)):_.setRotationFromEuler(ht({yaw:10,pitch:-10,roll:0}));break;case"bone_rightleg":d.left_leg_pose?_.setRotationFromEuler(ht(d.left_leg_pose)):_.setRotationFromEuler(ht({yaw:-1,pitch:-1,roll:0}));break;case"bone_leftleg":d.right_leg_pose?_.setRotationFromEuler(ht(d.right_leg_pose)):_.setRotationFromEuler(ht({yaw:1,pitch:1,roll:0}));break}})}let f=H1("item_frame",t,this.mcData);if(f||(f=H1("glow_item_frame",t,this.mcData)),f){let m=f?.item??t.metadata?.[8];if(o.scale.set(1,1,1),o.position.set(0,0,-.5),r.rotation.x=-t.pitch,r.children.find(g=>{if(g.name.startsWith("map_")){x0(g);let b=parseInt(g.name.split("_")[1],10);return this.itemFrameMaps[b]=this.itemFrameMaps[b]?.filter(A=>A!==g),g instanceof W.Mesh&&g.material?.map?.dispose(),!0}else if(g.name==="item")return x0(g),!0;return!1})?.removeFromParent(),m&&(m.itemId??m.blockId??0)!==0){let g=f.rotation??0,b=m.nbtData?.value?.map?.value??m.components?.find(A=>A.type==="map_id")?.data;if(b)o.scale.set(16/12,16/12,1),this.addMapModel(r,b,g);else{let A=this.getItemMesh(m,{"minecraft:display_context":"fixed"});A&&(A.mesh.position.set(0,0,-.05),A.isBlock?A.mesh.scale.set(.25,.25,.25):A.mesh.scale.set(.5,.5,.5),A.mesh.rotateY(Math.PI),A.mesh.rotateZ(-g*Math.PI/4),A.mesh.name="item",r.add(A.mesh))}}}t.username!==void 0&&(r.username=t.username),this.updateNameTagVisibility(r),this.updateEntityPosition(t,s,e)}updateEntityPosition(t,e,i){let r=this.entities[t.id];if(!r)return;let s=e?0:d4;if(t.position){let o=this.worldRenderer.sceneOrigin.getWorldPosition(r)??{x:t.position.x,y:t.position.y,z:t.position.z};r.userData._tweenTarget||(r.userData._tweenTarget={x:o.x,y:o.y,z:o.z}),r.userData._posTween?.stop(),r.userData._posTween=new O0(r.userData._tweenTarget).to({x:t.position.x,y:t.position.y,z:t.position.z},s).onUpdate(()=>{r.position.set(r.userData._tweenTarget.x,r.userData._tweenTarget.y,r.userData._tweenTarget.z)}).start()}if(typeof t.yaw=="number"&&Number.isFinite(t.yaw)){let o=Js(r.rotation.y,t.yaw);new O0(r.rotation).to({y:r.rotation.y+o},s).start()}if(r?.playerObject&&i?.rotation?.head){let{playerObject:o}=r,a=i.rotation.head.y,v=typeof a=="number"&&Number.isFinite(a)?a:t.yaw,l=typeof v=="number"&&typeof t.yaw=="number"&&Number.isFinite(v)&&Number.isFinite(t.yaw)?Js(t.yaw,v):0;o.skin.head.rotation.y=l;let c=i.rotation.head.x;o.skin.head.rotation.x=typeof c=="number"&&Number.isFinite(c)?-c:0}}afterAddEntity(t){}beforeEntityAdded(t){let e=this.pendingModelOverrides.get(t.id.toString());if(e){let{parts:i}=e;t.customModel=i.length===1?i[0]:{parts:i},this.pendingModelOverrides.delete(t.id.toString())}}maybeRenderPlayerSkin(t){let e=this.entities[t];if(t==="player_entity"&&(e=this.playerEntity,t=this.playerEntity?.originalEntity.id),!e||!e.playerObject||!e.visible)return;let i=128,r=this.worldRenderer.getCameraPosition(),s=this.worldRenderer.sceneOrigin.getWorldPosition(e),a=(s?new W.Vector3(s.x,s.y,s.z):e.position.clone().add(new W.Vector3(this.worldRenderer.sceneOrigin.x,this.worldRenderer.sceneOrigin.y,this.worldRenderer.sceneOrigin.z))).distanceTo(r);if(a<i&&a<this.worldRenderer.viewDistance*16){if(this.loadedSkinEntityIds.has(String(t)))return;this.updatePlayerSkin(t,e.playerObject.realUsername,e.playerObject.realPlayerUuid,!0,!0)}}onRemoveEntity(t){this.loadedSkinEntityIds.delete(t.id.toString()),delete this.currentSkinUrls[t.id.toString()],this.motionCache.delete(t.id.toString())}updateMap(t,e){this.cachedMapsImages[t]=e;let i=this.itemFrameMaps[t];if(i&&(i=i.filter(r=>r.parent),this.itemFrameMaps[t]=i,i))for(let r of i)r.material.map=this.loadMap(e),r.material.needsUpdate=!0,r.visible=!0}updateNameTagVisibility(t){let e=this.worldRenderer.playerStateReactive.team,i=t.originalEntity.team,r=i?.nameTagVisibility||"always",s=r==="always"||r==="hideForOwnTeam"&&i?.team!==e?.team||r==="hideForOtherTeams"&&(i?.team===e?.team||e===void 0);t.traverse(o=>{o.name==="nametag"&&(o.visible=s)})}addMapModel(t,e,i){let r=this.cachedMapsImages?.[e],s=null;r&&(s=this.loadMap(r));let o={transparent:!0,alphaTest:.1};s&&(o.map=s);let a=new W.MeshLambertMaterial(o),v=new W.Mesh(new W.PlaneGeometry(1,1),a);v.rotation.set(0,Math.PI,0),t.add(v);let l=!0;t.traverseVisible(c=>{c.name==="geometry_frame"&&(l=!1)}),l?v.position.set(0,0,.499):v.position.set(0,0,.437),v.rotateZ(Math.PI*2-i*Math.PI/2),v.name=`map_${e}`,s||(v.visible=!1),this.itemFrameMaps[e]||(this.itemFrameMaps[e]=[]),this.itemFrameMaps[e].push(v)}loadMap(t){let e=new W.TextureLoader().load(t);return e&&(e.magFilter=W.NearestFilter,e.minFilter=W.NearestFilter,e.needsUpdate=!0),e}addItemModel(t,e,i,r=!1){let s=`bone_${e}item`,o=`custom_item_${e}`;if(t.traverse(v=>{v.name===o&&(v.removeFromParent(),v.additionalCleanup&&v.additionalCleanup())}),!i)return;let a=this.getItemMesh(i,{"minecraft:display_context":"thirdperson"});a?.mesh&&t.traverse(v=>{if(v.name.toLowerCase()===s||v.name===`${e}Arm`){let l=new W.Object3D;l.additionalCleanup=()=>{a.cleanup&&a.cleanup()};let c=a.mesh;l.rotation.z=-Math.PI/16,a.isBlock?l.rotation.y=Math.PI/4:(c.rotation.z=-Math.PI/4,l.rotation.y=Math.PI/2,l.scale.multiplyScalar(2)),r&&(l.position.y=-8,l.position.z=5,l.position.x=e==="left"?1:-1,l.rotation.x=Math.PI),l.add(c),l.name=o,v.add(l)}})}handleDamageEvent(t,e){let i=this.entities[t]?.children.find(r=>r.name==="mesh");i&&i.traverse(r=>{if(r instanceof W.Mesh&&r.material.clone){r.material.clone().dispose(),r.material=r.material.clone();let o=r.material.color.clone();r.material.color.set(16711680),new O0(r.material.color).to(o,500).start()}})}raycastSceneDebug(){let t=new W.Raycaster;return t.setFromCamera(new W.Vector2(0,0),this.worldRenderer.camera),t.intersectObjects(this.worldRenderer.scene.children)[0]?.object}updateEntityModel(t,e,i,r){let s=Array.isArray(e)?e:[{modelPath:e,modelType:i,metadata:r}];this.pendingModelOverrides.set(t,{parts:s});let o=this.entities[t];o&&(this.update({...o.originalEntity,delete:!0},{}),this.update(o.originalEntity,{}))}setupPlayerObject(t,e,i){let r=new h5;r.realPlayerUuid=t.uuid??"",r.realUsername=t.username??"",r.position.set(0,16,0),r.traverse(o=>{o instanceof W.Mesh&&o.material instanceof W.MeshStandardMaterial&&(o.material.transparent=!0)}),e.add(r);let s=1/16;return e.scale.set(s,s,s),e.rotation.set(0,Math.PI,0),r.animation=new P1,r.animation.isMoving=!1,r}updateEntityEquipment(t,e){if(!t||!e.equipment)return;let i=e.type==="player";if(this.addItemModel(t,i?"right":"left",e.equipment[0],i),this.addItemModel(t,i?"left":"right",e.equipment[1],i),k5(this.worldRenderer,t,"feet",e.equipment[2]),k5(this.worldRenderer,t,"legs",e.equipment[3],2),k5(this.worldRenderer,t,"chest",e.equipment[4]),k5(this.worldRenderer,t,"head",e.equipment[5]),i&&t.playerObject){let{playerObject:r}=t;r.backEquipment=e.equipment.some(s=>s?.name==="elytra")?"elytra":"cape",r.backEquipment==="elytra"&&this.loadAndApplyCape(e.id,Qs),r.cape.map===null&&(r.cape.visible=!1)}}};function to(n,t){let e=t?.entitiesByName[n.name];return new Proxy({},{get(i,r,s){if(typeof r!="string"||!e)return;let o=e.metadataKeys?.indexOf(r);return n.metadata?.[o??-1]}})}function H1(n,t,e){if(t.name===n)return to(t,e)}function k5(n,t,e,i,r=1,s=!1){if(!i){pr(t,e);return}let o=i.name.split("_"),a,v=e==="head"&&i.name==="player_head";if(v)if(pr(t,e),i.nbt){let g=gr.simplify(i.nbt);try{let b;if(g.SkullOwner?b=g.SkullOwner.Properties.textures[0]?.Value:b=g["minecraft:profile"]?.Properties?.find(A=>A.name==="textures")?.value,b){a=JSON.parse(F.from(b,"base64").toString()).textures?.SKIN?.url;let{skinTexturesProxy:_}=n.worldRendererConfig;_&&(a=a?.replace("http://textures.minecraft.net/",_).replace("https://textures.minecraft.net/",_))}}catch{}}else a=ut;let l=o[0];if(!a){let g=`${l}_layer_${r}${s?"_overlay":""}`;a=n.resourcesManager.currentResources.customTextures.armor?.textures[g]?.src??Ys[g]}if(!a||!Ht[e]){pr(t,e);return}let c=`geometry_armor_${e}${s?"_overlay":""}`,d=t.children.findLast(g=>g.name===c),f;if(d?(f=d.material,$5(a,g=>{g.magFilter=W.NearestFilter,g.minFilter=W.NearestFilter,g.flipY=!1,g.wrapS=W.MirroredRepeatWrapping,g.wrapT=W.MirroredRepeatWrapping,f.map=g})):(d=It(n,a,Ht[e]),e==="head"&&(d.children[0].position.y+=.01),d.name=c,f=d.material,v||(f.side=W.DoubleSide)),l==="leather"&&!s){let g=i.nbt?.value?.display?.value?.color?.value;if(g){let b=g>>16&255,A=g>>8&255,_=g&255;f.color.setRGB(b/255,A/255,_/255)}else f.color.setHex(11890001);k5(n,t,e,i,r,!0)}else f.color.setHex(16777215);let m=new W.Object3D;m.name=`armor_${e}${s?"_overlay":""}`,m.add(d),t.add(d)}function pr(n,t){for(let e of n.children)(e.name===`geometry_armor_${t}`||e.name===`geometry_armor_${t}_overlay`)&&e.removeFromParent()}var A5=async(n,t)=>{let e;if(!n&&!t)e=await M5;else{if(n||(n=await Ct(t,"skin")),!n)return;let{canvas:l}=await Xt(n);e=new G0.CanvasTexture(l)}e.magFilter=G0.NearestFilter,e.minFilter=G0.NearestFilter;let i=!1,s=p4(40,16,i?-2:-3,-2,-2,i?3:4,12,4,64,64),o=new G0.MeshStandardMaterial;o.map=e,o.needsUpdate=!0;let a=new G0.Mesh(s,o),v=new G0.Group;return v.add(a),v};function p4(n,t,e,i,r,s,o,a,v,l,c=!1){let d=e/16,f=i/16,m=r/16,g=(e+s)/16,b=(i+o)/16,A=(r+a)/16;c&&([d,g]=[g,d]);let _=[[d,f,m],[g,f,m],[g,b,m],[d,b,m],[d,f,A],[g,f,A],[g,b,A],[d,b,A]],w=n,T=n+a,S=n+a+s,C=n+a+s+s,H=n+a+s+a,P=n+a+s+a+s,I=t,N=t+a,O=t+a+o,j=[{vi:[5,4,0,1],uv:[T,I,S,N],n:[0,-1,0]},{vi:[2,3,7,6],uv:[S,N,C,I],n:[0,1,0]},{vi:[0,4,7,3],uv:[w,N,T,O],n:[-1,0,0]},{vi:[1,0,3,2],uv:[T,N,S,O],n:[0,0,-1]},{vi:[5,1,2,6],uv:[S,N,H,O],n:[1,0,0]},{vi:[4,5,6,7],uv:[H,N,P,O],n:[0,0,1]}],q=[],$=[],e0=[],d0=[];for(let m0=0;m0<j.length;m0++){let p0=j[m0],w0=m0*4,[n0,Y,o0,g0]=p0.uv,L0=[[o0/v,1-Y/l],[n0/v,1-Y/l],[n0/v,1-g0/l],[o0/v,1-g0/l]],H0=c?[3,2,1,0]:[0,1,2,3],X0=c?-p0.n[0]:p0.n[0];for(let u0=0;u0<4;u0++){let vt=_[p0.vi[H0[u0]]];q.push(vt[0],vt[1],vt[2]),$.push(L0[u0][0],L0[u0][1]),e0.push(X0,p0.n[1],p0.n[2])}d0.push(w0,w0+1,w0+2,w0,w0+2,w0+3)}let l0=new G0.BufferGeometry;return l0.setAttribute("position",new G0.Float32BufferAttribute(q,3)),l0.setAttribute("uv",new G0.Float32BufferAttribute($,2)),l0.setAttribute("normal",new G0.Float32BufferAttribute(e0,3)),l0.setIndex(d0),l0}x();R();M();k();x();R();M();k();import*as v0 from"three";import{subscribeKey as eo}from"valtio/utils";x();R();M();k();import*as D0 from"three";var br=async(n,t)=>{let e;if(!n&&!t)e=await M5;else{if(n||(n=await Ct(t,"skin")),!n)return;let{canvas:v}=await Xt(n);e=new D0.CanvasTexture(v)}e.magFilter=D0.NearestFilter,e.minFilter=D0.NearestFilter;let i=new D0.BoxGeometry,r=new D0.MeshStandardMaterial,s=!1,o=new D0.Mesh(i,r);o.scale.x=s?3:4,o.scale.y=12,o.scale.z=4,b4(i,40,16,s?3:4,12,4),r.map=e,r.needsUpdate=!0;let a=new D0.Group;return a.add(o),a.scale.set(.1,.1,.1),o.rotation.z=Math.PI,a};function g4(n,t,e,i,r,s,o,a){let v=(P,I,N,O)=>[new D0.Vector2(P/o,1-O/a),new D0.Vector2(N/o,1-O/a),new D0.Vector2(N/o,1-I/a),new D0.Vector2(P/o,1-I/a)],l=v(t+s,e,t+i+s,e+s),c=v(t+i+s,e,t+i*2+s,e+s),d=v(t,e+s,t+s,e+s+r),f=v(t+s,e+s,t+i+s,e+s+r),m=v(t+i+s,e+s,t+i+s*2,e+r+s),g=v(t+i+s*2,e+s,t+i*2+s*2,e+r+s),b=n.attributes.uv,A=[m[3],m[2],m[0],m[1]],_=[d[3],d[2],d[0],d[1]],w=[l[3],l[2],l[0],l[1]],T=[c[0],c[1],c[3],c[2]],S=[f[3],f[2],f[0],f[1]],C=[g[3],g[2],g[0],g[1]],H=[];for(let P of[A,_,w,T,S,C])for(let I of P)H.push(I.x,I.y);b.set(new Float32Array(H)),b.needsUpdate=!0}function b4(n,t,e,i,r,s){g4(n,t,e,i,r,s,64,64)}var io={itemRight:{rotation:[0,-90,25],translation:[1.13,3.2,1.13],scale:[.68,.68,.68]},itemLeft:{rotation:[0,90,-25],translation:[1.13,3.2,1.13],scale:[.68,.68,.68]},blockRight:{rotation:[0,45,0],translation:[0,0,0],scale:[.4,.4,.4]},blockLeft:{rotation:[0,225,0],translation:[0,0,0],scale:[.4,.4,.4]}},T5=class{constructor(t,e=!1){this.worldRenderer=t;this.offHand=e;u(this,"holdingBlock");u(this,"blockSwapAnimation");u(this,"cameraGroup",new v0.Mesh);u(this,"objectOuterGroup",new v0.Group);u(this,"objectInnerGroup",new v0.Group);u(this,"holdingBlockInnerGroup",new v0.Group);u(this,"camera",new v0.PerspectiveCamera(75,1,.1,100));u(this,"stopUpdate",!1);u(this,"lastHeldItem");u(this,"lastHeldItemRenderKey");u(this,"isSwinging",!1);u(this,"nextIterStopCallbacks");u(this,"idleAnimator");u(this,"ready",!1);u(this,"lastUpdate",0);u(this,"playerHand");u(this,"offHandDisplay",!1);u(this,"offHandModeLegacy",!1);u(this,"swingAnimator");u(this,"config");u(this,"disposed",!1);u(this,"unsubs",[]);u(this,"lastItemModelName");u(this,"switchRequest",0);this.initCameraGroup(),this.unsubs.push(eo(this.worldRenderer.playerStateReactive,"heldItemMain",()=>{this.offHand||this.updateItem()})),this.unsubs.push(eo(this.worldRenderer.playerStateReactive,"heldItemOff",()=>{this.offHand&&this.updateItem()})),this.config=t.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||br().then(i=>{this.disposed||(this.playerHand=i,this.updateItem())}).then(()=>{if(this.disposed)return;let i=R1(async()=>br(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",r=>{r&&(this.playerHand=r,this.updateItem())},r=>{x0(r,!0)});this.unsubs.push(i)})}updateItem(){if(!this.ready)return;let t=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;t?this.setNewItem(t):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new v0.Mesh}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(t,e,i,r){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage?this.swingAnimator?.update():this.idleAnimator?.update(),this.blockSwapAnimation?.switcher.update();let o=new v0.Scene;o.add(this.cameraGroup),this.updateCameraGroup(),o.add(i.clone()),o.add(r.clone());let a=e.getSize(new v0.Vector2),v=Math.min(a.width,a.height),l=a.width-v,{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),e.autoClear=!1,e.clearDepth(),this.offHandDisplay)e.setViewport(0,0,v,v);else{let d=a.width-v;e.setViewport(d,0,v,v)}e.render(o,this.camera),e.setViewport(0,0,a.width,a.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(t){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new ne(()=>({y:this.objectInnerGroup.position.y}),(s,o)=>{s==="y"&&(this.objectInnerGroup.position.y=o)},{y:16})});let e=t,i=this.objectInnerGroup.position.y+this.objectInnerGroup.scale.y*1.5*(e==="appeared"?1:-1),r=!1;return new Promise(s=>{this.blockSwapAnimation.switcher.transitionTo({y:i},e,()=>{r||s(!0)},()=>{r=!0,s(!1)})})}isDifferentItem(t){return this.lastHeldItemRenderKey!==Ce(this.worldRenderer,t)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:t}=this;this.cameraGroup.position.copy(t.position),this.cameraGroup.rotation.copy(t.rotation);let e=1,{position:i,scale:r}=this.getHandHeld3d(),s=-i.z,o=this.offHandModeLegacy?-1:1;this.objectOuterGroup.position.set(s*i.x*e*o,s*i.y,-s);let a=r*2.22*.2;this.objectOuterGroup.scale.set(a,a,a)}async createItemModel(t){if(this.lastUpdate=performance.now(),!t||t.type==="hand"&&!this.playerHand)return;let e;if(t.type==="item"||t.type==="block"){let r=this.worldRenderer.entities.getItemMesh({...t.fullItem,itemId:t.id},M1(this.worldRenderer),!1,this.lastItemModelName);if(r){let{mesh:s,isBlock:o,modelName:a}=r;o?(e=s,t.type="block"):(s.position.set(.5,.5,.5),e=s,t.type="item"),this.lastItemModelName=a}}else e=this.playerHand;if(!e)return;e.name="holdingBlock";let i=this.getHandHeld3d().rotation;return e.rotation.x=v0.MathUtils.degToRad(i.x),e.rotation.y=v0.MathUtils.degToRad(i.y),e.rotation.z=v0.MathUtils.degToRad(i.z),{model:e,type:t.type}}async replaceItemModel(t){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!t){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0;return}let e=await this.createItemModel(t);e&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=e.model,this.holdingBlockInnerGroup.add(e.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(t){let e=Ce(this.worldRenderer,t),i=this.lastHeldItemRenderKey!==e;if(this.lastHeldItem=t,!i)return;this.lastHeldItemRenderKey=e,this.lastItemModelName=void 0;let r=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0}if(!t){this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(r!==this.switchRequest)return;let o=await this.createItemModel(t);if(!o||r!==this.switchRequest)return;let a=new v0.Group;this.holdingBlockInnerGroup.removeFromParent(),this.holdingBlockInnerGroup=new v0.Group,this.holdingBlockInnerGroup.add(o.model),a.add(this.holdingBlockInnerGroup),this.holdingBlock=o.model,this.objectInnerGroup=new v0.Group,this.objectInnerGroup.add(a),this.objectInnerGroup.position.set(-.5,-.5,-.5),s&&(this.objectInnerGroup.position.y-=this.objectInnerGroup.scale.y*1.5),Object.assign(a.position,{x:.5,y:.5,z:.5}),this.objectOuterGroup=new v0.Group,this.objectOuterGroup.add(this.objectInnerGroup),this.cameraGroup.add(this.objectOuterGroup);let v=this.getHandHeld3d().rotation;this.objectOuterGroup.rotation.y=v0.MathUtils.degToRad(v.yOuter),s&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator??(this.swingAnimator=new _r(this.holdingBlockInnerGroup)),this.swingAnimator.setHandMesh(this.holdingBlockInnerGroup),this.swingAnimator.type=o.type,this.config.viewBobbing&&(this.idleAnimator=new yr(this.holdingBlockInnerGroup,this.worldRenderer.playerStateReactive))}getHandHeld3d(){let t=this.lastHeldItem?.type??"hand",e=this.offHandModeLegacy?"Left":"Right",i=.8*1.15,r={x:.4,y:-.7,z:-.45},s={x:-32.4,y:42.8,z:-41.3,yOuter:0};if(t==="item"){let o=io[`item${e}`];r={x:-.05,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},i=o.scale[0]*1.15}else if(t==="block"){let o=io[`block${e}`];r={x:.4,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},i=o.scale[0]*1.15}return{rotation:s,position:r,scale:i}}dispose(){this.disposed=!0,this.ready=!1,this.unsubs.forEach(t=>t()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,x0(this.cameraGroup,!0),x0(this.objectOuterGroup,!0),x0(this.objectInnerGroup,!0),x0(this.holdingBlockInnerGroup,!0),this.holdingBlock=void 0,this.playerHand&&(x0(this.playerHand,!0),this.playerHand=void 0)}},yr=class{constructor(t,e){this.handMesh=t;this.playerState=e;u(this,"globalTime",0);u(this,"lastTime",0);u(this,"currentState");u(this,"targetState");u(this,"defaultPosition");u(this,"idleOffset",{y:0,rotationZ:0});u(this,"tween",new ye);u(this,"idleTween",null);u(this,"stateSwitcher");u(this,"debugParams",{walkingSpeed:8,sprintingSpeed:16,walkingAmplitude:{x:1/30,y:1/10,rotationZ:.25},sprintingAmplitude:{x:1/30,y:1/10,rotationZ:.4}});u(this,"debugGui");u(this,"updated",!1);this.handMesh=t,this.globalTime=0,this.currentState="NOT_MOVING",this.targetState="NOT_MOVING",this.defaultPosition={x:t.position.x,y:t.position.y,z:t.position.z,rotationX:t.rotation.x,rotationY:t.rotation.y,rotationZ:t.rotation.z},this.stateSwitcher=new ne(()=>({x:this.handMesh.position.x,y:this.handMesh.position.y,z:this.handMesh.position.z,rotationX:this.handMesh.rotation.x,rotationY:this.handMesh.rotation.y,rotationZ:this.handMesh.rotation.z}),(i,r)=>{switch(i){case"x":this.handMesh.position.x=r;break;case"y":this.handMesh.position.y=r;break;case"z":this.handMesh.position.z=r;break;case"rotationX":this.handMesh.rotation.x=r;break;case"rotationY":this.handMesh.rotation.y=r;break;case"rotationZ":this.handMesh.rotation.z=r;break}},{x:2,y:2,z:2,rotation:Math.PI}),this.debugGui=new Et("idle_animator",this.debugParams)}startIdleAnimation(){this.idleTween&&this.idleTween.stop(),this.idleOffset.y=this.handMesh.position.y-this.defaultPosition.y,this.idleOffset.rotationZ=this.handMesh.rotation.z-this.defaultPosition.rotationZ,this.idleTween=new O0(this.idleOffset,this.tween).to({y:.05,rotationZ:.05},3e3).easing(I0.Sinusoidal.InOut).yoyo(!0).repeat(1/0).start()}stopIdleAnimation(){this.idleTween&&(this.idleTween.stop(),this.idleOffset.y=0,this.idleOffset.rotationZ=0)}getStateTransform(t,e){switch(t){case"NOT_MOVING":case"SNEAKING":return{x:this.defaultPosition.x,y:this.defaultPosition.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ};case"WALKING":case"SPRINTING":{let i=t==="SPRINTING"?this.debugParams.sprintingSpeed:this.debugParams.walkingSpeed,r=t==="SPRINTING"?this.debugParams.sprintingAmplitude:this.debugParams.walkingAmplitude;return{x:this.defaultPosition.x+Math.sin(e*i)*r.x,y:this.defaultPosition.y-Math.abs(Math.cos(e*i))*r.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ}}}}setState(t){if(t===this.targetState)return;this.targetState=t;let e=!1;if(this.currentState!==t){if(this.stopIdleAnimation(),!e){let i=this.getStateTransform(t,this.globalTime);this.stateSwitcher.transitionTo(i,t)}this.currentState=t}}update(){this.stateSwitcher.update();let t=performance.now(),e=(t-this.lastTime)/1e3;if(this.lastTime=t,!this.stateSwitcher.isTransitioning)switch(this.currentState){case"NOT_MOVING":case"SNEAKING":this.globalTime=Math.PI/4;break;case"SPRINTING":case"WALKING":this.globalTime+=e;break}if(this.playerState){let i=this.playerState.movementState;i!==this.targetState&&this.setState(i)}if(!this.stateSwitcher.isTransitioning&&(this.currentState==="NOT_MOVING"||this.currentState==="SNEAKING")&&(this.idleTween?.isPlaying()||this.startIdleAnimation(),this.tween.update(),this.handMesh.position.y=this.defaultPosition.y+this.idleOffset.y,this.handMesh.rotation.z=this.defaultPosition.rotationZ+this.idleOffset.rotationZ),!this.stateSwitcher.isTransitioning&&(this.currentState==="WALKING"||this.currentState==="SPRINTING")){let i=this.getStateTransform(this.currentState,this.globalTime);Object.assign(this.handMesh.position,i),Object.assign(this.handMesh.rotation,{x:i.rotationX,y:i.rotationY,z:i.rotationZ})}}getCurrentState(){return this.currentState}destroy(){this.stopIdleAnimation(),this.stateSwitcher.forceFinish()}},_r=class{constructor(t){this.handMesh=t;u(this,"PI",Math.PI);u(this,"animationTimer",0);u(this,"lastTime",0);u(this,"isAnimating",!1);u(this,"stopRequested",!1);u(this,"originalRotation");u(this,"originalPosition");u(this,"originalScale");u(this,"debugParams",{animationTime:250,animationStage:0,useClassicSwing:!0,itemSwingXPosScale:-.8,itemSwingYPosScale:.2,itemSwingZPosScale:-.2,itemHeightScale:-.6,itemPreswingRotY:45,itemSwingXRotAmount:-30,itemSwingYRotAmount:-35,itemSwingZRotAmount:-5,armSwingXPosScale:-.3,armSwingYPosScale:.4,armSwingZPosScale:-.4,armSwingYRotAmount:70,armSwingZRotAmount:-20,armHeightScale:-.6});u(this,"debugGui");u(this,"type","hand");this.handMesh=t,this.originalRotation=t.rotation.clone(),this.originalPosition=t.position.clone(),this.originalScale=t.scale.clone(),this.debugGui=new Et("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01},itemSwingXPosScale:{min:-2,max:2,step:.1},itemSwingYPosScale:{min:-2,max:2,step:.1},itemSwingZPosScale:{min:-2,max:2,step:.1},itemHeightScale:{min:-2,max:2,step:.1},itemPreswingRotY:{min:-180,max:180,step:5},itemSwingXRotAmount:{min:-180,max:180,step:5},itemSwingYRotAmount:{min:-180,max:180,step:5},itemSwingZRotAmount:{min:-180,max:180,step:5},armSwingXPosScale:{min:-2,max:2,step:.1},armSwingYPosScale:{min:-2,max:2,step:.1},armSwingZPosScale:{min:-2,max:2,step:.1},armSwingYRotAmount:{min:-180,max:180,step:5},armSwingZRotAmount:{min:-180,max:180,step:5},armHeightScale:{min:-2,max:2,step:.1}})}setHandMesh(t){this.handMesh=t,this.originalRotation.copy(t.rotation),this.originalPosition.copy(t.position),this.originalScale.copy(t.scale)}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);return}let t=performance.now(),e=(t-this.lastTime)/1e3;this.lastTime=t,this.animationTimer+=e*1e3;let i=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(i>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);return}this.animationTimer=0;return}this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);let r=i,s=Math.sqrt(r),o=Math.sin(r*this.PI),a=Math.sin(s*this.PI);if(this.type==="hand"){let v=this.debugParams.armSwingXPosScale*a,l=this.debugParams.armSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.armSwingZPosScale*o;this.handMesh.position.x+=v,this.handMesh.position.y+=l+this.debugParams.armHeightScale*r,this.handMesh.position.z+=c,this.handMesh.rotation.y+=v0.MathUtils.degToRad(this.debugParams.armSwingYRotAmount*a),this.handMesh.rotation.z+=v0.MathUtils.degToRad(this.debugParams.armSwingZRotAmount*o)}else{let v=this.debugParams.itemSwingXPosScale*a,l=this.debugParams.itemSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.itemSwingZPosScale*o;this.handMesh.position.x+=v,this.handMesh.position.y+=l+this.debugParams.itemHeightScale*r,this.handMesh.position.z+=c,this.handMesh.rotation.y+=v0.MathUtils.degToRad(this.debugParams.itemPreswingRotY),this.handMesh.rotation.x+=v0.MathUtils.degToRad(this.debugParams.itemSwingXRotAmount*o),this.handMesh.rotation.y+=v0.MathUtils.degToRad(this.debugParams.itemSwingYRotAmount*a),this.handMesh.rotation.z+=v0.MathUtils.degToRad(this.debugParams.itemSwingZRotAmount*o)}}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}};function S5(n,t=!1){return n.displayOptions.inWorldRenderingConfig.handRenderer==="legacy"?new T5(n,t):new w5(n,t)}x();R();M();k();import*as Y0 from"three";import{Vec3 as wr}from"vec3";var ro="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAALUlEQVR42mP4//8/IyWYYdSAwW6Ara3tf4oMmD179n9ChhD0AsiQ0Wgc7AYAAOqH+zNQ3r9kAAAAAElFTkSuQmCC";var no="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOklEQVR42mP4//8/IyWYYdQA3AbY2tr+H1gDZs+e/R9mCD7D8IYBzBAQTXYgEvIKQQPw2T6aEqlkAADEA/W3ycLXvwAAAABJRU5ErkJggg==";var so="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQklEQVR42mP4//8/IyWYYRgbYGtr+39wGQDiYzMUpwGzZ8+GawDRID4IkxSIMEOwaSQ6FgiFBW0NIOR8osJgBOQFALo37sVTOo/LAAAAAElFTkSuQmCC";var oo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWElEQVR42mP4//8/IyWYYXAbYGtr+59sA0CaZ8+eTZkBhNg4DQApQlYIcglMDN1VWA0AKYJpQvYONi/hDUSYIfjCgmA0EooJ2hmAK9CINgBXoA2xvEAMBgBGPud3dYZtOQAAAABJRU5ErkJggg==";var ao="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVR42r1TQQrAMAxyD8tL89iMHgQJoQxHewi0UsWYFFX1/CkcF4iIsgUWOTM9ASV3F3rHF+v9rK4wEVnEFoFYbwmTbRZFFN9m0B9QZBfk2THaAhqktQdTkHYL9iZe+40vs7nda+BuVOMAAAAASUVORK5CYII=";var vo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR42rWTWwpAIQhEbWGu1MUaXRgQcXpyP8SIPI1jibu3l5DfAKrqyFgfAczsKxx5xJUCFGYFUZXMpOe9CAa8BOS+0U5UVbYQ6Siqbi0BFT0auTSRHZqNkE6BGXgEYKYtAczIbQAz8ukzXT3l3egz49IXvXQCVAAAAABJRU5ErkJggg==";var lo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeElEQVQ4jaWSQQ4AIQgD9WG8tI/tnkgaUgmuBw8YHcqERXK/nOUuI4JPAABMSESwA1qAQgAQwBygnfNjTaCpWoBzUlNZQJ07x9FUdgSlV5FaW4Cjq8isW8BJ2GgPtEuVdr0HKvLXHjiRI0An8jTKqo9dF000cnBzPgKuxXtbq/m1AAAAAElFTkSuQmCC";var co="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVR42qWTSRKAMAgE8WF5KY/FygEL2yEp9cAhCz0wJBYRx58wbowxYsZngLvHjITsgNYpJySBrPIBUMqZSHhdSw+oQlgVa01U7VRQ7huTk67aUWZaVyaNZFsSQBCTVBW3KahLyo/lQ6KR1Y+2BTUyGqke1AXoxsSzpYlU3FW0/Exv1ie0hq53Bf15aAAAAABJRU5ErkJggg==";var uo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmklEQVR42o2SYQ6FMAiDeQfbSXdYXjSpqd869QeZQiilpbr7l2KM0cc75+xUV77YpGCjAPUqitMU3uCAXrsAlPSCcgJMbG4M0mQ1Etz/i0KlXQnmwyqpv1uH4h7fiws7ISneTYNEk0ImCxcAArGJrE4AXhypPtl7AqTdeJG8k3gHb0L6QfmK9WQTa59cSFdHRssKFHHngteV/wPDepaHIu0QVAAAAABJRU5ErkJggg==";var fo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVR42n2Tyw3AIAxD3cGYlGFTUSmV+2o4IEEAf2JQVV1rjDGq576ec5avWVdfWIW12aMPEJBEImoPv+CAvvcCODsVNWBS8wA4A5ndv1/ytciQvBLMyeTSHD3ZYXPXXH7Y0ZMdJvCxQJls5O6tKHlPPWGEfU58WZR6ive1kKSleFNC2kXGRnrcDqhTTOmPeP3pAZnTq6Oin4X0oXbfnNZu626Io6lqGCwAAAAASUVORK5CYII=";var D1=class{constructor(t){this.worldRenderer=t;u(this,"_cursorLinesHidden",!1);u(this,"cursorLineMaterial");u(this,"interactionLines",null);u(this,"prevColor");u(this,"blockBreakMesh");u(this,"breakTextures",[]);let e=[ro,no,so,oo,ao,vo,lo,co,uo,fo];for(let r=0;r<10;r++)St(e[r]).then(s=>{s.magFilter=Y0.NearestFilter,s.minFilter=Y0.NearestFilter,this.breakTextures.push(s)});let i=new Y0.MeshBasicMaterial({transparent:!0,blending:Y0.MultiplyBlending,alphaTest:.5});this.blockBreakMesh=new Y0.Mesh(new Y0.BoxGeometry(1,1,1),i),this.blockBreakMesh.visible=!1,this.blockBreakMesh.renderOrder=999,this.blockBreakMesh.name="blockBreakMesh",this.worldRenderer.sceneOrigin.addAndTrack(this.blockBreakMesh),this.worldRenderer.onReactivePlayerStateUpdated("gameMode",()=>{this.updateLineMaterial()}),setTimeout(()=>{this.updateLineMaterial(),this.interactionLines&&this.setHighlightCursorBlock(this.interactionLines.blockPos,this.interactionLines.shapePositions,!0)})}get cursorLinesHidden(){return this._cursorLinesHidden}set cursorLinesHidden(t){this.interactionLines&&(this.interactionLines.mesh.visible=!t),this._cursorLinesHidden=t}updateLineMaterial(){let t=this.worldRenderer.playerStateReactive.gameMode==="creative",e=this.worldRenderer.renderer.getPixelRatio();this.cursorLineMaterial&&this.cursorLineMaterial.dispose(),this.cursorLineMaterial=new oe({color:(()=>{switch(this.worldRenderer.worldRendererConfig.highlightBlockColor){case"blue":return 4227327;case"classic":return 0;default:return t?4227327:0}})(),linewidth:Math.max(e*.7,1)*2}),this.prevColor=this.worldRenderer.worldRendererConfig.highlightBlockColor}updateBreakAnimation(t,e,i){if(this.hideBreakAnimation(),e===null||!t||!i)return;let{position:r,width:s,height:o,depth:a}=i,v=new wr(r.x,r.y,r.z);this.blockBreakMesh.scale.set(s*1.001,o*1.001,a*1.001),v.add(new wr(t.x,t.y,t.z)),this.blockBreakMesh.position.set(v.x,v.y,v.z),this.blockBreakMesh.visible=!0,this.blockBreakMesh.material.map=this.breakTextures[e]??this.breakTextures.at(-1),this.blockBreakMesh.material.needsUpdate=!0}hideBreakAnimation(){this.blockBreakMesh&&(this.blockBreakMesh.visible=!1)}updateDisplay(){if(this.cursorLineMaterial){let{renderer:t}=this.worldRenderer;this.cursorLineMaterial.resolution.set(t.domElement.width,t.domElement.height),this.cursorLineMaterial.dashOffset=performance.now()/750}}setHighlightCursorBlock(t,e,i=!1){if(t&&this.interactionLines&&t.equals(this.interactionLines.blockPos)&&S4(e??[],this.interactionLines.shapePositions??[])&&!i||(this.interactionLines!==null&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.interactionLines.mesh),this.interactionLines=null),t===null))return;let r=new Y0.Group;for(let{position:s,width:o,height:a,depth:v}of e??[]){let l=new wr(s.x,s.y,s.z),c=[1.0001*o,1.0001*a,1.0001*v],d=new Y0.BoxGeometry(...c),f=new se().fromEdgesGeometry(new Y0.EdgesGeometry(d)),m=new x5(f,this.cursorLineMaterial);m.position.set(l.x,l.y,l.z),m.computeLineDistances(),r.add(m)}this.worldRenderer.sceneOrigin.addAndTrack(r),r.position.set(t.x,t.y,t.z),r.visible=!this.cursorLinesHidden,this.interactionLines={blockPos:t,mesh:r,shapePositions:e}}render(){this.prevColor!==this.worldRenderer.worldRendererConfig.highlightBlockColor&&this.updateLineMaterial(),this.updateDisplay()}},S4=(n,t)=>{if(n.length!==t.length)return!1;for(let[e,i]of n.entries())if(i!==t[e])return!1;return!0};x();R();M();k();x();R();M();k();var C4=Ke(Qi(),1);import ho from"prismarine-nbt";import{getItemDefinition as B4}from"mc-assets/dist/itemDefinitions";var P4=(n,t)=>{let e,i,r=n.name;r.includes(":")||(r=`minecraft:${r}`);let s=t.currentResources?.customItemModelNames[r];if(n.components){let o=new Map;for(let c of n.components)o.set(c.type,c);let a=o.get("custom_name")||o.get("item_name");a&&(e=typeof a.data=="string"?a.data:ho.simplify(a.data));let v=o.get("item_model");if(v&&(i=v.data),s){let c=o.get("custom_model_data");if(c?.data){let d;typeof c.data=="number"?d=c.data:typeof c.data=="object"&&"floats"in c.data&&Array.isArray(c.data.floats)&&c.data.floats.length>0&&(d=c.data.floats[0]),d&&s[d]&&(i=s[d])}}let l=o.get("lore");l&&(e??(e=n.displayName??n.name),e+=`
|
|
21187
|
+
${JSON.stringify(l.data)}`)}if(n.nbt){let o=ho.simplify(n.nbt),a=o.display?.Name;a&&(e=a),s&&o.CustomModelData&&s[o.CustomModelData]&&(i=s[o.CustomModelData])}return{customText:e,customModel:i}};var mo=(n,t,e,i)=>{let r=n.name,{customModel:s}=P4(n,e);s&&(r=s);let o=I2(i,{...t}),a=B4(e.currentResources.itemsDefinitionsStore,{name:r,version:e.currentResources.version,properties:o})?.model;return(a==="minecraft:special"?void 0:a)??r};x();R();M();k();var wo=Ke(yo(),1);import{versionToNumber as _o}from"mc-assets/dist/utils";var Ao=(n,t,e=!1,i=!1)=>{let r=n.modelName,s=globalThis.loadedData.itemsByName[r];_o(t.currentResources.version)<_o("1.13")&&(r=(0,wo.getRenamedData)(s?"items":"blocks",r,t.currentResources.version,"1.13.1"));let o;if(!i){let v=t.currentResources?.guiAtlas?.json,l=d=>d&&v?.textures[d.replace("minecraft:","").replace("block/","").replace("blocks/","").replace("item/","").replace("items/","").replace("_inventory","")],c=l(r)??l(n.originalItemName);if(c){let d=c.u*v.width,f=c.v*v.height;return{texture:"gui",slice:[d,f,v.tileSize,v.tileSize],scale:.25,blockData:null,modelName:null}}}let a=v=>v.top??v;try{if(!t.currentResources?.itemsRenderer)throw new Error("Items renderer is not available");o=t.currentResources.itemsRenderer.getItemTexture(r,{},!1,i)??(n.originalItemName?t.currentResources.itemsRenderer.getItemTexture(n.originalItemName,{},!1,i):void 0)??t.currentResources.itemsRenderer.getItemTexture("item/missing_texture")}catch(v){reportError?.(`Failed to render item ${r} (original: ${n.originalItemName}) on ${t.currentResources.version} (resourcepack: TODO!): ${v.stack}`),o=a(t.currentResources.itemsRenderer.getItemTexture("errored"))}return o??(o=a(t.currentResources.itemsRenderer.getItemTexture("unknown"))),"type"in o?{texture:o.type,slice:o.slice,modelName:r,blockData:null,scale:null}:{texture:"blocks",blockData:o,modelName:r,slice:null,scale:null}};var Eo=(n,t,e,i)=>{let r=e.currentResources;if(!r)throw new Error("Resources not loaded");let s=n.itemId??n.blockId??n.name,{blockState:o}=n;try{let a=o?globalThis.loadedData.blocksByStateId[o]?.name:typeof s=="number"?globalThis.loadedData.items[s]?.name:s;if(!a)throw new Error(`Item not found: ${s}`);let v=mo({...n,name:a},t,e,i),l=Ao({modelName:v},e,!1,!0);if(!l)throw new Error(`Failed to get render info for item ${a}`);let c=l.texture==="blocks"?r.blocksAtlasImage:r.itemsAtlasImage;if(l.blockData)return{resolvedModel:l.blockData.resolvedModel,modelName:l.modelName};if(l.slice){let[d,f,m,g]=l.slice,[b,A,_,w]=[d/c.width,f/c.height,m/c.width,g/c.height];return{u:b,v:A,su:_,sv:w,renderInfo:l,modelName:l.modelName}}throw new Error(`Invalid render info for item ${a}`)}catch(a){return reportError?.(a),{u:0,v:0,su:16/r.blocksAtlasImage.width,sv:16/r.blocksAtlasImage.width,modelName:"missing"}}};x();R();M();k();import*as De from"three";var L1=class{constructor(t){this.worldRenderer=t;u(this,"audioListener");u(this,"activeSounds",new Set);u(this,"audioContext");u(this,"soundVolumes",new Map);u(this,"baseVolume",1);t.onWorldSwitched.push(()=>{this.stopAll()}),t.onReactiveConfigUpdated("volume",e=>{this.changeVolume(e)})}initAudioListener(){this.audioListener||(this.audioListener=new De.AudioListener,this.worldRenderer.camera.add(this.audioListener))}playSound(t,e,i=1,r=1,s=500){this.initAudioListener();let o=new De.PositionalAudio(this.audioListener);this.activeSounds.add(o),this.soundVolumes.set(o,i);let a=new De.AudioLoader,v=Date.now();a.loadAsync(e).then(l=>{Date.now()-v>s||(o.setBuffer(l),o.setRefDistance(20),o.setVolume(i*this.baseVolume),o.setPlaybackRate(r),this.worldRenderer.sceneOrigin.addAndTrack(o),o.position.set(t.x,t.y,t.z),o.onEnded=()=>{this.worldRenderer.sceneOrigin.removeAndUntrack(o),o.source&&o.disconnect(),this.activeSounds.delete(o),this.soundVolumes.delete(o),a.manager.itemEnd(e)},o.play())})}stopAll(){for(let t of this.activeSounds)t&&(t.stop(),t.source&&t.disconnect(),this.worldRenderer.sceneOrigin.removeAndUntrack(t));this.activeSounds.clear(),this.soundVolumes.clear()}changeVolume(t){this.baseVolume=t;for(let[e,i]of this.soundVolumes)e.setVolume(i*this.baseVolume)}destroy(){this.stopAll(),this.audioListener&&(this.audioListener.removeFromParent(),this.audioListener=void 0)}playTestSound(){this.playSound(this.worldRenderer.camera.position,"/sound.mp3")}};x();R();M();k();import*as F0 from"three";var U1=class{constructor(t,e){this.worldRenderer=t;this.onRenderCallbacks=e;u(this,"rollAngle",0);u(this,"rollAnimation");u(this,"basePitch",0);u(this,"baseYaw",0);u(this,"cameraBobInput",null);e.push(()=>{this.update()})}get damageRollAmount(){return 5}get damageAnimDuration(){return 200}setCameraBobInput(t){this.cameraBobInput=t}setBaseRotation(t,e){this.basePitch=t,this.baseYaw=e,this.update()}getBaseRotation(){return{pitch:this.basePitch,yaw:this.baseYaw}}shakeFromDamage(t){let e=this.rollAngle,i=e+(t??(Math.random()<.5?-1:1))*this.damageRollAmount;this.rollAnimation={startTime:performance.now(),startRoll:e,targetRoll:i,duration:this.damageAnimDuration/2}}update(){if(this.worldRenderer.playerStateUtils.isSpectatingEntity()&&(this.rollAngle=0,this.rollAnimation=void 0),this.rollAnimation){let e=performance.now(),i=e-this.rollAnimation.startTime,r=Math.min(i/this.rollAnimation.duration,1);this.rollAnimation.returnToZero?(this.rollAngle=this.rollAnimation.startRoll*(1-this.easeInOut(r)),r===1&&(this.rollAnimation=void 0)):(this.rollAngle=this.rollAnimation.startRoll+(this.rollAnimation.targetRoll-this.rollAnimation.startRoll)*this.easeOut(r),r===1&&(this.rollAnimation={startTime:e,startRoll:this.rollAngle,targetRoll:0,duration:this.damageAnimDuration/2,returnToZero:!0}))}let t=this.worldRenderer.cameraObject;if(this.worldRenderer.cameraGroupVr){let e=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(0,1,0),this.baseYaw);t.setRotationFromQuaternion(e)}else{let e=this.addAntiZfightingOffset(this.basePitch),i=this.addAntiZfightingOffset(this.baseYaw),r=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(1,0,0),e),s=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(0,1,0),i),o=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(0,0,1),F0.MathUtils.degToRad(this.rollAngle)),a=new F0.Quaternion,v=new F0.Quaternion,l=this.worldRenderer.playerStateReactive.perspective;if(this.cameraBobInput){let d=k1(this.cameraBobInput);a=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(0,0,1),d.rotation.z),v=new F0.Quaternion().setFromAxisAngle(new F0.Vector3(1,0,0),d.rotation.x),l==="first_person"&&this.worldRenderer.camera.position.set(d.position.x,d.position.y,0)}else l==="first_person"&&this.worldRenderer.camera.position.set(0,0,0);let c=s.multiply(r).multiply(o).multiply(a).multiply(v);t.setRotationFromQuaternion(c)}}easeOut(t){return 1-(1-t)*(1-t)}easeInOut(t){return t<.5?2*t*t:1-(-2*t+2)**2/2}addAntiZfightingOffset(t){let i=(t%(Math.PI*2)+Math.PI*2)%(Math.PI*2),r=.01;return Math.abs(i)<r||Math.abs(i-Math.PI/2)<r||Math.abs(i-Math.PI)<r||Math.abs(i-3*Math.PI/2)<r?t+.001:t}};x();R();M();k();import*as K from"three";var G1=class{constructor(t){this.worldRenderer=t;u(this,"customMedia",new Map);u(this,"lastCheck",0);u(this,"THROTTLE_TIME",100);this.worldRenderer.onWorldSwitched.push(()=>{this.onWorldGone()}),this.worldRenderer.onRender.push(()=>{this.render()}),this.worldRenderer.onReactiveConfigUpdated("volume",()=>{let{volume:e}=this.worldRenderer.worldRendererConfig;for(let[i,r]of this.customMedia.entries())r.positionalAudio&&r.positionalAudio.setVolume((r.props.volume??1)*e)})}onWorldGone(){for(let[t,e]of this.customMedia.entries())this.destroyMedia(t)}onWorldStop(){for(let[t,e]of this.customMedia.entries())this.setVideoPlaying(t,!1)}createErrorTexture(t,e,i=16777215,r="Failed to load"){let s=new OffscreenCanvas(100,100),o=100;s.width=o,s.height=o;let a=s.getContext("2d");if(!a)return new K.CanvasTexture(s);a.clearRect(0,0,s.width,s.height),a.fillStyle=`rgba(${i>>16&255}, ${i>>8&255}, ${i&255}, 1)`,a.fillRect(0,0,s.width,s.height),a.fillStyle="#ff0000",a.font="bold 10px sans-serif",a.textAlign="center",a.textBaseline="middle",a.fillText(r,s.width/2,s.height/2,s.width);let v=new K.CanvasTexture(s);return v.minFilter=K.LinearFilter,v.magFilter=K.LinearFilter,v}createBackgroundTexture(t,e,i=0,r=1){let s=new OffscreenCanvas(1,1);s.width=1,s.height=1;let o=s.getContext("2d");if(!o)return new K.CanvasTexture(s);let a=i>>16&255,v=i>>8&255,l=i&255;o.fillStyle=`rgba(${a}, ${v}, ${l}, ${r})`,o.fillRect(0,0,1,1);let c=new K.CanvasTexture(s);return c.minFilter=K.NearestFilter,c.magFilter=K.NearestFilter,c}validateOrigin(t,e){if(e===!0)return!0;if(e===!1)return!1;let i=new URL(t);return e.some(r=>i.origin.endsWith(r))}onPageInteraction(){for(let[t,e]of this.customMedia.entries())e.hadAutoPlayError&&(e.hadAutoPlayError=!1,this.playVideo(t))}addMedia(t,e){let i=structuredClone(e);this.destroyMedia(t);let r=!1;e.src.startsWith("https://disk.yandex.ru/i/")&&(r=!0,e.src=`/ya-image?url=${e.src}`);let{scene:s}=this.worldRenderer;e.allowOrigins!==void 0&&!this.validateOrigin(e.src,e.allowOrigins)&&(e.src="");let a=e.src.endsWith(".png")||e.src.endsWith(".jpg")||e.src.endsWith(".jpeg")||e.imageOverride;r&&!e.imageOverride&&fetch(e.src,{method:"HEAD"}).then(S=>{S.headers.get("content-type")?.startsWith("image/")&&(this.destroyMedia(t),this.addMedia(t,{...i,src:e.src,imageOverride:!0}))}).catch(console.error);let v,l;if(!a){v=document.createElement("video"),v.src=e.src.endsWith(".gif")?e.src.replace(".gif",".mp4"):e.src,v.loop=e.loop??!0;let S=(e.volume??1)*this.worldRenderer.worldRendererConfig.volume;v.volume=Math.min(S,1),v.playsInline=!0,v.crossOrigin="anonymous";let C=this.worldRenderer.soundSystem;if(C.initAudioListener(),!C.audioListener)throw new Error("Audio listener not initialized");l=new K.PositionalAudio(C.audioListener),l.setRefDistance(6),l.setVolume(S),this.worldRenderer.sceneOrigin.addAndTrack(l),l.position.set(e.position.x,e.position.y,e.position.z),l.setMediaElementSource(v),l.connect(),v.addEventListener("pause",()=>{l?.pause(),globalThis.tempSendVideoStop?.(t,"paused",v.currentTime)}),v.addEventListener("play",()=>{l?.play(),globalThis.tempSendVideoPlay?.(t)}),v.addEventListener("seeked",()=>{l&&v&&(l.offset=v.currentTime)}),v.addEventListener("stalled",()=>{globalThis.tempSendVideoStop?.(t,"stalled",v.currentTime)}),v.addEventListener("waiting",()=>{globalThis.tempSendVideoStop?.(t,"waiting",v.currentTime)}),v.addEventListener("error",({error:H})=>{globalThis.tempSendVideoStop?.(t,`error: ${H}`,v.currentTime)}),v.addEventListener("ended",()=>{globalThis.tempSendVideoStop?.(t,"ended",v.currentTime),e.loop||(v.currentTime=0,T.ended=!0)})}let c=this.createBackgroundTexture(e.size.width,e.size.height,e.background),d=S=>{let C=this.createErrorTexture(e.size.width,e.size.height,e.background,S);g.map=C,g.needsUpdate=!0},f=new K.PlaneGeometry(1,1),m=e.allowLighting?K.MeshLambertMaterial:K.MeshBasicMaterial,g=new m({map:c,transparent:!0,side:e.doubleSide?K.DoubleSide:K.FrontSide,alphaTest:.1}),b=v?new K.VideoTexture(v):new K.TextureLoader().load(e.src,()=>{this.customMedia.get(t)?.texture===b&&(g.map=b,g.needsUpdate=!0)},void 0,()=>d());b.minFilter=K.NearestFilter,b.magFilter=K.NearestFilter,b.generateMipmaps=!1;let A=new K.Mesh(f,g),{mesh:_}=this.positionMeshExact(A,K.MathUtils.degToRad((e.rotation??0)*90),e.position,e.size.width,e.size.height);s.add(_),v&&(A.onBeforeRender=()=>{v.readyState===v.HAVE_ENOUGH_DATA&&(!v.paused||!T?.hadAutoPlayError)&&(g.map!==b&&(g.map=b,g.needsUpdate=!0),b.needsUpdate=!0,l&&(l.position.copy(_.position),l.rotation.copy(_.rotation)))});let w=S=>{let C=f.attributes.uv.array;C[0]=S.startU,C[1]=S.startV,C[2]=S.endU,C[3]=S.startV,C[4]=S.endU,C[5]=S.endV,C[6]=S.startU,C[7]=S.endV,f.attributes.uv.needsUpdate=!0};e.uvMapping&&w(e.uvMapping);let T={mesh:_,video:v,texture:b,updateUVMapping:w,positionalAudio:l,props:i,hadAutoPlayError:!1,pausedBecuaseHidden:!1,ended:!1,handleError(S){if(T.destroyed)return;let C=H=>H;d(S.name==="NotAllowedError"||S.name==="AbortError"?C("Waiting for user interaction"):C("Failed to auto play"))}};return this.customMedia.set(t,T),v&&e.autoPlay&&this.playVideo(t,!0),t}playVideo(t,e=!1){let i=this.customMedia.get(t);if(i?.video){if(!e&&i.positionalAudio&&i.video.currentTime<1){let r=i.video.currentTime;this.addMedia(t,i.props),i.video.currentTime=r,i.props.autoPlay||this.playVideo(t,!0);return}i.video.play().then(()=>{i.hadAutoPlayError=!1}).catch(r=>{i.pausedBecuaseHidden||((r.name==="NotAllowedError"||r.name==="AbortError"||r.message?.includes("not allowed")&&!i.pausedBecuaseHidden)&&(i.hadAutoPlayError=!0),i.handleError(r))})}}render(){for(let[t,e]of this.customMedia.entries()){let i=e.mesh.visible;e.mesh.visible=this.worldRenderer.shouldObjectVisible(e.mesh)&&!e.mesh.forceHide,i!==e.mesh.visible&&e.video&&(e.mesh.visible?e.pausedBecuaseHidden&&(this.playVideo(t),e.pausedBecuaseHidden=!1):e.video.paused||(e.video.pause(),e.pausedBecuaseHidden=!0))}}setVideoPlaying(t,e){let i=this.customMedia.get(t);i?.video&&(e?this.playVideo(t):i.video.pause())}setVideoSeeking(t,e){let i=this.customMedia.get(t);i?.video&&(i.video.currentTime=e)}setVideoVolume(t,e){let i=this.customMedia.get(t);i?.video&&(i.video.volume=e)}setVideoSpeed(t,e){let i=this.customMedia.get(t);i?.video&&(i.video.playbackRate=e)}setControlMode(t,e,i){let r=this.customMedia.get(t);r?.video&&(r.props.controlMode={mouseButton:e,controlMode:i})}destroyMedia(t){let{scene:e}=this.worldRenderer,i=this.customMedia.get(t);if(i){i.destroyed=!0,i.video&&(i.video.pause(),i.video.src="",i.video.remove()),i.positionalAudio&&this.worldRenderer.sceneOrigin.removeAndUntrack(i.positionalAudio),this.worldRenderer.sceneOrigin.removeAndUntrack(i.mesh),i.texture.dispose();let r=i.mesh.children[0];r&&(r.geometry.dispose(),r.material instanceof K.Material&&r.material.dispose()),this.customMedia.delete(t)}}positionMeshExact(t,e,i,r,s,o=1){e===0&&(i.z+=.001),e===Math.PI/2&&(i.x-=.001),e===Math.PI&&(i.z-=.001),e===3*Math.PI/2&&(i.x+=.001),e===0&&(i.z+=1),e===Math.PI&&(i.x+=1),e===3*Math.PI/2&&(i.z+=1,i.x+=1),t.matrix.identity(),t.position.set(0,0,0),t.rotation.set(0,0,0),t.scale.set(1,1,1),t.rotateY(e),(e===Math.PI/2||e===3*Math.PI/2)&&(t.rotateZ(-Math.PI),t.rotateX(-Math.PI)),t.scale.set(r,s,o),t.geometry.translate(.5,.5,0),t.geometry.attributes.position.needsUpdate=!0,this.worldRenderer.sceneOrigin.track(t),t.position.set(i.x,i.y,i.z);let a=new K.Group;a.add(t);let v=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711680}));v.position.set(i.x,i.y,i.z),a.add(v);let l=i.x+Math.cos(e)*r,c=i.z+Math.sin(e)*r,d=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:255}));d.position.set(i.x,i.y+s,i.z),a.add(d);let f=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16776960}));f.position.set(l,i.y,c),a.add(f);let m=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711935}));m.position.set(l,i.y+s,c),a.add(m);let g=new K.Vector3(this.worldRenderer.sceneOrigin.toSceneX(i.x),this.worldRenderer.sceneOrigin.toSceneY(i.y),this.worldRenderer.sceneOrigin.toSceneZ(i.z)),b=new K.ArrowHelper(new K.Vector3(Math.cos(e),0,Math.sin(e)),g,1,16711680);return a.add(b),{mesh:t,debugGroup:a}}createTestCanvasTexture(){let t=new OffscreenCanvas(100,100);t.width=100,t.height=100;let e=t.getContext("2d");return e?(e.font="10px Arial",e.fillStyle="red",e.fillText("Hello World",0,10),new K.CanvasTexture(t)):null}tryIntersectMedia(){if(Date.now()-this.lastCheck<this.THROTTLE_TIME)return;if(this.customMedia.size===0){this.worldRenderer.reactiveState.world.intersectMedia=null,this.worldRenderer.debugVideo=null,this.worldRenderer.cursorBlock.cursorLinesHidden=!1;return}this.lastCheck=Date.now();let{camera:t,scene:e}=this.worldRenderer,i=new K.Raycaster,r=new K.Vector2(0,0);i.setFromCamera(r,t);let s=i.intersectObjects(e.children,!0);if(s.length>0){let o=s[0],a=o.object;for(let[v,l]of this.customMedia.entries())if(a===l.mesh||l.mesh.children.includes(a)){let{uv:c}=o;if(c){let d={id:v,x:c.x,y:c.y};this.worldRenderer.reactiveState.world.intersectMedia=d,this.worldRenderer.debugVideo=l,this.worldRenderer.cursorBlock.cursorLinesHidden=!0;return}}}this.worldRenderer.reactiveState.world.intersectMedia=null,this.worldRenderer.debugVideo=null,this.worldRenderer.cursorBlock.cursorLinesHidden=!1}handleUserClick(t){let e=this.worldRenderer.reactiveState.world.intersectMedia;if(e){let{id:i,x:r,y:s}=e,o=this.customMedia.get(i),a=o?.props.controlMode;if(o?.video&&(a?.mouseButton==="both"||a?.mouseButton===t))switch(a?.controlMode){case"play_pause":{this.setVideoPlaying(i,o.video.paused);break}case"play_if_ended":{o.ended&&this.setVideoPlaying(i,!0);break}case"toggle_mute":{o.video.muted=!o.video.muted;break}}}}};x();R();M();k();import*as zt from"three";x();R();M();k();import*as k0 from"three";var D4=1,xo=10,ct={TARGET_SCREEN_PX:150,CANVAS_SIZE:256,LAYOUT:{DOT_Y:.3,NAME_Y:.45,DISTANCE_Y:.55},CANVAS_SCALE:2,ARROW:{enabledDefault:!1,pixelSize:50,paddingPx:50},DEFAULT_VISUAL_SCALE:1,DEFAULT_OPACITY:1};function ko(n){let t=n.color??16711680,e=n.depthTest??!1,i=n.visualScale??n.metadata?.visualScale??(typeof window>"u"?void 0:window.serverMetadata?.waypointVisualScale)??ct.DEFAULT_VISUAL_SCALE,r=n.opacity??n.metadata?.opacity??(typeof window>"u"?void 0:window.serverMetadata?.waypointOpacity)??ct.DEFAULT_OPACITY,s=W0(Ro(),Ro());N1(s,t,n.label??"","0m",i);let o=new k0.CanvasTexture(s);o.anisotropy=1,o.magFilter=k0.LinearFilter,o.minFilter=k0.LinearFilter;let a=new k0.SpriteMaterial({map:o,transparent:!0,opacity:1,depthTest:e,depthWrite:!1}),v=new k0.Sprite(a);v.position.set(0,0,0),v.renderOrder=10,v.material.opacity=r;let l=n.label??"",c="0m",d=Number.NaN,f,m,g,b,A=null,_=ct.ARROW.enabledDefault,w=new k0.Group;w.add(v);let{x:T,y:S,z:C}=n.position;w.position.set(T,S,C);function H(){o.needsUpdate=!0}function P(){if(!m||!g)return;let Y=m.width;g.clearRect(0,0,Y,Y),g.beginPath(),g.moveTo(Y*.15,Y*.5),g.lineTo(Y*.85,Y*.5),g.lineTo(Y*.5,Y*.15),g.closePath();let o0=`#${t.toString(16).padStart(6,"0")}`;g.lineWidth=6,g.strokeStyle="black",g.stroke(),g.fillStyle=o0,g.fill(),b&&(b.needsUpdate=!0)}function I(Y){t=Y,c="0m",d=0,N1(s,t,l,"0m",i),H(),f&&P()}function N(Y){l=Y??"",N1(s,t,l,c,i),H()}function O(Y,o0){o0!==c&&(c=o0,N1(s,t,Y,o0,i),H())}function j(Y){v.visible=Y}function q(Y,o0,g0){w.position.set(Y,o0,g0)}function $(Y,o0,g0,L0){let H0=o0*Math.PI/180,u0=Math.tan(H0/2)*2*g0*(ct.TARGET_SCREEN_PX*i/L0);v.scale.set(u0,u0,1)}function e0(){if(f)return;let Y=128;m=W0(Y,Y),g=m.getContext("2d"),P(),b=new k0.CanvasTexture(m),b.anisotropy=1,b.magFilter=k0.LinearFilter,b.minFilter=k0.LinearFilter;let o0=new k0.SpriteMaterial({map:b,transparent:!0,depthTest:!1,depthWrite:!1,opacity:r});f=new k0.Sprite(o0),f.renderOrder=12,f.visible=!1,A&&A.add(f)}function d0(Y){_=Y,!Y&&f&&(f.visible=!1)}function l0(Y){f?.parent&&f.parent.remove(f),A=Y,f&&Y&&Y.add(f)}function m0(Y,o0,g0){if(!_||(e0(),!f))return!0;let L0=n.metadata?.onlyLeftRight===!0,H0=new k0.Vector3;Y.getWorldDirection(H0);let X0=Y.up.clone().normalize(),u0=new k0.Vector3().copy(H0).cross(X0).normalize(),vt=new k0.Vector3().copy(u0).cross(H0).normalize(),Ve=new k0.Vector3().setFromMatrixPosition(Y.matrixWorld),je=new k0.Vector3(w.position.x,w.position.y,w.position.z).sub(Ve),Gt=je.dot(H0),kt=je.dot(u0),Nt=je.dot(vt),F5=o0/g0,Wt=Y.fov*Math.PI/180,ue=2*Math.atan(Math.tan(Wt/2)*F5),L5=Math.atan2(kt,Gt),U5=Math.atan2(Nt,Gt);if(Gt>0&&Math.abs(L5)<=ue/2&&Math.abs(U5)<=Wt/2)return f.visible=!1,!0;let q0=L5/(ue/2),T0=U5/(Wt/2);Gt<=0&&(Math.abs(q0)>Math.abs(T0)?(q0=Math.sign(q0),T0=0):(q0=0,T0=Math.sign(T0))),L0&&(Math.abs(q0)>Math.abs(T0)||(q0=q0>=0?1:-1),T0=0);let fe=Math.max(Math.abs(q0),Math.abs(T0))||1,Ye=q0/fe,rt=T0/fe,he=ct.ARROW.paddingPx,y=(Ye+1)*.5*o0,h=(1-rt)*.5*g0,p=Math.min(Math.max(y,he),o0-he),E=Math.min(Math.max(h,he),g0-he);Ye=p/o0*2-1,rt=-(E/g0)*2+1;let B=Math.max(2,Y.near*4),z=Math.tan(Wt/2)*B,G=z*F5,r0=Ve.clone().add(H0.clone().multiplyScalar(B)).add(u0.clone().multiplyScalar(Ye*G)).add(vt.clone().multiplyScalar(rt*z));f.visible=!0,f.position.copy(r0);let b0=Math.atan2(T0,q0);f.material.rotation=b0-Math.PI/2;let h0=Math.tan(Wt/2)*2*B*(ct.ARROW.pixelSize*i/g0);return f.scale.set(h0,h0,1),!1}function p0(Y){return Y.distanceTo(w.position)}function w0(Y,o0,g0,L0){let H0=p0(Y);$(Y,o0.fov,H0,L0);let X0=Math.round(H0/xo)*xo;X0!==d&&(d=X0,O(l,`${Math.max(0,X0)}m`));let u0=m0(o0,g0,L0);return j(u0),u0}function n0(){let Y=v.material;if(Y.map?.dispose(),Y.dispose(),f){f.parent&&f.parent.remove(f);let o0=f.material;o0.map?.dispose(),o0.dispose()}f=void 0,m=void 0,g=void 0,b=void 0}return{group:w,sprite:v,enableOffscreenArrow:d0,setArrowParent:l0,updateForCamera:w0,setColor:I,setLabel:N,updateDistanceText:O,setVisible:j,setPosition:q,dispose:n0}}function Mo(){let n=globalThis.devicePixelRatio||1,t=Math.min(n,D4);return ct.CANVAS_SCALE*t}function Ro(){return Math.round(ct.CANVAS_SIZE*Mo())}function N1(n,t,e,i,r){let s=n.width,o=Mo(),a=n.getContext("2d");a.clearRect(0,0,s,s);let v=s/2,l=Math.round(s*ct.LAYOUT.DOT_Y),c=Math.round(s*.05*r),d=Math.max(2,Math.round(4*o*r)),f=c+d;a.beginPath(),a.arc(v,l,f,0,Math.PI*2),a.fillStyle=`#${t.toString(16).padStart(6,"0")}`,a.fill(),a.textAlign="center",a.textBaseline="middle";let m=Math.round(s*.08*r),g=Math.round(s*.06*r);a.font=`800 ${m}px mojangles`,a.lineWidth=Math.max(2,Math.round(3*o*r));let b=Math.round(s*ct.LAYOUT.NAME_Y);a.strokeStyle="black",a.strokeText(e,v,b),a.fillStyle="white",a.fillText(e,v,b),a.font=`800 ${g}px mojangles`,a.lineWidth=Math.max(2,Math.round(2*o*r));let A=Math.round(s*ct.LAYOUT.DISTANCE_Y);a.strokeStyle="black",a.strokeText(i,v,A),a.fillStyle="#CCCCCC",a.fillText(i,v,A)}var W1=class{constructor(t){this.worldRenderer=t;u(this,"waypoints",new Map);u(this,"waypointScene",new zt.Scene);u(this,"lastCameraPosition",new zt.Vector3);u(this,"lastUpdateTime",0);u(this,"UPDATE_THROTTLE_MS",16)}updateWaypoints(){let t=performance.now(),e=this.worldRenderer.getCameraPosition(),i=this.lastCameraPosition.distanceTo(e)>.5,r=t-this.lastUpdateTime>this.UPDATE_THROTTLE_MS;if(!i&&!r)return;this.lastCameraPosition.copy(e),this.lastUpdateTime=t;let s=this.worldRenderer.renderer.getSize(new zt.Vector2);for(let o of this.waypoints.values()){let a=new zt.Vector3(o.x,o.y,o.z),v=e.distanceTo(a),l=(!o.minDistance||v>=o.minDistance)&&(o.maxDistance===1/0||v<=o.maxDistance);o.sprite.setVisible(l),l&&(o.sprite.setPosition(this.worldRenderer.sceneOrigin.toSceneX(o.x),this.worldRenderer.sceneOrigin.toSceneY(o.y),this.worldRenderer.sceneOrigin.toSceneZ(o.z)),o.sprite.updateForCamera(this.worldRenderer.getCameraPosition(),this.worldRenderer.camera,s.width,s.height))}}render(){this.waypoints.size!==0&&(this.updateWaypoints(),this.worldRenderer.renderer.render(this.waypointScene,this.worldRenderer.camera))}addWaypoint(t,e,i,r,s={}){this.removeWaypoint(t);let o=s.color??16711680,{label:a,metadata:v}=s,l=s.minDistance??0,c=s.maxDistance??1/0,d=ko({position:new zt.Vector3(e,i,r),color:o,label:a||t,metadata:v});d.enableOffscreenArrow(!0),d.setArrowParent(this.waypointScene),this.waypointScene.add(d.group),this.waypoints.set(t,{id:t,x:e+.5,y:i+.5,z:r+.5,minDistance:l,maxDistance:c,color:o,label:a,sprite:d})}removeWaypoint(t){let e=this.waypoints.get(t);e&&(this.waypointScene.remove(e.sprite.group),e.sprite.dispose(),this.waypoints.delete(t))}clear(){for(let t of this.waypoints.keys())this.removeWaypoint(t)}testWaypoint(){this.addWaypoint("Test Point",0,70,0,{color:65280,label:"Test Point"}),this.addWaypoint("Spawn",0,64,0,{color:16776960,label:"Spawn"}),this.addWaypoint("Far Point",100,70,100,{color:255,label:"Far Point"}),this.addWaypoint("Far Point 2",180,170,100,{color:255,label:"Far Point 2"}),this.addWaypoint("Far Point 3",1e3,100,1e3,{color:255,label:"Far Point 3"})}getWaypoint(t){return this.waypoints.get(t)}getAllWaypoints(){return[...this.waypoints.values()]}setWaypointColor(t,e){let i=this.waypoints.get(t);i&&(i.sprite.setColor(e),i.color=e)}setWaypointLabel(t,e){let i=this.waypoints.get(t);i&&(i.label=e,i.sprite.setLabel(e))}};x();R();M();k();import*as E0 from"three";import{Vec3 as C5}from"vec3";var A0=class A0{constructor(t){this.worldRenderer=t;u(this,"explosions",new Map);u(this,"particleGeometry");u(this,"particleMaterials",[]);u(this,"testModeTimer");u(this,"explosionCounter",0);this.particleGeometry=new E0.BoxGeometry(A0.DEFAULT_PARTICLE_SIZE,A0.DEFAULT_PARTICLE_SIZE,A0.DEFAULT_PARTICLE_SIZE),this.createParticleMaterials()}createParticleMaterials(){let t=[16711680,65280,255,16776960,16711935,65535,16753920,8388736,16761035,16777215];for(let e of t){let i=new E0.MeshBasicMaterial({color:e,transparent:!0,opacity:1});this.particleMaterials.push(i)}}getRandomMaterial(){return this.particleMaterials[Math.floor(Math.random()*this.particleMaterials.length)]}createExplosion(t,e=1,i,r=A0.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],a=Math.floor(A0.DEFAULT_PARTICLE_COUNT*e),v;if(A0.DEBUG_SHOW_EXPLOSION_CENTER){let c=.5*e,d=new E0.SphereGeometry(c,8,8),f=new E0.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});v=new E0.Mesh(d,f),v.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(t.x,t.y,t.z)}for(let c=0;c<a;c++){let d=Math.random()*Math.PI*2,f=Math.sqrt(Math.random())*A0.VELOCITY_FACTOR*e,m=new C5(f*Math.cos(d),Math.random()*.5-.25,f*Math.sin(d));c<5;let g=i===void 0?this.getRandomMaterial().clone():new E0.MeshBasicMaterial({color:i,transparent:!0,opacity:1}),b=new E0.Mesh(this.particleGeometry,g);b.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(b),b.position.set(t.x,t.y,t.z),c<5;let A={position:t.clone(),velocity:m,color:new E0.Color(g.color),life:1,maxLife:1,mesh:b};o.push(A)}let l={id:s,position:t.clone(),particles:o,startTime:Date.now(),duration:r,size:e,debugSphere:v};return this.explosions.set(s,l),l}createExplosionFacingCamera(t,e=1,i,r=A0.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],a=Math.floor(A0.DEFAULT_PARTICLE_COUNT*e),v;if(A0.DEBUG_SHOW_EXPLOSION_CENTER){let f=.5*e,m=new E0.SphereGeometry(f,8,8),g=new E0.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});v=new E0.Mesh(m,g),v.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(t.x,t.y,t.z)}let l=this.worldRenderer.getCameraPosition(),c=new C5(l.x-t.x,l.y-t.y,l.z-t.z).normalize();for(let f=0;f<a;f++){let m=Math.random()*Math.PI*2,g=Math.sqrt(Math.random())*A0.VELOCITY_FACTOR*e,b=new C5(g*Math.cos(m),g*Math.sin(m),0),A=new C5(b.x*c.x-b.z*c.z,b.y,b.x*c.z+b.z*c.x);f<5;let _=i===void 0?this.getRandomMaterial().clone():new E0.MeshBasicMaterial({color:i,transparent:!0,opacity:1}),w=new E0.Mesh(this.particleGeometry,_);w.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(w),w.position.set(t.x,t.y,t.z);let T={position:t.clone(),velocity:A,color:new E0.Color(_.color),life:1,maxLife:1,mesh:w};o.push(T)}let d={id:s,position:t.clone(),particles:o,startTime:Date.now(),duration:r,size:e,debugSphere:v};return this.explosions.set(s,d),d}explode(t,e=1,i,r){return this.createExplosion(t,e,i,r).id}explodeFacingCamera(t,e=1,i,r){return this.createExplosionFacingCamera(t,e,i,r).id}startTestMode(){let t=this.worldRenderer.getCameraPosition(),e=new C5(t.x,t.y+10,t.z);this.testModeTimer=setInterval(()=>{let i=.8+Math.random()*.4,r=[16711680,65280,255,16776960,16711935,65535,16753920],s=r[Math.floor(Math.random()*r.length)];this.explodeFacingCamera(e,i,s)},A0.TEST_INTERVAL)}updateParticle(t,e,i){let r=t.mesh.position.x===t.position.x&&t.mesh.position.y===t.position.y&&t.mesh.position.z===t.position.z;r&&t.life>.95,t.velocity.y+=A0.GRAVITY;let s=t.position.clone(),o=e/1e3;t.position.add(t.velocity.scaled(o)),t.mesh.position.set(t.position.x,t.position.y,t.position.z);let a=t.life;t.life-=e/i;let v=Math.max(0,t.life);if(t.mesh.material instanceof E0.MeshBasicMaterial&&(t.mesh.material.opacity=v),r&&a>.95){let l=t.position.distanceTo(s)}return t.life>0}render(){let t=Date.now(),e=16.67;this.explosions.size>0&&Math.random()<.01;for(let[i,r]of this.explosions.entries()){let s=t-r.startTime;if(s>=r.duration){this.removeExplosion(i);continue}s%2e3<16,r.particles=r.particles.filter(o=>this.updateParticle(o,e,r.duration)),r.particles.length===0&&this.removeExplosion(i)}}removeExplosion(t){let e=this.explosions.get(t);if(e){for(let i of e.particles)this.worldRenderer.sceneOrigin.removeAndUntrack(i.mesh),i.mesh.material instanceof E0.Material&&i.mesh.material.dispose();e.debugSphere&&(this.worldRenderer.sceneOrigin.removeAndUntrack(e.debugSphere),e.debugSphere.geometry.dispose(),e.debugSphere.material instanceof E0.Material&&e.debugSphere.material.dispose()),this.explosions.delete(t)}}stopTestMode(){this.testModeTimer&&(clearInterval(this.testModeTimer),this.testModeTimer=void 0)}destroy(){this.stopTestMode();for(let t of this.explosions.keys())this.removeExplosion(t);for(let t of this.particleMaterials)t.dispose();this.particleGeometry.dispose()}};u(A0,"DEFAULT_PARTICLE_COUNT",50),u(A0,"DEFAULT_PARTICLE_SIZE",.05),u(A0,"DEFAULT_EXPLOSION_DURATION",6e3),u(A0,"GRAVITY",-.005),u(A0,"VELOCITY_FACTOR",1.5),u(A0,"TEST_INTERVAL",1e3),u(A0,"DEBUG_SHOW_EXPLOSION_CENTER",!0),u(A0,"DEBUG_SHOW_PARTICLE_TRAILS",!1);var V1=A0;x();R();M();k();import*as ae from"three";import{Vec3 as Ar}from"vec3";var j1=class n{constructor(t,e,i,r){this.worldRenderer=t;this.updateCamera=e;this.updateFov=i;this.getInitialState=r;u(this,"isRunning",!1);u(this,"currentScript",null);u(this,"currentPointIndex",0);u(this,"currentTweens",[]);u(this,"startTime",0);u(this,"totalDuration",0);u(this,"currentPosition",{x:0,y:0,z:0});u(this,"currentRotation",{yaw:0,pitch:0});u(this,"currentFov",75)}startScript(t){if(this.isRunning||!t.points||t.points.length===0)return!1;this.currentScript=t,this.isRunning=!0,this.currentPointIndex=0,this.startTime=performance.now(),this.totalDuration=t.points.reduce((i,r)=>i+r.duration,0);let e=this.getInitialState();return this.currentPosition={x:e.position.x,y:e.position.y,z:e.position.z},this.currentRotation={yaw:e.yaw,pitch:e.pitch},this.currentFov=e.fov,this.moveToPoint(0),!0}stopScript(){if(this.isRunning){for(let t of this.currentTweens)t.stop();this.currentTweens=[],this.isRunning=!1,this.currentScript=null,this.currentPointIndex=0}}runExampleScripts(t){let e=this.worldRenderer.getCameraPosition(),i=new Ar(e.x,e.y,e.z),r=n.createCircularFlyby(i,30,20,15e3),s=n.createSpiralDescent(i.offset(0,50,0),i,3,12e3),o=n.createBuildingTour([{pos:i.offset(-20,10,-20),lookAt:i,duration:3e3},{pos:i.offset(20,15,-20),lookAt:i,duration:3e3},{pos:i.offset(20,20,20),lookAt:i,duration:3e3},{pos:i.offset(-20,25,20),lookAt:i,duration:3e3}]),a=[r,s,o];return this.startScript(a[t]),{circular:r,spiral:s,buildingTour:o}}moveToPoint(t){if(!this.currentScript||t>=this.currentScript.points.length){this.handleScriptComplete();return}let e=this.currentScript.points[t],{duration:i}=e,r={x:e.x,y:e.y,z:e.z},s={yaw:e.yaw,pitch:e.pitch},o=e.fov??this.currentFov;if(e.lookAt){let d=new ae.Vector3(e.lookAt.x,e.lookAt.y,e.lookAt.z),f=new ae.Vector3(e.x,e.y,e.z),m=d.sub(f).normalize();s.yaw=Math.atan2(-m.x,-m.z),s.pitch=Math.asin(m.y)}let a=this.getEasingFunction(e.easing||"easeInOut"),v=new O0(this.currentPosition).to(r,i).easing(a).onUpdate(()=>{this.updateCamera(new Ar(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),l=new O0(this.currentRotation).to(this.wrapRotation(s),i).easing(a).onUpdate(()=>{this.updateCamera(new Ar(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),c=null;if(Math.abs(o-this.currentFov)>.1){let d={fov:this.currentFov};c=new O0(d).to({fov:o},i).easing(a).onUpdate(()=>{this.currentFov=d.fov,this.updateFov(this.currentFov)})}this.currentTweens=[v,l],c&&this.currentTweens.push(c),v.start(),l.start(),c?.start(),v.onComplete(()=>{this.currentPointIndex++,this.currentScript?.onPointReached?.(t,e),this.isRunning&&this.moveToPoint(this.currentPointIndex)})}wrapRotation(t){let e=t.yaw,i=e-this.currentRotation.yaw;i>Math.PI?e-=2*Math.PI:i<-Math.PI&&(e+=2*Math.PI);let r=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,t.pitch));return{yaw:e,pitch:r}}getEasingFunction(t){switch(t){case"linear":return I0.Linear.None;case"easeIn":return I0.Quadratic.In;case"easeOut":return I0.Quadratic.Out;case"easeInOut":return I0.Quadratic.InOut;case"smoothstep":return I0.Cubic.InOut;case"bounce":return I0.Bounce.Out;default:return I0.Quadratic.InOut}}handleScriptComplete(){if(!this.currentScript)return;let t=this.currentScript;t.loop?(this.currentPointIndex=0,this.moveToPoint(0)):(t.onComplete?.(),this.stopScript())}get running(){return this.isRunning}get progress(){if(!this.isRunning||this.totalDuration===0)return 0;let t=performance.now()-this.startTime;return Math.min(t/this.totalDuration,1)}get currentScriptName(){return this.currentScript?.name}static createCircularFlyby(t,e,i,r){let s=[];for(let a=0;a<=8;a++){let v=a/8*Math.PI*2,l=t.x+Math.cos(v)*e,c=t.z+Math.sin(v)*e,d=t.y+i;s.push({x:l,y:d,z:c,yaw:v+Math.PI/2,pitch:-.2,duration:r/8,easing:"smoothstep",lookAt:{x:t.x,y:t.y,z:t.z}})}return{name:"Circular Flyby",points:s,loop:!1}}static createSpiralDescent(t,e,i,r){let s=[],o=i*8,a=20;for(let v=0;v<=o;v++){let l=v/o,c=l*i*Math.PI*2,d=ae.MathUtils.lerp(t.x,e.x,l)+Math.cos(c)*a*(1-l),f=ae.MathUtils.lerp(t.z,e.z,l)+Math.sin(c)*a*(1-l),m=ae.MathUtils.lerp(t.y,e.y,l);s.push({x:d,y:m,z:f,yaw:c+Math.PI/2,pitch:-.3*l,duration:r/o,easing:"easeInOut"})}return{name:"Spiral Descent",points:s,loop:!1}}static createBuildingTour(t){return{name:"Building Tour",points:t.map((i,r)=>({x:i.pos.x,y:i.pos.y,z:i.pos.z,yaw:0,pitch:0,duration:i.duration||3e3,easing:"smoothstep",lookAt:i.lookAt?{x:i.lookAt.x,y:i.lookAt.y,z:i.lookAt.z}:void 0})),loop:!1}}};x();R();M();k();import*as t0 from"three";var Er=.75,Y1=class{constructor(t,e,i){this.scene=t;this.defaultSkybox=e;this.initialImage=i;u(this,"texture",null);u(this,"mesh",null);u(this,"skyMesh",null);u(this,"voidMesh",null);u(this,"worldTime",0);u(this,"partialTicks",0);u(this,"viewDistance",4);u(this,"temperature",Er);u(this,"inWater",!1);u(this,"waterBreathing",!1);u(this,"fogBrightness",0);u(this,"prevFogBrightness",0);u(this,"fogOrangeness",0);u(this,"distanceFactor",2.7);u(this,"brightnessAtPosition",1);u(this,"debugGui");this.debugGui=new Et("skybox_renderer",this,["temperature","worldTime","inWater","waterBreathing","fogOrangeness","brightnessAtPosition","distanceFactor"],{brightnessAtPosition:{min:0,max:1,step:.01},temperature:{min:0,max:1,step:.01},worldTime:{min:0,max:24e3,step:1},fogOrangeness:{min:-1,max:1,step:.01},distanceFactor:{min:0,max:5,step:.01}}),i||this.createGradientSky()}async init(){this.initialImage&&await this.setSkyboxImage(this.initialImage)}async setSkyboxImage(t){this.texture&&this.texture.dispose();let e=new t0.TextureLoader;if(this.texture=await new Promise(i=>{e.load(t,r=>{r.mapping=t0.EquirectangularReflectionMapping,r.encoding=t0.sRGBEncoding,r.minFilter=t0.NearestFilter,r.magFilter=t0.NearestFilter,r.needsUpdate=!0,i(r)})}),this.mesh)this.mesh.material.map=this.texture,this.mesh.material.needsUpdate=!0;else{let i=new t0.SphereGeometry(500,60,40);i.scale(-1,1,1);let r=new t0.MeshBasicMaterial({map:this.texture,side:t0.FrontSide});this.mesh=new t0.Mesh(i,r),this.scene.add(this.mesh)}}update(t,e){e!==this.viewDistance&&(this.viewDistance=e,this.updateSkyColors()),this.mesh?this.mesh.position.set(0,0,0):this.skyMesh&&(this.skyMesh.position.set(0,0,0),this.voidMesh?.position.set(0,0,0),this.updateSkyColors())}updateTime(t,e=0){this.debugGui.visible||(this.worldTime=t,this.partialTicks=e,this.updateSkyColors())}updateViewDistance(t){this.viewDistance=t,this.updateSkyColors()}updateTemperature(t){this.debugGui.visible||(this.temperature=t,this.updateSkyColors())}updateWaterState(t,e){this.debugGui.visible||(this.inWater=t,this.waterBreathing=e,this.updateSkyColors())}updateDefaultSkybox(t){this.debugGui.visible||(this.defaultSkybox=t,this.updateSkyColors())}createGradientSky(){{let i=new t0.PlaneGeometry(768,768);i.rotateX(-Math.PI/2),i.translate(0,16,0);let r=new t0.MeshBasicMaterial({color:16777215,side:t0.DoubleSide,depthTest:!1});this.skyMesh=new t0.Mesh(i,r),this.scene.add(this.skyMesh)}{let i=new t0.PlaneGeometry(768,768);i.rotateX(-Math.PI/2),i.translate(0,-16,0);let r=new t0.MeshBasicMaterial({color:16777215,side:t0.DoubleSide,depthTest:!1});this.voidMesh=new t0.Mesh(i,r),this.scene.add(this.voidMesh)}this.updateSkyColors()}getFogColor(t=0){let e=this.getCelestialAngle(t),i=Math.cos(e*Math.PI*2)*2+.5;i=Math.max(0,Math.min(1,i));let r=.7529412,s=.84705883,o=1;return r*=i*.94+.06,s*=i*.94+.06,o*=i*.91+.09,new t0.Vector3(r,s,o)}getSkyColor(t=0,e=0,i=0){let r=this.getCelestialAngle(i),s=Math.cos(r*3.141593*2)*2+.5;s<0&&(s=0),s>1&&(s=1);let o=this.getTemperature(t,e),a=this.getSkyColorByTemp(o),v=(a>>16&255)/255,l=(a>>8&255)/255,c=(a&255)/255;return new t0.Vector3(v*s,l*s,c*s)}calculateCelestialAngle(t,e){let r=(t%24e3+e)/24e3-.25;return r<0&&r++,r>1&&r--,r=1-(Math.cos(r*Math.PI)+1)/2,r+=(r-r)/3,r}getCelestialAngle(t){return this.calculateCelestialAngle(this.worldTime,t)}getTemperature(t,e){return this.temperature}getSkyColorByTemp(t){t/=3,t<-1&&(t=-1),t>1&&(t=1);let e=.6222222-t*.05,r=this.fogOrangeness>0?e+(.12-e)*this.fogOrangeness*.8:e+this.fogOrangeness*.1,s=.5+t*.1+Math.abs(this.fogOrangeness)*.3;return this.hsbToRgb(r,s,1)}hsbToRgb(t,e,i){let r=0,s=0,o=0;if(e===0)r=s=o=Math.floor(i*255+.5);else{let a=(t-Math.floor(t))*6,v=a-Math.floor(a),l=i*(1-e),c=i*(1-e*v),d=i*(1-e*(1-v));switch(Math.floor(a)){case 0:r=Math.floor(i*255+.5),s=Math.floor(d*255+.5),o=Math.floor(l*255+.5);break;case 1:r=Math.floor(c*255+.5),s=Math.floor(i*255+.5),o=Math.floor(l*255+.5);break;case 2:r=Math.floor(l*255+.5),s=Math.floor(i*255+.5),o=Math.floor(d*255+.5);break;case 3:r=Math.floor(l*255+.5),s=Math.floor(c*255+.5),o=Math.floor(i*255+.5);break;case 4:r=Math.floor(d*255+.5),s=Math.floor(l*255+.5),o=Math.floor(i*255+.5);break;case 5:r=Math.floor(i*255+.5),s=Math.floor(l*255+.5),o=Math.floor(c*255+.5);break}}return 4278190080|r<<16|s<<8|Math.trunc(o)}updateSkyColors(){if(!this.skyMesh||!this.voidMesh)return;if(!this.defaultSkybox){this.skyMesh.visible=!1,this.voidMesh.visible=!1,this.mesh&&(this.mesh.visible=!1);return}this.skyMesh.visible=!0,this.voidMesh.visible=!0,this.mesh&&(this.mesh.visible=!0),this.prevFogBrightness=this.fogBrightness;let t=this.viewDistance/32,e=this.brightnessAtPosition*(1-t)+t;if(this.fogBrightness+=(e-this.fogBrightness)*.1,this.inWater){let g=this.waterBreathing?100:5;this.scene.fog=new t0.Fog(new t0.Color(0,0,1),.0025,g),this.scene.background=new t0.Color(0,0,1),this.skyMesh.material.color.set(new t0.Color(0,0,1)),this.voidMesh.material.color.set(new t0.Color(0,0,.6));return}let i=this.viewDistance*16,r=1-(.25+.75*this.viewDistance/32)**.25,s=this.getCelestialAngle(this.partialTicks),o=this.getSkyColor(0,0,this.partialTicks),a=this.getFogColor(this.partialTicks),v=Math.cos(s*Math.PI*2)*2+.5,l=Math.max(0,Math.min(1,v)),c=this.prevFogBrightness+(this.fogBrightness-this.prevFogBrightness)*this.partialTicks,d=(a.x+(o.x-a.x)*r)*l*c,f=(a.y+(o.y-a.y)*r)*l*c,m=(a.z+(o.z-a.z)*r)*l*c;this.scene.background=new t0.Color(d,f,m),this.scene.fog=new t0.Fog(new t0.Color(d,f,m),.0025,i*this.distanceFactor),this.skyMesh.material.color.set(new t0.Color(o.x,o.y,o.z)),this.voidMesh.material.color.set(new t0.Color(o.x*.2+.04,o.y*.2+.04,o.z*.6+.1))}dispose(){this.texture&&this.texture.dispose(),this.mesh&&(this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.scene.remove(this.mesh)),this.skyMesh&&(this.skyMesh.geometry.dispose(),this.skyMesh.material.dispose(),this.scene.remove(this.skyMesh)),this.voidMesh&&(this.voidMesh.geometry.dispose(),this.voidMesh.material.dispose(),this.scene.remove(this.voidMesh))}};x();R();M();k();import*as i0 from"three";var F4=`
|
|
21188
21188
|
precision highp float;
|
|
21189
21189
|
attribute vec3 position;
|
|
21190
21190
|
attribute vec4 color;
|
|
@@ -21204,7 +21204,7 @@ void main() {
|
|
|
21204
21204
|
gl_PointSize = size * adjustSize * (300.0 / length(mvPosition.xyz));
|
|
21205
21205
|
gl_Position = projectionMatrix * mvPosition;
|
|
21206
21206
|
}
|
|
21207
|
-
`,
|
|
21207
|
+
`,L4=`
|
|
21208
21208
|
precision highp float;
|
|
21209
21209
|
uniform sampler2D texture;
|
|
21210
21210
|
varying vec4 vColor;
|
|
@@ -21213,7 +21213,7 @@ void main() {
|
|
|
21213
21213
|
vec4 texColor = texture2D(texture, gl_PointCoord);
|
|
21214
21214
|
gl_FragColor = vColor * texColor;
|
|
21215
21215
|
}
|
|
21216
|
-
`,Q0={textureSize:128,gravity:new i0.Vector3(0,-.005,0),friction:.998,defaultParticleSize:300,maxActiveFireworks:5},k5=n=>{let e=n*3;return{x:e,y:e+1,z:e+2}},T5=n=>{let e=n*4;return{r:e,g:e+1,b:e+2,a:e+3}},ne=(n=0,t=0)=>Math.floor(Math.random()*(n+1-t))+t,S4=(n,t,e,i)=>{n.save();let r=n.createRadialGradient(t,t,0,t,t,t);r.addColorStop(0,"rgba(255,255,255,1.0)"),r.addColorStop(.5,"rgba(255,255,255,0.5)"),r.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=r,n.fillRect(0,0,e,i),n.restore()},C4=()=>{let n=Q0.textureSize,t=W0(n,n),e=t.getContext("2d"),i=n/2;S4(e,i,t.width,t.height);let r=new i0.Texture(t);return r.needsUpdate=!0,r},P4=(n,t,e,i,r=Q0.defaultParticleSize)=>{let s=new i0.BufferGeometry,o=[],a=[],v=[],l=[],c=[],d=Math.random()>.3?"single":"multiple",f=ne(100,20)*.01,m=()=>ne(100,1)*.01,g="red",b=Math.random();b>.66?g="red":b>.33?g="green":g="blue";for(let _=0;_<n;_++){let w=new i0.Vector3(0,0,0);if(o.push(w.x,w.y,w.z),a.push(t[_].x,t[_].y,t[_].z),e==="seed"){let M=t[_].y**2*.04;_===0&&(M*=1.1),l.push(M),c.push(M*.017),v.push(1,1,1,1)}else if(e==="trail"){let M=Math.random()*.1+.1;l.push(M),c.push(M*.017),v.push(1,1,1,1)}else{let M=ne(r,10)*.001;if(l.push(M),c.push(M*.017),d==="multiple")v.push(m(),m(),m(),1);else switch(g){case"red":v.push(f,.1,.1,1);break;case"green":v.push(.1,f,.1,1);break;case"blue":v.push(.1,.1,f,1);break}}}s.setAttribute("position",new i0.Float32BufferAttribute(o,3)),s.setAttribute("velocity",new i0.Float32BufferAttribute(a,3)),s.setAttribute("color",new i0.Float32BufferAttribute(v,4)),s.setAttribute("adjustSize",new i0.Float32BufferAttribute(l,1)),s.setAttribute("mass",new i0.Float32BufferAttribute(c,1));let A=new i0.RawShaderMaterial({uniforms:{size:{value:Q0.textureSize},texture:{value:i}},transparent:!0,depthWrite:!1,blending:i0.AdditiveBlending,vertexShader:T4,fragmentShader:M4});return new i0.Points(s,A)},M5=class{constructor(t,e,i,r,s){u(this,"particleNum");u(this,"timerStartFading");u(this,"mesh");this.particleNum=t,this.timerStartFading=10,this.mesh=P4(t,e,i,r,s)}update(t){this.timerStartFading>0&&(this.timerStartFading-=.3);let e=this.mesh.geometry.attributes.position,i=this.mesh.geometry.attributes.velocity,r=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.5?.98:.96,a=v=>Math.random()>.5?0:(1-v)*.1;for(let v=0;v<this.particleNum;v++){let{x:l,y:c,z:d}=k5(v);i.array[c]+=t.y-s.array[v],i.array[l]*=Q0.friction,i.array[d]*=Q0.friction,i.array[c]*=Q0.friction,e.array[l]+=i.array[l],e.array[c]+=i.array[c],e.array[d]+=i.array[d];let{a:f}=T5(v);this.timerStartFading<=0&&(r.array[f]*=o()-a(r.array[f]),r.array[f]<.001&&(r.array[f]=0))}e.needsUpdate=!0,i.needsUpdate=!0,r.needsUpdate=!0}disposeAll(){this.mesh.geometry.dispose(),this.mesh.material.dispose()}},_r=class extends M5{constructor(t,e,i){super(t,e,"seed",i)}update(t){let e=this.mesh.geometry.attributes.position,i=this.mesh.geometry.attributes.velocity,r=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.99:.96,a=d=>Math.random()>.3?0:(1-d)*.1,v=()=>Math.random()>.5?.05:-.05,l=()=>Math.random()>.1,c=Q0.friction*.98;for(let d=0;d<this.particleNum;d++){let{x:f,y:m,z:g}=k5(d);i.array[m]+=t.y-s.array[d],i.array[f]*=c,i.array[g]*=c,i.array[m]*=c,e.array[f]+=i.array[f],e.array[m]+=i.array[m],e.array[g]+=i.array[g],l()&&(e.array[f]+=v()),l()&&(e.array[g]+=v());let{a:b}=T5(d);r.array[b]*=o()-a(r.array[b]),r.array[b]<.001&&(r.array[b]=0)}e.needsUpdate=!0,i.needsUpdate=!0,r.needsUpdate=!0}},wr=class extends M5{constructor(t,e,i){super(t,e,"trail",i)}update(t){let e=this.mesh.geometry.attributes.position,i=this.mesh.geometry.attributes.velocity,r=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.98:.95,a=()=>Math.random()>.5?.05:-.05,v=()=>Math.random()>.2;for(let l=0;l<this.particleNum;l++){let{x:c,y:d,z:f}=k5(l);i.array[d]+=t.y-s.array[l],i.array[c]*=Q0.friction,i.array[f]*=Q0.friction,i.array[d]*=Q0.friction,e.array[c]+=i.array[c],e.array[d]+=i.array[d],e.array[f]+=i.array[f],v()&&(e.array[c]+=a()),v()&&(e.array[f]+=a());let{a:m}=T5(l);r.array[m]*=o(),r.array[m]<.001&&(r.array[m]=0)}e.needsUpdate=!0,i.needsUpdate=!0,r.needsUpdate=!0}},S5=class{constructor(t,e=Q0.defaultParticleSize,i){u(this,"meshGroup");u(this,"isExplode");u(this,"petalsNum");u(this,"life");u(this,"seed");u(this,"flowerSizeRate");u(this,"flower");u(this,"texture");u(this,"particleSize");this.meshGroup=new i0.Group,this.isExplode=!1,this.texture=t,this.particleSize=e;let r=400,s=150;this.petalsNum=ne(r,s),this.life=150,this.seed=this.getSeed(i),this.meshGroup.add(this.seed.mesh),this.flowerSizeRate=i0.MathUtils.mapLinear(this.petalsNum,s,r,.4,.7)}getSeed(t){let i=[];for(let s=0;s<40;s++){let a=s===0?Math.random()*2.5+.9:Math.random()*2+.4,v=0;i.push(new i0.Vector3(0,a,v))}let r=new _r(40,i,this.texture);if(t)r.mesh.position.set(0,0,0);else{let s=Math.random()*80-40,o=-50,a=Math.random()*80-40;r.mesh.position.set(s,o,a)}return r}explode(t){this.isExplode=!0,this.flower=this.getFlower(t),this.meshGroup.add(this.flower.mesh),this.meshGroup.remove(this.seed.mesh),this.seed.disposeAll()}getFlower(t){let e=this.petalsNum,i=[],r;if(Math.random()>.5)for(let a=0;a<e;a++){r=ne(120,60)*.01;let v=i0.MathUtils.degToRad(Math.random()*180),l=i0.MathUtils.degToRad(Math.random()*360),c=Math.sin(v)*Math.cos(l)*r,d=Math.sin(v)*Math.sin(l)*r,f=Math.cos(v)*r,m=new i0.Vector3(c,d,f);m.multiplyScalar(this.flowerSizeRate),i.push(m)}else{let a=180/e,v=360*(Math.random()*20+1)/e,l=v,c=v;r=ne(120,60)*.01;for(let d=0;d<e;d++){let f=Math.sin(i0.MathUtils.degToRad(a*d)),m=Math.cos(i0.MathUtils.degToRad(a*d))*r,g=Math.cos(i0.MathUtils.degToRad(l*d))*f*r,b=Math.sin(i0.MathUtils.degToRad(c*d))*f*r,A=new i0.Vector3(g,b,m);A.multiplyScalar(this.flowerSizeRate),i.push(A)}}let o=new M5(e,i,"default",this.texture,this.particleSize);return o.mesh.position.set(t.x,t.y,t.z),o}update(t){this.isExplode?(this.flower.update(t),this.life>0&&(this.life-=1)):this.drawTail()}drawTail(){this.seed.update(Q0.gravity);let t=this.seed.mesh.geometry.attributes.position,e=this.seed.mesh.geometry.attributes.velocity,i=0;for(let d=0,f=e.array.length;d<f;d++){let m=e.array[d];d%3===1&&m>0&&i++}if(!(i===0))return;let{x:s,y:o,z:a}=this.seed.mesh.position,v=new i0.Vector3(s,o,a),l=0,c;for(let d=0,f=t.array.length;d<f;d++){let m=t.array[d];d%3===1&&m>l&&(l=m,c=new i0.Vector3(t.array[d-1],m,t.array[d+2]))}c&&(v.add(c),this.explode(v))}},Oe=class extends S5{constructor(e,i=Q0.defaultParticleSize,r){super(e,i,r);u(this,"tailMeshGroup");u(this,"tails");let s=150,o=100;this.petalsNum=ne(s,o),this.flowerSizeRate=i0.MathUtils.mapLinear(this.petalsNum,o,s,.4,.7),this.tailMeshGroup=new i0.Group,this.tails=[]}explode(e){this.isExplode=!0,this.flower=this.getFlower(e),this.tails=this.getTail(),this.meshGroup.add(this.flower.mesh),this.meshGroup.add(this.tailMeshGroup)}getTail(){let e=[],r=this.flower.mesh.geometry.attributes.color;for(let s=0;s<this.petalsNum;s++){let o=[];for(let C=0;C<20;C++)o.push(new i0.Vector3(0,0,0));let a=new wr(20,o,this.texture),{r:v,g:l,b:c,a:d}=T5(s),f=r.array[v],m=r.array[l],g=r.array[c],b=r.array[d],A=a.mesh.geometry.attributes.position,_=a.mesh.geometry.attributes.color;for(let C=0;C<A.count;C++){let H=T5(C);_.array[H.r]=f,_.array[H.g]=m,_.array[H.b]=g,_.array[H.a]=b}let{x:w,y:M,z:S}=this.flower.mesh.position;a.mesh.position.set(w,M,S),e.push(a),this.tailMeshGroup.add(a.mesh)}return e}update(e){if(this.isExplode){this.flower.update(e);let i=this.flower.mesh.geometry.attributes.position;for(let r=0,s=this.tails.length;r<s;r++){let o=this.tails[r];o.update(e);let{x:a,y:v,z:l}=k5(r),c=new i0.Vector3(i.array[a],i.array[v],i.array[l]),d=o.mesh.geometry.attributes.position,f=o.mesh.geometry.attributes.velocity;for(let m=0;m<d.count;m++){let g=k5(m),b=new i0.Vector3,A=new i0.Vector3(d.array[g.x],d.array[g.y],d.array[g.z]),_=new i0.Vector3(f.array[g.x],f.array[g.y],f.array[g.z]);b.subVectors(c,A);let w=b.sub(_);w.normalize(),w.multiplyScalar(Math.random()*3e-4*this.life),f.array[g.x]+=w.x,f.array[g.y]+=w.y,f.array[g.z]+=w.z}f.needsUpdate=!0}this.life>0&&(this.life-=1.2)}else this.drawTail()}},U1=class{constructor(t,e,i){u(this,"fireworksInstances");u(this,"scene");u(this,"sceneOrigin");u(this,"texture");u(this,"particleSize");u(this,"maxFireworks");this.fireworksInstances=[],this.scene=t,this.sceneOrigin=e,this.texture=C4(),this.particleSize=i?.defaultParticleSize??Q0.defaultParticleSize,this.maxFireworks=i?.maxActiveFireworks??Q0.maxActiveFireworks}launchFirework(t){if(this.fireworksInstances.length>=this.maxFireworks)return;let e=t?.particleSize??this.particleSize,i=t?.position,r;t?.forceRich?r=new Oe(this.texture,e,i):t?.forceBasic?r=new S5(this.texture,e,i):r=Math.random()>.5?new S5(this.texture,e,i):new Oe(this.texture,e,i),this.fireworksInstances.push(r),i?(this.sceneOrigin.addAndTrack(r.meshGroup),r.meshGroup.position.set(i.x,i.y,i.z)):this.scene.add(r.meshGroup)}repositionAll(){}update(){let t=[];for(let e=this.fireworksInstances.length-1;e>=0;e--){let i=this.fireworksInstances[e];i.update(Q0.gravity),i.isExplode&&t.push(e)}for(let e=0,i=t.length;e<i;e++){let r=t[e],s=this.fireworksInstances[r];if(s&&(s.meshGroup.remove(s.seed.mesh),s.seed.disposeAll(),s.life<=0)){if(this.sceneOrigin.removeAndUntrack(s.meshGroup),s instanceof Oe&&s.tailMeshGroup)for(let o of s.tails)o.disposeAll();s.flower?.disposeAll(),this.fireworksInstances.splice(r,1)}}}clear(){for(let t of this.fireworksInstances)if(this.sceneOrigin.removeAndUntrack(t.meshGroup),t.seed.disposeAll(),t.flower&&t.flower.disposeAll(),t instanceof Oe)for(let e of t.tails)e.disposeAll();this.fireworksInstances=[]}dispose(){this.clear(),this.texture.dispose()}};x();R();T();k();var wo=Symbol("tracked-proxy"),B4=new Set(["add","addScalar","addScaledVector","addVectors","sub","subScalar","subVectors","multiply","multiplyScalar","multiplyVectors","divide","divideScalar","applyEuler","applyAxisAngle","applyMatrix3","applyMatrix4","applyNormalMatrix","applyQuaternion","negate","floor","ceil","round","roundToZero","min","max","clamp","clampLength","clampScalar","project","unproject","reflect","lerp","lerpVectors","cross","crossVectors","setFromMatrixPosition","setFromMatrixColumn","setFromMatrix3Column","setFromEuler","setFromSpherical","setFromSphericalCoords","setFromCylindrical","fromArray","fromBufferAttribute","setComponent","randomDirection","random"]),G1=class{constructor(t){u(this,"scene");u(this,"_x",0);u(this,"_y",0);u(this,"_z",0);u(this,"_tracked",new Set);u(this,"_worldCoords",new WeakMap);u(this,"_originalPositions",new WeakMap);u(this,"_trackOptions",new WeakMap);this.scene=t}get x(){return this._x}get y(){return this._y}get z(){return this._z}update(t,e,i){this._x=t,this._y=e,this._z=i;for(let r of this._tracked){let s=this._worldCoords.get(r);this._originalPositions.get(r).set(s.x-t,s.y-e,s.z-i),this._trackOptions.get(r)?.updateMatrix&&r.updateMatrix()}}track(t,e){let i=this._originalPositions.get(t)??t.position,r={x:0,y:0,z:0};this._originalPositions.set(t,i),this._worldCoords.set(t,r),e?this._trackOptions.set(t,e):this._trackOptions.delete(t);let s=this,o=e,a=new Proxy(i,{get(v,l,c){if(l===wo)return r;if(l==="set")return(f,m,g)=>(r.x=f,r.y=m,r.z=g,v.set(f-s._x,m-s._y,g-s._z),o?.updateMatrix&&t.updateMatrix(),c);if(l==="copy")return f=>{let m=f[wo],g=m?m.x:f.x,b=m?m.y:f.y,A=m?m.z:f.z;return r.x=g,r.y=b,r.z=A,v.set(g-s._x,b-s._y,A-s._z),o?.updateMatrix&&t.updateMatrix(),c};if(l==="setX")return f=>(r.x=f,v.x=f-s._x,o?.updateMatrix&&t.updateMatrix(),c);if(l==="setY")return f=>(r.y=f,v.y=f-s._y,o?.updateMatrix&&t.updateMatrix(),c);if(l==="setZ")return f=>(r.z=f,v.z=f-s._z,o?.updateMatrix&&t.updateMatrix(),c);if(typeof l=="string"&&B4.has(l))return()=>{throw new Error(`Cannot call position.${l}() on a tracked object. Use position.set(x, y, z) instead.`)};let d=v[l];return typeof d=="function"?d.bind(v):d},set(v,l,c){return l==="x"?(r.x=c,v.x=c-s._x,o?.updateMatrix&&t.updateMatrix(),!0):l==="y"?(r.y=c,v.y=c-s._y,o?.updateMatrix&&t.updateMatrix(),!0):l==="z"?(r.z=c,v.z=c-s._z,o?.updateMatrix&&t.updateMatrix(),!0):(v[l]=c,!0)}});Object.defineProperty(t,"position",{value:a,configurable:!0,enumerable:!0}),this._tracked.add(t)}untrack(t){let e=this._originalPositions.get(t);e&&(Object.defineProperty(t,"position",{value:e,configurable:!0,enumerable:!0}),this._tracked.delete(t),this._worldCoords.delete(t),this._originalPositions.delete(t),this._trackOptions.delete(t))}addAndTrack(t,e){this.track(t,e),this.scene.add(t)}removeAndUntrack(t){this.untrack(t),t.removeFromParent()}removeAndUntrackAll(t){t.traverse(e=>{this.untrack(e)}),t.removeFromParent()}getWorldPosition(t){let e=this._worldCoords.get(t);return e?{x:e.x,y:e.y,z:e.z}:void 0}clear(){for(let t of this._tracked)this.untrack(t)}get trackedCount(){return this._tracked.size}toSceneX(t){return t-this._x}toSceneY(t){return t-this._y}toSceneZ(t){return t-this._z}toWorldX(t){return t+this._x}toWorldY(t){return t+this._y}toWorldZ(t){return t+this._z}};Er();x();R();T();k();import G4 from"prismarine-chat";import*as X from"three";import*as W1 from"prismarine-nbt";import{Vec3 as xr}from"vec3";x();R();T();k();import*as Z0 from"three";var To=20,Mo=40,z4={white_banner:15,orange_banner:14,magenta_banner:13,light_blue_banner:12,yellow_banner:11,lime_banner:10,pink_banner:9,gray_banner:8,light_gray_banner:7,cyan_banner:6,purple_banner:5,blue_banner:4,brown_banner:3,green_banner:2,red_banner:1,black_banner:0},So={0:"#1d1d21",1:"#b02e26",2:"#5e7c16",3:"#835432",4:"#3c44aa",5:"#8932b8",6:"#169c9c",7:"#9d9d97",8:"#474f52",9:"#f38baa",10:"#80c71f",11:"#fed83d",12:"#3ab3da",13:"#c74ebd",14:"#f9801d",15:"#f9fffe"};function D4(n){let t=n.replace("_wall_banner","_banner");return z4[t]??15}var F4=(n,t,e,i,r,s,o)=>{switch(n.fillStyle=e,t){case"bs":n.fillRect(i,r,s,o);break;case"ls":n.fillRect(i,r,s/3,o);break;case"rs":n.fillRect(i+s*2/3,r,s/3,o);break;case"ts":n.fillRect(i,r,s,o/3);break;case"ms":n.fillRect(i,r+o/3,s,o/3);break;case"drs":n.fillRect(i,r,s/2,o/2);break;case"dls":n.fillRect(i+s/2,r,s/2,o/2);break;case"ss":for(let a=0;a<s;a+=2)n.fillRect(i+a,r,1,o);break;case"cr":n.fillRect(i,r+o/3,s,o/3),n.fillRect(i+s/3,r,s/3,o);break;case"sc":n.fillRect(i,r+o/2-1,s,2),n.fillRect(i+s/2-1,r,2,o);break;default:n.fillRect(i,r,s,o)}};function L4(n,t){if(!t||t.length===0)return`banner_${n}_empty`;let e=t.map(i=>`${i.Pattern??"bs"}_${i.Color??0}`).join(",");return`banner_${n}_${e}`}var U4=(n,t,e=(i,r)=>W0(i,r))=>{let r=e(To*1,Mo*1),s=r.getContext("2d");if(s){if(s.imageSmoothingEnabled=!1,t?.Patterns&&t.Patterns.length>0)for(let o of t.Patterns){let a=o.Color??0,v=o.Pattern??"bs",l=So[a]||So[0];F4(s,v,l,0,0,To*1,Mo*1)}return r}},N1=new Map;function Co(n,t,e){let i=D4(t),r=L4(i,e?.Patterns),s=N1.get(r);if(s)return s.refCount++,s.texture;let o=U4(i,e);if(!o)return;let a=new Z0.Texture(o);return a.magFilter=Z0.NearestFilter,a.minFilter=Z0.NearestFilter,a.needsUpdate=!0,N1.set(r,{texture:a,refCount:1}),a}function Po(n){for(let[t,e]of N1.entries())if(e.texture===n){e.refCount--,e.refCount<=0&&(e.texture.dispose(),N1.delete(t));return}}function Bo(n,t,e,i){let a,v,l;e?(a=(-14.6+13.4)/2/16-.5,v=1-14.75/16-.5,l=1/2):(a=(1.4+29.4)/2/16,v=1-7.25/16-.5,l=0);let c=new Z0.Mesh(new Z0.PlaneGeometry(.85,1.75),new Z0.MeshBasicMaterial({map:i,transparent:!0}));c.renderOrder=999;let d=.5/16,f=.25/16;e?c.position.set(0,a,v+f+.004):c.position.set(0,a,v+d/2+.004);let m=new Z0.Group;return m.rotation.set(0,-Z0.MathUtils.degToRad(t*(e?90:45/2)),0),m.add(c),m.bannerTexture=i,m.position.set(n.x+.5,n.y+l,n.z+.5),m}var se=class se{constructor(t,e,i,r,s=3){this.worldRenderer=t;this.scene=e;this.material=i;this.worldHeight=r;u(this,"meshPool",[]);u(this,"activeSections",new Map);u(this,"sectionObjects",{});u(this,"waitingChunksToDisplay",{});u(this,"pendingNearReveal",new Map);u(this,"nearRevealTimers",new Map);u(this,"nearRevealGraceTimers",new Map);u(this,"poolSize");u(this,"maxPoolSize");u(this,"minPoolSize");u(this,"signHeadsRenderer");u(this,"chunkBoxMaterial",new X.MeshBasicMaterial({color:0,transparent:!0,opacity:0}));u(this,"hits",0);u(this,"misses",0);u(this,"bypassPooling",!1);u(this,"renderTimes",[]);u(this,"maxRenderTimeSamples",30);u(this,"_performanceOverrideDistance");u(this,"lastPerformanceCheck",0);u(this,"performanceCheckInterval",2e3);this.updateViewDistance(s),this.signHeadsRenderer=new Rr(t),this.initializePool()}get performanceOverrideDistance(){return this._performanceOverrideDistance??0}set performanceOverrideDistance(t){this._performanceOverrideDistance=t,this.updateSectionsVisibility()}initializePool(){for(let t=0;t<this.poolSize;t++){let e=new X.BufferGeometry,i=new X.Mesh(e,this.material);i.visible=!1,i.matrixAutoUpdate=!1,i.name="pooled-section-mesh";let r={mesh:i,inUse:!1,lastUsedTime:0};this.meshPool.push(r)}}updateSection(t,e){let i=this.sectionObjects[t];i&&this.cleanupSection(t);let r=this.activeSections.get(t);if(!r){if(r=this.acquireMesh(),!r)return null;this.activeSections.set(t,r),r.sectionKey=t}let{mesh:s}=r;this.updateGeometryAttribute(s.geometry,"position",e.positions,3),this.updateGeometryAttribute(s.geometry,"normal",e.normals,3),this.updateGeometryAttribute(s.geometry,"color",e.colors,3),this.updateGeometryAttribute(s.geometry,"uv",e.uvs,2),s.geometry.index=new X.BufferAttribute(e.indices,1),s.geometry.boundingBox=new X.Box3(new X.Vector3(-8,-8,-8),new X.Vector3(8,8,8)),s.geometry.boundingSphere=new X.Sphere(new X.Vector3(0,0,0),Math.sqrt(3*8**2)),this.worldRenderer.sceneOrigin.track(s,{updateMatrix:!0}),s.position.set(e.sx,e.sy,e.sz),s.updateMatrix(),s.visible=!0,s.name="mesh",r.lastUsedTime=performance.now(),i=new X.Group,i.add(s),i.mesh=s,i.tilesCount=e.positions.length/3/4,i.blocksCount=e.blocksCount,i.worldX=e.sx,i.worldY=e.sy,i.worldZ=e.sz,i.sectionKey=t,i.name="chunk";try{if(Object.keys(e.signs).length>0){let c=new X.Group;c.name="signs";for(let[d,{isWall:f,isHanging:m,rotation:g}]of Object.entries(e.signs)){let b=this.worldRenderer.blockEntities[d];if(!b)continue;let[A,_,w]=d.split(","),M=this.signHeadsRenderer.renderSign(new xr(+A,+_,+w),g,f,m,W1.simplify(b));M&&c.add(M)}i.add(c),i.signsContainer=c}if(Object.keys(e.heads).length>0){let c=new X.Group;c.name="heads";for(let[d,{isWall:f,rotation:m}]of Object.entries(e.heads)){let g=this.worldRenderer.blockEntities[d];if(!g)continue;let[b,A,_]=d.split(","),w=this.signHeadsRenderer.renderHead(new xr(+b,+A,+_),m,f,W1.simplify(g));w&&c.add(w)}i.add(c),i.headsContainer=c}if(Object.keys(e.banners).length>0){let c=new X.Group;c.name="banners",i.bannersContainer=c,i.add(c);for(let[d,{isWall:f,rotation:m,blockName:g}]of Object.entries(e.banners)){let b=this.worldRenderer.blockEntities[d];if(!b)continue;let[A,_,w]=d.split(","),M=Co(this.worldRenderer,g,W1.simplify(b));if(!M)continue;let S=Bo(new xr(+A,+_,+w),m,f,M),{x:C,y:H,z:B}=S.position;this.worldRenderer.sceneOrigin.track(S),S.position.set(C,H,B),c.add(S)}}}catch{}this.sectionObjects[t]=i,this.scene.add(i),i.matrixAutoUpdate=!1,this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&this.updateBoxHelper(t,!0);let o=t.split(","),a=`${o[0]},${o[2]}`,v=!!this.worldRenderer.displayOptions?.inWorldRenderingConfig?._renderByChunks,l=!!this.worldRenderer.worldRendererConfig?.wasmMesher;if((v||l)&&!this.worldRenderer.finishedChunks[a]){i.visible=!1,i._waitingForChunkDisplay=!0;let c=this.waitingChunksToDisplay[a]??(this.waitingChunksToDisplay[a]=[]);c.includes(t)||c.push(t)}return i}finishChunkDisplay(t){if(!this.waitingChunksToDisplay[t]){this.tryRevealPending();return}if(this.isWasmGateActive()&&this.isBlockedByNearer(t,0)){this.pendingNearReveal.set(t,Date.now()),this.armNearRevealTimer(t),this.armExpectedGraceTimer(t);return}this.flushChunkDisplay(t),this.tryRevealPending()}flushChunkDisplay(t){let e=this.waitingChunksToDisplay[t];if(this.pendingNearReveal.delete(t),this.clearNearRevealTimer(t),this.clearExpectedGraceTimer(t),!!e){for(let i of e){let r=this.sectionObjects[i];r&&(r._waitingForChunkDisplay=!1,r.visible=!0)}delete this.waitingChunksToDisplay[t]}}tryRevealPending(){if(this.pendingNearReveal.size===0)return;let t=Date.now();for(let[e,i]of[...this.pendingNearReveal])this.isBlockedByNearer(e,t-i)||this.flushChunkDisplay(e)}onChunkRemovedFromGate(t){this.pendingNearReveal.delete(t),this.clearNearRevealTimer(t),this.clearExpectedGraceTimer(t),delete this.waitingChunksToDisplay[t],this.tryRevealPending()}isWasmGateActive(){return!!this.worldRenderer.worldRendererConfig?.wasmMesher}isBlockedByNearer(t,e){let i=this.worldRenderer.viewerChunkPosition;if(!i)return!1;let r=t.split(",");if(r.length!==2)return!1;let s=Number(r[0]),o=Number(r[1]),a=Math.floor(i.x/16),v=Math.floor(i.z/16),l=(s>>4)-a,c=(o>>4)-v,d=l*l+c*c;if(d===0)return!1;let f=this.worldRenderer.finishedChunks,m=this.worldRenderer.loadedChunks,g=this.worldRenderer.viewDistance;if(e<se.EXPECTED_NEAR_GRACE_MS&&g>0){let A=g*g,_=Math.min(g,Math.ceil(Math.sqrt(Math.max(0,d-1))));for(let w=-_;w<=_;w++)for(let M=-_;M<=_;M++){let S=w*w+M*M;if(S>=d||S>A)continue;let C=a+w<<4,H=v+M<<4,B=`${C},${H}`;if(B!==t&&!f[B])return!0}return!1}for(let A in m){if(A===t||f[A])continue;let _=A.split(",");if(_.length!==2)continue;let w=(Number(_[0])>>4)-a,M=(Number(_[1])>>4)-v;if(w*w+M*M<d)return!0}return!1}armNearRevealTimer(t){if(this.nearRevealTimers.has(t))return;let e=setTimeout(()=>{this.nearRevealTimers.delete(t),this.pendingNearReveal.has(t)&&(this.flushChunkDisplay(t),this.tryRevealPending())},se.NEAR_REVEAL_TIMEOUT_MS);this.nearRevealTimers.set(t,e)}clearNearRevealTimer(t){let e=this.nearRevealTimers.get(t);e&&(clearTimeout(e),this.nearRevealTimers.delete(t))}armExpectedGraceTimer(t){if(this.nearRevealGraceTimers.has(t))return;let e=setTimeout(()=>{this.nearRevealGraceTimers.delete(t),this.pendingNearReveal.has(t)&&this.tryRevealPending()},se.EXPECTED_NEAR_GRACE_MS+50);this.nearRevealGraceTimers.set(t,e)}clearExpectedGraceTimer(t){let e=this.nearRevealGraceTimers.get(t);e&&(clearTimeout(e),this.nearRevealGraceTimers.delete(t))}cleanupSection(t){let e=this.sectionObjects[t];if(e){if(e._waitingForChunkDisplay){let i=t.split(","),r=`${i[0]},${i[2]}`,s=this.waitingChunksToDisplay[r];if(s){let o=s.indexOf(t);o!==-1&&s.splice(o,1),s.length===0&&delete this.waitingChunksToDisplay[r]}}if(e.bannersContainer&&(e.bannersContainer.traverse(i=>{i.bannerTexture&&Po(i.bannerTexture)}),this.disposeContainer(e.bannersContainer)),e.signsContainer&&this.disposeContainer(e.signsContainer),e.headsContainer&&this.disposeContainer(e.headsContainer),this.worldRenderer.sceneOrigin.removeAndUntrackAll(e),this.scene.remove(e),e.boxHelper){this.worldRenderer.sceneOrigin.removeAndUntrack(e.boxHelper),this.scene.remove(e.boxHelper),e.boxHelper.geometry.dispose();let i=e.boxHelper.material;if(Array.isArray(i))for(let r of i)r.dispose();else i.dispose();e.boxHelper=void 0}delete this.sectionObjects[t]}}releaseSection(t){this.cleanupSection(t);let e=this.activeSections.get(t);return e?(e.mesh.visible=!1,e.inUse=!1,e.sectionKey=void 0,e.lastUsedTime=0,this.clearGeometry(e.mesh.geometry),this.activeSections.delete(t),this.cleanupExcessMeshes(),!0):!1}getSectionObject(t){return this.sectionObjects[t]}updateBoxHelper(t,e,i=this.chunkBoxMaterial){let r=this.sectionObjects[t];if(r?.mesh)if(e){if(!r.boxHelper){let s=new X.Mesh(new X.BoxGeometry(16,16,16),i),o=new X.BoxHelper(s,16776960);o.name="helper";let a=r.worldX??0,v=r.worldY??0,l=r.worldZ??0;this.worldRenderer.sceneOrigin.track(o,{updateMatrix:!0}),o.position.set(a,v,l),o.updateMatrix(),this.scene.add(o),r.boxHelper=o}r.boxHelper.visible=!0}else r.boxHelper&&(r.boxHelper.visible=!1)}updateAllBoxHelpers(t){for(let e of Object.keys(this.sectionObjects))this.updateBoxHelper(e,t)}cleanSignChunkTextures(t,e){this.signHeadsRenderer.cleanChunkTextures(t,e)}getSectionMesh(t){return this.activeSections.get(t)?.mesh}hasSection(t){return this.activeSections.has(t)}updateViewDistance(t){let e=(t*2+1)**2,i=this.worldHeight/16,r=5;if(this.minPoolSize=Math.floor(e*r),this.maxPoolSize=Math.floor(e*i)+1,this.poolSize??(this.poolSize=this.minPoolSize),this.minPoolSize>this.poolSize){let s=Math.min(this.minPoolSize,this.maxPoolSize);this.expandPool(s)}}getStats(){let t=this.meshPool.filter(r=>!r.inUse).length,e=this.hits+this.misses>0?(this.hits/(this.hits+this.misses)*100).toFixed(1):"0",i=this.getEstimatedMemoryUsage();return{poolSize:this.poolSize,activeCount:this.activeSections.size,freeCount:t,hitRate:`${e}%`,hits:this.hits,misses:this.misses,memoryUsage:i}}getTotalTiles(){return Object.values(this.sectionObjects).reduce((t,e)=>t+(e.tilesCount||0),0)}getTotalBlocks(){return Object.values(this.sectionObjects).reduce((t,e)=>t+(e.blocksCount||0),0)}getEstimatedMemoryUsage(){let t=0,e=0,i=0,r=0,s=0,o=0;for(let v of this.meshPool)if(v.inUse&&v.mesh.geometry){let{geometry:l}=v.mesh,c=l.getAttribute("position");if(c){let g=c.array.byteLength;e+=g,t+=g}let d=l.getAttribute("normal");if(d){let g=d.array.byteLength;i+=g,t+=g}let f=l.getAttribute("color");if(f){let g=f.array.byteLength;r+=g,t+=g}let m=l.getAttribute("uv");if(m){let g=m.array.byteLength;s+=g,t+=g}if(l.index){let g=l.index.array.byteLength;o+=g,t+=g}}return{total:`${(t/(1024*1024)).toFixed(2)} MB`,breakdown:{position:`${(e/(1024*1024)).toFixed(2)} MB`,normal:`${(i/(1024*1024)).toFixed(2)} MB`,color:`${(r/(1024*1024)).toFixed(2)} MB`,uv:`${(s/(1024*1024)).toFixed(2)} MB`,index:`${(o/(1024*1024)).toFixed(2)} MB`}}}dispose(){let t=[...this.activeSections.keys()];for(let e of t)this.releaseSection(e);this.signHeadsRenderer.dispose();for(let e of this.meshPool)e.mesh.geometry.dispose();this.meshPool.length=0,this.activeSections.clear(),this.chunkBoxMaterial.dispose(),this.pendingNearReveal.clear();for(let e of this.nearRevealTimers.values())clearTimeout(e);this.nearRevealTimers.clear();for(let e of this.nearRevealGraceTimers.values())clearTimeout(e);this.nearRevealGraceTimers.clear()}acquireMesh(){if(this.bypassPooling){let e={mesh:new X.Mesh(new X.BufferGeometry,this.material),inUse:!0,lastUsedTime:performance.now()};return this.meshPool.push(e),this.poolSize++,e}for(let e of this.meshPool)if(!e.inUse)return e.inUse=!0,e.lastUsedTime=performance.now(),this.hits++,e;this.misses++;let t=Math.min(this.poolSize+16,this.maxPoolSize);t<=this.meshPool.length&&(t=this.meshPool.length+8,this.maxPoolSize=t),this.expandPool(t);for(let e=this.meshPool.length-1;e>=0;e--){let i=this.meshPool[e];if(!i.inUse)return i.inUse=!0,i.lastUsedTime=performance.now(),i}throw new Error("ChunkMeshManager: Failed to acquire mesh after pool expansion")}expandPool(t){let e=this.meshPool.length;this.poolSize=t;for(let i=e;i<t;i++){let r=new X.BufferGeometry,s=new X.Mesh(r,this.material);s.visible=!1,s.matrixAutoUpdate=!1,s.name="pooled-section-mesh";let o={mesh:s,inUse:!1,lastUsedTime:0};this.meshPool.push(o)}}updateGeometryAttribute(t,e,i,r){let s=t.getAttribute(e);s&&s.count===i.length/r?(s.array.set(i),s.needsUpdate=!0):t.setAttribute(e,new X.BufferAttribute(i,r))}clearGeometry(t){let e=["position","normal","color","uv"];for(let i of e)t.hasAttribute(i)&&t.deleteAttribute(i);t.index&&t.setIndex(null),t.boundingBox=null,t.boundingSphere=null}cleanupExcessMeshes(){if(this.poolSize>this.maxPoolSize){let t=this.meshPool.filter(e=>!e.inUse).length;if(t>0){let e=Math.min(this.poolSize-this.maxPoolSize,t);for(let i=0;i<e;i++){let r=this.meshPool.findIndex(s=>!s.inUse);r!==-1&&(this.meshPool[r].mesh.geometry.dispose(),this.meshPool.splice(r,1),this.poolSize--)}}}}disposeContainer(t){R0(t,!0)}recordRenderTime(t){this.renderTimes.push(t),this.renderTimes.length>this.maxRenderTimeSamples&&this.renderTimes.shift();let e=performance.now();e-this.lastPerformanceCheck>this.performanceCheckInterval&&(this.checkPerformance(),this.lastPerformanceCheck=e)}getEffectiveRenderDistance(){return this.performanceOverrideDistance||this.worldRenderer.viewDistance}resetPerformanceOverride(){this.performanceOverrideDistance=void 0,this.renderTimes.length=0}getAverageRenderTime(){return this.renderTimes.length===0?0:this.renderTimes.reduce((t,e)=>t+e,0)/this.renderTimes.length}checkPerformance(){if(this.renderTimes.length<this.maxRenderTimeSamples)return;let t=this.getAverageRenderTime(),e=16.67,i=e*1.5;if(t>i){let r=this.worldRenderer.viewDistance,s=Math.max(1,Math.floor(r*.8));(!this.performanceOverrideDistance||s<this.performanceOverrideDistance)&&(this.performanceOverrideDistance=s)}else if(this.performanceOverrideDistance&&t<e*1.1){let r=this.worldRenderer.viewDistance,s=Math.min(r,this.performanceOverrideDistance+1);s!==this.performanceOverrideDistance&&(this.performanceOverrideDistance=s>=r?void 0:s)}}updateSectionsVisibility(){let t=this.worldRenderer.cameraSectionPos;for(let[e,i]of Object.entries(this.sectionObjects)){if(i._waitingForChunkDisplay){i.visible=!1;continue}if(!this.performanceOverrideDistance){i.visible=!0;continue}let[r,s,o]=e.split(",").map(Number),a={x:r/16,y:s/16,z:o/16},v=a.x-t.x,l=a.z-t.z,c=Math.floor(Math.hypot(v,l));i.visible=c<=this.performanceOverrideDistance}}};u(se,"NEAR_REVEAL_TIMEOUT_MS",5e3),u(se,"EXPECTED_NEAR_GRACE_MS",1500);var C5=se,Rr=class{constructor(t){this.worldRendererThree=t;u(this,"chunkTextures",new Map)}dispose(){for(let[,t]of this.chunkTextures)for(let e of Object.keys(t))t[e].dispose();this.chunkTextures.clear()}renderHead(t,e,i,r){let s;if(r.SkullOwner?s=r.SkullOwner.Properties?.textures?.[0]?.Value:s=r.profile?.properties?.find(o=>o.name==="textures")?.value,!!s)try{let a=JSON.parse(F.from(s,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:v}=this.worldRendererThree.worldRendererConfig;v&&(a=a?.replace("http://textures.minecraft.net/",v).replace("https://textures.minecraft.net/",v));let l=Bt(this.worldRendererThree,a,It.head),c=new X.Group;return i&&l.position.set(0,.3125,.3125),l.position.y-=23/16,c.add(l),this.worldRendererThree.sceneOrigin.track(c),c.position.set(t.x+.5,t.y+.045,t.z+.5),c.rotation.set(0,-X.MathUtils.degToRad(e*(i?90:45/2)),0),c.scale.set(.8,.8,.8),c}catch{}}renderSign(t,e,i,r,s){let o=this.getSignTexture(t,s,r);if(!o)return;let a=new X.Mesh(new X.PlaneGeometry(1,1),new X.MeshBasicMaterial({map:o,transparent:!0}));a.renderOrder=999;let v=7/16,l=r?1.3:1;a.scale.set(1*l,v*l,1*l);let c=(r?2:1.5)/16,d=.25/16;i&&!r?a.position.set(0,0,-.5+c+d+1e-4):a.position.set(0,0,c/2+1e-4);let f=new X.Group;f.rotation.set(0,-X.MathUtils.degToRad(e*(i?90:45/2)),0),f.add(a);let m=(r?10:8)/16,g=(r?0:i?4.333:9.333)/16,b=m/2+g;return this.worldRendererThree.sceneOrigin.track(f),f.position.set(t.x+.5,t.y+b,t.z+.5),f}getSignTexture(t,e,i,r=!1){let s=ye(t),o=this.chunkTextures.get(`${s[0]},${s[1]}`);o||(o={},this.chunkTextures.set(`${s[0]},${s[1]}`,o));let a=`${t.x},${t.y},${t.z}`;if(o[a])return o[a];let v=G4(this.worldRendererThree.version),l=t1(e,i,v);if(!l)return;let c=new X.Texture(l);return c.magFilter=X.NearestFilter,c.minFilter=X.NearestFilter,c.needsUpdate=!0,o[a]=c,c}cleanChunkTextures(t,e){let i=`${Math.floor(t/16)},${Math.floor(e/16)}`,r=this.chunkTextures.get(i);if(r)for(let s of Object.keys(r))r[s].dispose(),delete r[s]}};x();R();T();k();x();R();T();k();import*as zt from"three";var V1={},Io=!1;function N4(){if(Io)return;let n=globalThis.loadedData?.tints;if(n){for(let t of Object.keys(n))V1[t]=W4(n[t]);Io=!0}}function W4(n){let t={},e=Ho(n.default??16777215);if(n.data)for(let i of n.data){let r=Ho(i.color);for(let s of i.keys)t[s]=r}return new Proxy(t,{get(i,r){return i[r]??e}})}function Ho(n){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255]}function Oo(n,t){return N4(),n==="grass_block"?[1,1,1]:n==="redstone_wire"?[1,1,1]:n==="birch_leaves"||n==="spruce_leaves"||n==="lily_pad"?V1.constant?.[n]??[1,1,1]:n.includes("leaves")||n==="vine"?V1.foliage?.[t]??[1,1,1]:["short_grass","tall_grass","fern","large_fern","sugar_cane","grass"].includes(n)?V1.grass?.[t]??[1,1,1]:[1,1,1]}var V4=512,kr=1/20,Tr=class{constructor(t){this.worldRenderer=t;u(this,"particles",[]);u(this,"sharedMaterial");u(this,"enabled",!1);u(this,"tickAccumulator",0);u(this,"nextParticleIndex",0);u(this,"render",t=>{if(!this.enabled)return;for(this.tickAccumulator+=t;this.tickAccumulator>=kr;)this.tickAccumulator-=kr,this.tickPhysics();let e=this.tickAccumulator/kr;this.updateVisuals(e)})}enable(){this.enabled||(this.enabled=!0,this.ensureMaterial())}disable(){this.enabled&&(this.enabled=!1)}dispose(){for(let t of this.particles)t.active&&this.worldRenderer.sceneOrigin.removeAndUntrack(t.mesh),t.mesh.geometry.dispose();this.particles=[],this.sharedMaterial?.dispose(),this.sharedMaterial=void 0,this.nextParticleIndex=0}spawnBlockBreakParticles(t,e,i,r,s,o="plains"){if(!this.enabled)return;let a=this.resolveBlockTexture(r);if(!a)return;let v=Oo(r,o);for(let l=0;l<4;l++)for(let c=0;c<4;c++)for(let d=0;d<4;d++){let f=t+(l+.5)/4,m=e+(c+.5)/4,g=i+(d+.5)/4,b=f-t-.5,A=m-e-.5,_=g-i-.5;b+=(Math.random()*2-1)*.4,A+=(Math.random()*2-1)*.4,_+=(Math.random()*2-1)*.4;let w=(Math.random()+Math.random()+1)*.15,M=Math.sqrt(b*b+A*A+_*_),S=b/M*w*.4,C=A/M*w*.4+.1,H=_/M*w*.4,B=Math.floor(4/(Math.random()*.9+.1));this.createParticle(f,m,g,S,C,H,B,a,s,t,i,1,v)}}tickPhysics(){for(let t of this.particles){if(!t.active)continue;if(t.prevX=t.x,t.prevY=t.y,t.prevZ=t.z,t.age++,t.age>=t.maxAge){this.deactivateParticle(t);continue}t.yd-=.04,t.x+=t.xd,t.y+=t.yd,t.z+=t.zd;let e=this.getFloorY(t);t.y<=e?(t.y=e,t.yd=0,t.onGround=!0):t.onGround=!1,t.xd*=.98,t.yd*=.98,t.zd*=.98,t.onGround&&(t.xd*=.7,t.zd*=.7)}}updateVisuals(t){let e=this.worldRenderer.camera.position;for(let i of this.particles){if(!i.active)continue;let r=i.prevX+(i.x-i.prevX)*t,s=i.prevY+(i.y-i.prevY)*t,o=i.prevZ+(i.z-i.prevZ)*t;i.mesh.position.set(r,s,o),i.mesh.lookAt(e.x,e.y,e.z)}}spawnCrackParticle(t,e,i,r,s,o,a="plains"){if(!this.enabled)return;let v=this.resolveBlockTexture(s);if(!v)return;let l=Oo(s,a),c=t+Math.random()*.8+.1,d=e+Math.random()*.8+.1,f=i+Math.random()*.8+.1;switch(r){case 0:d=e-.1;break;case 1:d=e+1+.1;break;case 2:f=i-.1;break;case 3:f=i+1+.1;break;case 4:c=t-.1;break;case 5:c=t+1+.1;break}let m=(Math.random()*2-1)*.4*.2,g=(Math.random()*2-1)*.4*.2+.1*.2,b=(Math.random()*2-1)*.4*.2,A=Math.floor(4/(Math.random()*.9+.1));this.createParticle(c,d,f,m,g,b,A,v,o,t,i,.6,l)}createParticle(t,e,i,r,s,o,a,v,l,c,d,f=1,m=[1,1,1]){this.ensureMaterial();let g=this.findInactiveParticle();g||(this.particles.length<V4?g=this.allocateParticle():g=this.recycleOldest());let b=Math.floor(Math.random()*4),A=Math.floor(Math.random()*4),_=v.u+b/4*v.su,w=v.v+A/4*v.sv,M=v.su/4,S=v.sv/4;this.setGeometryUVs(g.mesh.geometry,_,w,M,S),g.active=!0,g.x=t,g.y=e,g.z=i,g.prevX=t,g.prevY=e,g.prevZ=i,g.xd=r,g.yd=s,g.zd=o,g.age=0,g.maxAge=a,g.onGround=!1,g.floorMap=l,g.blockX=Math.floor(c),g.blockZ=Math.floor(d);let C=.1*(.5+Math.random()*.5)*2*f;g.mesh.scale.set(C,C,C),g.mesh.position.set(t,e,i),g.mesh.visible=!0;let H=.6*m[0],B=.6*m[1],I=.6*m[2],N=new Float32Array([H,B,I,H,B,I,H,B,I,H,B,I]),O=g.mesh.geometry.getAttribute("color");O?(O.set(N),O.needsUpdate=!0):g.mesh.geometry.setAttribute("color",new zt.Float32BufferAttribute(N,3)),this.worldRenderer.sceneOrigin.addAndTrack(g.mesh)}allocateParticle(){let t=new zt.PlaneGeometry(1,1),e=new zt.Mesh(t,this.sharedMaterial);e.visible=!1;let i={mesh:e,active:!1,x:0,y:0,z:0,prevX:0,prevY:0,prevZ:0,xd:0,yd:0,zd:0,age:0,maxAge:0,onGround:!1,floorMap:[],blockX:0,blockZ:0};return this.particles.push(i),i}findInactiveParticle(){for(let t=0;t<this.particles.length;t++){let e=(this.nextParticleIndex+t)%this.particles.length;if(!this.particles[e].active)return this.nextParticleIndex=(e+1)%this.particles.length,this.particles[e]}}recycleOldest(){let t=this.particles[0];for(let e of this.particles)e.age>t.age&&(t=e);return this.deactivateParticle(t),t}deactivateParticle(t){t.active&&(t.active=!1,t.mesh.visible=!1,this.worldRenderer.sceneOrigin.removeAndUntrack(t.mesh))}getFloorY(t){let e=Math.floor(t.x)-t.blockX,i=Math.floor(t.z)-t.blockZ;return e=Math.max(-2,Math.min(2,e)),i=Math.max(-2,Math.min(2,i)),t.floorMap[(i+2)*5+(e+2)]}resolveBlockTexture(t){let e=this.worldRenderer.resourcesManager.currentResources;if(!e)return null;let i=e.blocksAtlasJson,r=i.textures;if(r[t])return this.extractUV(r[t],i);for(let s of["_side","_top","_front","_0",""]){let o=t+s;if(r[o])return this.extractUV(r[o],i)}for(let s of Object.keys(r))if(s.startsWith(t))return this.extractUV(r[s],i);return null}extractUV(t,e){return{u:t.u,v:t.v,su:t.su??e.suSv,sv:t.sv??e.suSv}}setGeometryUVs(t,e,i,r,s){let o=t.getAttribute("uv");o.setXY(0,e,i),o.setXY(1,e+r,i),o.setXY(2,e,i+s),o.setXY(3,e+r,i+s),o.needsUpdate=!0}ensureMaterial(){if(this.sharedMaterial)return;let t=this.worldRenderer.material.map;t&&(this.sharedMaterial=new zt.MeshBasicMaterial({map:t,vertexColors:!0,transparent:!0,alphaTest:.1}))}},zo={id:"blockBreakParticles",controller:Tr,enabledDefault:!0,cannotBeDisabled:!0,requiresHeightmap:!1};x();R();T();k();var Mr=class{constructor(t){this.worldRenderer=t;u(this,"enabled",!1);u(this,"lastBobWalkDist",0);u(this,"lastBobTickTime",0);u(this,"render",()=>{if(!this.enabled)return;let t=this.worldRenderer.displayOptions.inWorldRenderingConfig,{perspective:e}=this.worldRenderer.playerStateReactive;if(t.viewBobbing&&e==="first_person"&&!this.worldRenderer.playerStateUtils.isSpectator()){this.worldRenderer.playerStateReactive.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=performance.now(),this.lastBobWalkDist=this.worldRenderer.playerStateReactive.walkDist);let r=Math.min((performance.now()-this.lastBobTickTime)/50,1);this.worldRenderer.cameraShake.setCameraBobInput({walkDist:this.worldRenderer.playerStateReactive.walkDist,prevWalkDist:this.worldRenderer.playerStateReactive.prevWalkDist,bob:this.worldRenderer.playerStateReactive.bob,prevBob:this.worldRenderer.playerStateReactive.prevBob,partialTick:r})}else this.worldRenderer.cameraShake.setCameraBobInput(null)})}enable(){this.enabled=!0}disable(){this.enabled=!1,this.worldRenderer.cameraShake.setCameraBobInput(null);let{perspective:t}=this.worldRenderer.playerStateReactive;t==="first_person"&&this.worldRenderer.camera.position.set(0,0,0)}dispose(){this.disable()}},Do={id:"cameraBobbing",controller:Mr,enabledDefault:!0,cannotBeDisabled:!0};x();R();T();k();import*as B0 from"three";var Sr=2e3,Fo=32,Lo=32,j1=12,Uo=24,Y1=1.2,j4=-5;var Cr=class{constructor(t){this.worldRenderer=t;u(this,"instancedMesh");u(this,"geometry");u(this,"material");u(this,"particles",[]);u(this,"enabled",!1);u(this,"dummy",new B0.Matrix4);u(this,"tempPosition",new B0.Vector3);u(this,"tempQuaternion",new B0.Quaternion);u(this,"tempScale",new B0.Vector3);u(this,"render",t=>{if(!this.enabled||!this.instancedMesh||!this.material)return;this.syncMaterialToSceneFog();let e=this.worldRenderer.getCameraPosition();this.instancedMesh.position.set(0,0,0);let i=this.worldRenderer.reactiveState.world.heightmaps,{dummy:r,tempPosition:s,tempQuaternion:o,tempScale:a}=this,v=NaN,l=NaN,c;for(let d=0;d<Sr;d++){let f=this.particles[d];this.instancedMesh.getMatrixAt(d,r),r.decompose(s,o,a),s.addScaledVector(f.velocity,t);let m=s.y,g=Math.sqrt(s.x*s.x+s.z*s.z),b=e.x+s.x,A=e.y+s.y,_=e.z+s.z,w=Math.floor(b/16),M=Math.floor(_/16);(w!==v||M!==l)&&(c=i.get(`${w},${M}`),v=w,l=M);let S=(Math.floor(b)%16+16)%16,C=(Math.floor(_)%16+16)%16,H=c?.[C*16+S];if(g>Fo||H!==void 0&&H!==-32768&&A<=H+1+f.despawnOffset||m<j4){this.respawnParticle(s);let I=j1+Math.random()*(Uo-j1);f.velocity.set((Math.random()-.5)*Y1,-I,(Math.random()-.5)*Y1),f.despawnOffset=Math.random()*.5}r.compose(s,o,a),this.instancedMesh.setMatrixAt(d,r)}this.instancedMesh.instanceMatrix.needsUpdate=!0})}enable(){this.enabled||(this.enabled=!0,this.instancedMesh?this.instancedMesh.visible=!0:this.createRain())}disable(){this.enabled&&(this.enabled=!1,this.instancedMesh&&(this.instancedMesh.visible=!1))}autoEnableCheck(){return this.worldRenderer.worldRendererConfig.isRaining===!0}dispose(){this.instancedMesh&&this.worldRenderer.scene.remove(this.instancedMesh),this.geometry?.dispose(),this.material?.dispose(),this.instancedMesh=void 0,this.geometry=void 0,this.material=void 0,this.particles=[]}syncMaterialToSceneFog(){if(!this.material)return;let t=this.worldRenderer.scene.fog;t instanceof B0.Fog||t instanceof B0.FogExp2?this.material.color.copy(t.color):this.material.color.set(13426158),this.material.fog=!0}createRain(){this.geometry=new B0.BoxGeometry(.03,.3,.03),this.material=new B0.MeshBasicMaterial({color:13426158,transparent:!0,opacity:.35,depthWrite:!1,fog:!0}),this.instancedMesh=new B0.InstancedMesh(this.geometry,this.material,Sr),this.instancedMesh.name="rain-particles",this.instancedMesh.frustumCulled=!1,this.syncMaterialToSceneFog();let t=new B0.Matrix4,e=new B0.Vector3;for(let i=0;i<Sr;i++){this.respawnParticle(e),e.y=Math.random()*Lo,t.setPosition(e),this.instancedMesh.setMatrixAt(i,t);let r=j1+Math.random()*(Uo-j1);this.particles.push({velocity:new B0.Vector3((Math.random()-.5)*Y1,-r,(Math.random()-.5)*Y1),age:0,despawnOffset:Math.random()*.5})}this.instancedMesh.instanceMatrix.needsUpdate=!0,this.worldRenderer.scene.add(this.instancedMesh)}respawnParticle(t){let e=Math.random()*Math.PI*2,i=Math.random()*Fo;t.set(Math.cos(e)*i,Lo,Math.sin(e)*i)}},Go={id:"rain",controller:Cr,enabledDefault:!1,requiresHeightmap:!0};x();R();T();k();import*as P0 from"three";var No=new P0.Color(13/255,234/255,238/255),Y4=9;var Q4=350,K4=650;var J4=120,q4=280,Pr=class{constructor(t){this.worldRenderer=t;u(this,"pendingGeometries",new Map);u(this,"revealingSections",new Map);u(this,"finishedChunkCount",0);u(this,"revealTriggered",!1);u(this,"revealStartTime",0);u(this,"enabled",!1);u(this,"onWorldSwitchedCb",null);u(this,"patched",!1);u(this,"initialWaveDone",!1);u(this,"wireframeMaterial");u(this,"wireframeGlowMaterial");u(this,"pulseTime",0);u(this,"revealedChunks",new Set);u(this,"originalFinishChunk",null);u(this,"originalDestroy",null);u(this,"originalSceneAdd",null);u(this,"originalHandleWorkerMessage",null);u(this,"configEnabled",!0);u(this,"render",t=>{this.enabled&&this.update(t*1e3)});this.configEnabled=this.worldRenderer.worldRendererConfig.futuristicReveal===!0,this.wireframeMaterial=new P0.LineBasicMaterial({color:No,transparent:!0,opacity:1,blending:P0.AdditiveBlending,depthWrite:!1}),this.wireframeGlowMaterial=new P0.LineBasicMaterial({color:No,transparent:!0,opacity:.55,blending:P0.AdditiveBlending,depthWrite:!1})}enable(){this.configEnabled&&(this.enabled||(this.enabled=!0,this.patchWorldRenderer()))}disable(){this.enabled&&(this.enabled=!1,this.unpatchWorldRenderer(),this.reset())}toggle(){return this.enabled?this.disable():this.enable(),this.enabled}dispose(){this.disable(),this.wireframeMaterial.dispose(),this.wireframeGlowMaterial.dispose()}patchWorldRenderer(){if(this.patched)return;this.patched=!0;let t=this.worldRenderer;this.onWorldSwitchedCb=()=>this.reset(),t.onWorldSwitched.push(this.onWorldSwitchedCb),this.originalFinishChunk=t.finishChunk.bind(t),t.finishChunk=e=>{this.originalFinishChunk(e),this.onChunkFinished(e)},this.originalDestroy=t.destroy.bind(t),t.destroy=()=>{this.dispose(),this.originalDestroy()},this.originalHandleWorkerMessage=t.handleWorkerMessage.bind(t),t.handleWorkerMessage=e=>{this.originalHandleWorkerMessage(e),this.enabled&&e?.type==="geometry"&&Promise.resolve().then(()=>{try{this.registerSection(e.key,e.geometry)}catch{}})},this.originalSceneAdd=t.scene.add.bind(t.scene),t.scene.add=(...e)=>{let i=this.originalSceneAdd(...e);for(let r of e)this.checkAndPatchMesh(r);return i}}unpatchWorldRenderer(){let t=this.worldRenderer;if(this.originalFinishChunk&&(t.finishChunk=this.originalFinishChunk,this.originalFinishChunk=null),this.originalDestroy&&(t.destroy=this.originalDestroy,this.originalDestroy=null),this.originalHandleWorkerMessage&&(t.handleWorkerMessage=this.originalHandleWorkerMessage,this.originalHandleWorkerMessage=null),this.originalSceneAdd&&(t.scene.add=this.originalSceneAdd,this.originalSceneAdd=null),this.onWorldSwitchedCb){let e=t.onWorldSwitched.indexOf(this.onWorldSwitchedCb);e!==-1&&t.onWorldSwitched.splice(e,1),this.onWorldSwitchedCb=null}this.patched=!1}checkAndPatchMesh(t){if(t instanceof P0.Mesh&&t.name==="mesh"){let e=this.findSectionKeyForMesh(t);e&&this.shouldUseRevealEffect(e)&&(t.visible=!1,t.hiddenByReveal=!0)}for(let e of t.children)this.checkAndPatchMesh(e)}findSectionKeyForMesh(t){let e=t;for(;e;){let{sectionKey:m}=e;if(m&&this.worldRenderer.chunkMeshManager.sectionObjects[m]===e)return m;e=e.parent}let i=this.worldRenderer.sceneOrigin.getWorldPosition(t),r=i?.x??this.worldRenderer.sceneOrigin.toWorldX(t.position.x),s=i?.y??this.worldRenderer.sceneOrigin.toWorldY(t.position.y),o=i?.z??this.worldRenderer.sceneOrigin.toWorldZ(t.position.z),a=16,v=this.worldRenderer.getSectionHeight(),l=Math.floor(r/a)*a,c=Math.floor(s/v)*v,d=Math.floor(o/a)*a,f=`${l},${c},${d}`;return this.worldRenderer.chunkMeshManager.sectionObjects[f]?f:null}get scene(){return this.worldRenderer.realScene}getCameraPosition(){return this.worldRenderer.getCameraPosition()}getOriginalMesh(t){let e=this.worldRenderer.chunkMeshManager.sectionObjects[t];return e?e.children.find(i=>i.name==="mesh"):null}onChunkFinished(t){this.finishedChunkCount++,!this.revealTriggered&&this.finishedChunkCount>=Y4&&this.triggerReveal()}registerSection(t,e){this.revealedChunks.has(t)||this.revealingSections.has(t)||(this.revealTriggered?this.startSectionReveal(t,e):this.pendingGeometries.set(t,e))}shouldUseRevealEffect(t){return this.enabled&&!this.revealedChunks.has(t)&&!this.revealingSections.has(t)}triggerReveal(){this.revealTriggered=!0,this.initialWaveDone=!0,this.revealStartTime=performance.now();let t=this.getCameraPosition(),e=[...this.pendingGeometries.entries()];this.pendingGeometries.clear();let i=e.map(([s,o])=>{let a=Math.hypot(o.sx-t.x,o.sy-t.y,o.sz-t.z);return{key:s,geometry:o,distance:a}}).sort((s,o)=>s.distance-o.distance),r=i.at(-1)?.distance||1;for(let{key:s,geometry:o,distance:a}of i){let v=a/r*1500;setTimeout(()=>{!this.revealedChunks.has(s)&&!this.revealingSections.has(s)&&this.startSectionReveal(s,o)},v)}}startSectionReveal(t,e){if(!e.positions?.length||this.revealingSections.has(t)||this.revealedChunks.has(t))return;let i=this.createWireframeGeometry(e),r=this.getOriginalMesh(t);r&&(r.visible=!1,r.hiddenByReveal=!0);let s=new P0.LineSegments(i,this.wireframeMaterial.clone());this.worldRenderer.sceneOrigin.track(s),s.position.set(e.sx,e.sy,e.sz),s.name="scifi-wireframe",s.renderOrder=1e3;let o=new P0.LineSegments(i.clone(),this.wireframeGlowMaterial.clone());this.worldRenderer.sceneOrigin.track(o),o.position.set(e.sx,e.sy,e.sz),o.scale.set(1.02,1.02,1.02),o.name="scifi-glow",o.renderOrder=999;let a=new P0.Group;a.add(s),a.add(o),a.name="scifi-reveal-group",a.sectionKey=t,this.scene.add(a);let v=this.initialWaveDone?J4:Q4,l=this.initialWaveDone?q4:K4,c={key:t,wireframeGroup:a,revealStartTime:performance.now(),phase:"wireframe",originalMeshRef:null,wireframeMs:v,revealMs:l};setTimeout(()=>{let d=this.getOriginalMesh(t);d&&!d.hiddenByReveal&&(d.visible=!1,d.hiddenByReveal=!0)},0),this.revealingSections.set(t,c)}createWireframeGeometry(t){if(t.wireframePositions&&t.wireframePositions.length>0){let a=new P0.BufferGeometry;return a.setAttribute("position",new P0.Float32BufferAttribute(t.wireframePositions,3)),a}let e=t.positions,i=t.indices,r=[],s=new Set;for(let a=0;a<i.length;a+=3){let v=i[a],l=i[a+1],c=i[a+2];this.addEdge(e,v,l,r,s),this.addEdge(e,l,c,r,s),this.addEdge(e,c,v,r,s)}let o=new P0.BufferGeometry;return o.setAttribute("position",new P0.Float32BufferAttribute(r,3)),o}addEdge(t,e,i,r,s){let o=Math.min(e,i),a=Math.max(e,i),v=`${o}-${a}`;s.has(v)||(s.add(v),r.push(t[e*3],t[e*3+1],t[e*3+2],t[i*3],t[i*3+1],t[i*3+2]))}update(t){if(!this.enabled||this.revealingSections.size===0)return;this.pulseTime+=t*.001;let e=performance.now(),i=.6+.4*Math.sin(this.pulseTime*4),r=[];for(let[s,o]of this.revealingSections){let a=e-o.revealStartTime;if(o.phase==="wireframe"){let v=o.wireframeGroup.children[0],l=o.wireframeGroup.children[1];if(v?.material){let c=v.material;c.opacity=i;let d=.85+.15*Math.sin(this.pulseTime*6+a*.002);c.color.setRGB(13/255*d,234/255*d,238/255*d)}if(l?.material){let c=l.material;c.opacity=i*.4}if(a>o.wireframeMs&&(o.phase="transitioning",o.originalMeshRef=this.getOriginalMesh(s),o.originalMeshRef)){o.originalMeshRef.visible=!0;let c=o.originalMeshRef.material,d=c.clone();d.transparent=!0,d.opacity=0,d.needsUpdate=!0,o.originalMeshRef.originalMaterial=c,o.originalMeshRef.material=d}}else if(o.phase==="transitioning"){let v=a-o.wireframeMs,l=Math.min(1,v/o.revealMs),c=1-(1-l)**3,d=o.wireframeGroup.children[0],f=o.wireframeGroup.children[1];if(d?.material){let m=d.material;m.opacity=1-c}if(f?.material){let m=f.material;m.opacity=(1-c)*.55}if(o.originalMeshRef?.material){let m=o.originalMeshRef.material;m.opacity=c}l>=1&&(o.phase="complete",r.push(o))}}for(let s of r)this.completeReveal(s)}completeReveal(t){if(this.revealingSections.delete(t.key),this.revealedChunks.add(t.key),t.originalMeshRef){let e=t.originalMeshRef.originalMaterial;if(e){let i=t.originalMeshRef.material;t.originalMeshRef.material=e,i.dispose(),delete t.originalMeshRef.originalMaterial}t.originalMeshRef.visible=!0,delete t.originalMeshRef.hiddenByReveal}this.disposeWireframeGroup(t.wireframeGroup)}disposeWireframeGroup(t){this.worldRenderer.sceneOrigin.removeAndUntrackAll(t);let e=[];t.traverse(i=>{e.push(i)});for(let i of e){let r=i;if(r.geometry&&r.geometry.dispose(),r.material){let s=r.material;if(Array.isArray(s))for(let o of s)o.dispose();else s&&typeof s.dispose=="function"&&s.dispose()}}t.clear()}reset(){for(let t of this.revealingSections.values())this.disposeWireframeGroup(t.wireframeGroup);this.pendingGeometries.clear(),this.revealingSections.clear(),this.revealedChunks.clear(),this.finishedChunkCount=0,this.revealTriggered=!1,this.revealStartTime=0,this.pulseTime=0}forceCompleteAll(){let t=[...this.revealingSections.values()];for(let e of t){if(e.originalMeshRef||(e.originalMeshRef=this.getOriginalMesh(e.key)),e.originalMeshRef){let i=e.originalMeshRef.originalMaterial;i&&(e.originalMeshRef.material=i),e.originalMeshRef.visible=!0}this.completeReveal(e)}}debugGetWireframeGroups(){let t=[];return this.scene.traverse(e=>{e.name==="scifi-reveal-group"&&t.push(e)}),t}debugForceCleanup(){let t=this.debugGetWireframeGroups();for(let e of t)this.disposeWireframeGroup(e);for(let e of this.revealingSections.values())this.disposeWireframeGroup(e.wireframeGroup);this.revealingSections.clear()}debugStatus(){let t=this.debugGetWireframeGroups(),e=new Set(this.revealingSections.keys()),i=t.filter(r=>!e.has(r.sectionKey));return{revealTriggered:this.revealTriggered,finishedChunkCount:this.finishedChunkCount,pendingGeometries:this.pendingGeometries.size,revealingSections:this.revealingSections.size,revealedChunks:this.revealedChunks.size,wireframeGroupsInScene:t.length,orphanedWireframeGroups:i.length,orphanedKeys:i.map(r=>r.sectionKey),sections:[...this.revealingSections.entries()].map(([r,s])=>({key:r,phase:s.phase,hasOriginalMesh:!!s.originalMeshRef,wireframeInScene:s.wireframeGroup.parent!==null}))}}debugLog(){}},Wo={id:"futuristicReveal",controller:Pr,enabledDefault:!0};x();R();T();k();import*as T0 from"three";var Z4=parseInt(T0.REVISION.replaceAll(/\D+/g,""),10),Br=class extends T0.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
|
|
21216
|
+
`,Q0={textureSize:128,gravity:new i0.Vector3(0,-.005,0),friction:.998,defaultParticleSize:300,maxActiveFireworks:5},B5=n=>{let e=n*3;return{x:e,y:e+1,z:e+2}},P5=n=>{let e=n*4;return{r:e,g:e+1,b:e+2,a:e+3}},ve=(n=0,t=0)=>Math.floor(Math.random()*(n+1-t))+t,U4=(n,t,e,i)=>{n.save();let r=n.createRadialGradient(t,t,0,t,t,t);r.addColorStop(0,"rgba(255,255,255,1.0)"),r.addColorStop(.5,"rgba(255,255,255,0.5)"),r.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=r,n.fillRect(0,0,e,i),n.restore()},G4=()=>{let n=Q0.textureSize,t=W0(n,n),e=t.getContext("2d"),i=n/2;U4(e,i,t.width,t.height);let r=new i0.Texture(t);return r.needsUpdate=!0,r},N4=(n,t,e,i,r=Q0.defaultParticleSize)=>{let s=new i0.BufferGeometry,o=[],a=[],v=[],l=[],c=[],d=Math.random()>.3?"single":"multiple",f=ve(100,20)*.01,m=()=>ve(100,1)*.01,g="red",b=Math.random();b>.66?g="red":b>.33?g="green":g="blue";for(let _=0;_<n;_++){let w=new i0.Vector3(0,0,0);if(o.push(w.x,w.y,w.z),a.push(t[_].x,t[_].y,t[_].z),e==="seed"){let T=t[_].y**2*.04;_===0&&(T*=1.1),l.push(T),c.push(T*.017),v.push(1,1,1,1)}else if(e==="trail"){let T=Math.random()*.1+.1;l.push(T),c.push(T*.017),v.push(1,1,1,1)}else{let T=ve(r,10)*.001;if(l.push(T),c.push(T*.017),d==="multiple")v.push(m(),m(),m(),1);else switch(g){case"red":v.push(f,.1,.1,1);break;case"green":v.push(.1,f,.1,1);break;case"blue":v.push(.1,.1,f,1);break}}}s.setAttribute("position",new i0.Float32BufferAttribute(o,3)),s.setAttribute("velocity",new i0.Float32BufferAttribute(a,3)),s.setAttribute("color",new i0.Float32BufferAttribute(v,4)),s.setAttribute("adjustSize",new i0.Float32BufferAttribute(l,1)),s.setAttribute("mass",new i0.Float32BufferAttribute(c,1));let A=new i0.RawShaderMaterial({uniforms:{size:{value:Q0.textureSize},texture:{value:i}},transparent:!0,depthWrite:!1,blending:i0.AdditiveBlending,vertexShader:F4,fragmentShader:L4});return new i0.Points(s,A)},I5=class{constructor(t,e,i,r,s){u(this,"particleNum");u(this,"timerStartFading");u(this,"mesh");this.particleNum=t,this.timerStartFading=10,this.mesh=N4(t,e,i,r,s)}update(t){this.timerStartFading>0&&(this.timerStartFading-=.3);let e=this.mesh.geometry.attributes.position,i=this.mesh.geometry.attributes.velocity,r=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.5?.98:.96,a=v=>Math.random()>.5?0:(1-v)*.1;for(let v=0;v<this.particleNum;v++){let{x:l,y:c,z:d}=B5(v);i.array[c]+=t.y-s.array[v],i.array[l]*=Q0.friction,i.array[d]*=Q0.friction,i.array[c]*=Q0.friction,e.array[l]+=i.array[l],e.array[c]+=i.array[c],e.array[d]+=i.array[d];let{a:f}=P5(v);this.timerStartFading<=0&&(r.array[f]*=o()-a(r.array[f]),r.array[f]<.001&&(r.array[f]=0))}e.needsUpdate=!0,i.needsUpdate=!0,r.needsUpdate=!0}disposeAll(){this.mesh.geometry.dispose(),this.mesh.material.dispose()}},xr=class extends I5{constructor(t,e,i){super(t,e,"seed",i)}update(t){let e=this.mesh.geometry.attributes.position,i=this.mesh.geometry.attributes.velocity,r=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.99:.96,a=d=>Math.random()>.3?0:(1-d)*.1,v=()=>Math.random()>.5?.05:-.05,l=()=>Math.random()>.1,c=Q0.friction*.98;for(let d=0;d<this.particleNum;d++){let{x:f,y:m,z:g}=B5(d);i.array[m]+=t.y-s.array[d],i.array[f]*=c,i.array[g]*=c,i.array[m]*=c,e.array[f]+=i.array[f],e.array[m]+=i.array[m],e.array[g]+=i.array[g],l()&&(e.array[f]+=v()),l()&&(e.array[g]+=v());let{a:b}=P5(d);r.array[b]*=o()-a(r.array[b]),r.array[b]<.001&&(r.array[b]=0)}e.needsUpdate=!0,i.needsUpdate=!0,r.needsUpdate=!0}},Rr=class extends I5{constructor(t,e,i){super(t,e,"trail",i)}update(t){let e=this.mesh.geometry.attributes.position,i=this.mesh.geometry.attributes.velocity,r=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.98:.95,a=()=>Math.random()>.5?.05:-.05,v=()=>Math.random()>.2;for(let l=0;l<this.particleNum;l++){let{x:c,y:d,z:f}=B5(l);i.array[d]+=t.y-s.array[l],i.array[c]*=Q0.friction,i.array[f]*=Q0.friction,i.array[d]*=Q0.friction,e.array[c]+=i.array[c],e.array[d]+=i.array[d],e.array[f]+=i.array[f],v()&&(e.array[c]+=a()),v()&&(e.array[f]+=a());let{a:m}=P5(l);r.array[m]*=o(),r.array[m]<.001&&(r.array[m]=0)}e.needsUpdate=!0,i.needsUpdate=!0,r.needsUpdate=!0}},H5=class{constructor(t,e=Q0.defaultParticleSize,i){u(this,"meshGroup");u(this,"isExplode");u(this,"petalsNum");u(this,"life");u(this,"seed");u(this,"flowerSizeRate");u(this,"flower");u(this,"texture");u(this,"particleSize");this.meshGroup=new i0.Group,this.isExplode=!1,this.texture=t,this.particleSize=e;let r=400,s=150;this.petalsNum=ve(r,s),this.life=150,this.seed=this.getSeed(i),this.meshGroup.add(this.seed.mesh),this.flowerSizeRate=i0.MathUtils.mapLinear(this.petalsNum,s,r,.4,.7)}getSeed(t){let i=[];for(let s=0;s<40;s++){let a=s===0?Math.random()*2.5+.9:Math.random()*2+.4,v=0;i.push(new i0.Vector3(0,a,v))}let r=new xr(40,i,this.texture);if(t)r.mesh.position.set(0,0,0);else{let s=Math.random()*80-40,o=-50,a=Math.random()*80-40;r.mesh.position.set(s,o,a)}return r}explode(t){this.isExplode=!0,this.flower=this.getFlower(t),this.meshGroup.add(this.flower.mesh),this.meshGroup.remove(this.seed.mesh),this.seed.disposeAll()}getFlower(t){let e=this.petalsNum,i=[],r;if(Math.random()>.5)for(let a=0;a<e;a++){r=ve(120,60)*.01;let v=i0.MathUtils.degToRad(Math.random()*180),l=i0.MathUtils.degToRad(Math.random()*360),c=Math.sin(v)*Math.cos(l)*r,d=Math.sin(v)*Math.sin(l)*r,f=Math.cos(v)*r,m=new i0.Vector3(c,d,f);m.multiplyScalar(this.flowerSizeRate),i.push(m)}else{let a=180/e,v=360*(Math.random()*20+1)/e,l=v,c=v;r=ve(120,60)*.01;for(let d=0;d<e;d++){let f=Math.sin(i0.MathUtils.degToRad(a*d)),m=Math.cos(i0.MathUtils.degToRad(a*d))*r,g=Math.cos(i0.MathUtils.degToRad(l*d))*f*r,b=Math.sin(i0.MathUtils.degToRad(c*d))*f*r,A=new i0.Vector3(g,b,m);A.multiplyScalar(this.flowerSizeRate),i.push(A)}}let o=new I5(e,i,"default",this.texture,this.particleSize);return o.mesh.position.set(t.x,t.y,t.z),o}update(t){this.isExplode?(this.flower.update(t),this.life>0&&(this.life-=1)):this.drawTail()}drawTail(){this.seed.update(Q0.gravity);let t=this.seed.mesh.geometry.attributes.position,e=this.seed.mesh.geometry.attributes.velocity,i=0;for(let d=0,f=e.array.length;d<f;d++){let m=e.array[d];d%3===1&&m>0&&i++}if(!(i===0))return;let{x:s,y:o,z:a}=this.seed.mesh.position,v=new i0.Vector3(s,o,a),l=0,c;for(let d=0,f=t.array.length;d<f;d++){let m=t.array[d];d%3===1&&m>l&&(l=m,c=new i0.Vector3(t.array[d-1],m,t.array[d+2]))}c&&(v.add(c),this.explode(v))}},Fe=class extends H5{constructor(e,i=Q0.defaultParticleSize,r){super(e,i,r);u(this,"tailMeshGroup");u(this,"tails");let s=150,o=100;this.petalsNum=ve(s,o),this.flowerSizeRate=i0.MathUtils.mapLinear(this.petalsNum,o,s,.4,.7),this.tailMeshGroup=new i0.Group,this.tails=[]}explode(e){this.isExplode=!0,this.flower=this.getFlower(e),this.tails=this.getTail(),this.meshGroup.add(this.flower.mesh),this.meshGroup.add(this.tailMeshGroup)}getTail(){let e=[],r=this.flower.mesh.geometry.attributes.color;for(let s=0;s<this.petalsNum;s++){let o=[];for(let C=0;C<20;C++)o.push(new i0.Vector3(0,0,0));let a=new Rr(20,o,this.texture),{r:v,g:l,b:c,a:d}=P5(s),f=r.array[v],m=r.array[l],g=r.array[c],b=r.array[d],A=a.mesh.geometry.attributes.position,_=a.mesh.geometry.attributes.color;for(let C=0;C<A.count;C++){let H=P5(C);_.array[H.r]=f,_.array[H.g]=m,_.array[H.b]=g,_.array[H.a]=b}let{x:w,y:T,z:S}=this.flower.mesh.position;a.mesh.position.set(w,T,S),e.push(a),this.tailMeshGroup.add(a.mesh)}return e}update(e){if(this.isExplode){this.flower.update(e);let i=this.flower.mesh.geometry.attributes.position;for(let r=0,s=this.tails.length;r<s;r++){let o=this.tails[r];o.update(e);let{x:a,y:v,z:l}=B5(r),c=new i0.Vector3(i.array[a],i.array[v],i.array[l]),d=o.mesh.geometry.attributes.position,f=o.mesh.geometry.attributes.velocity;for(let m=0;m<d.count;m++){let g=B5(m),b=new i0.Vector3,A=new i0.Vector3(d.array[g.x],d.array[g.y],d.array[g.z]),_=new i0.Vector3(f.array[g.x],f.array[g.y],f.array[g.z]);b.subVectors(c,A);let w=b.sub(_);w.normalize(),w.multiplyScalar(Math.random()*3e-4*this.life),f.array[g.x]+=w.x,f.array[g.y]+=w.y,f.array[g.z]+=w.z}f.needsUpdate=!0}this.life>0&&(this.life-=1.2)}else this.drawTail()}},Q1=class{constructor(t,e,i){u(this,"fireworksInstances");u(this,"scene");u(this,"sceneOrigin");u(this,"texture");u(this,"particleSize");u(this,"maxFireworks");this.fireworksInstances=[],this.scene=t,this.sceneOrigin=e,this.texture=G4(),this.particleSize=i?.defaultParticleSize??Q0.defaultParticleSize,this.maxFireworks=i?.maxActiveFireworks??Q0.maxActiveFireworks}launchFirework(t){if(this.fireworksInstances.length>=this.maxFireworks)return;let e=t?.particleSize??this.particleSize,i=t?.position,r;t?.forceRich?r=new Fe(this.texture,e,i):t?.forceBasic?r=new H5(this.texture,e,i):r=Math.random()>.5?new H5(this.texture,e,i):new Fe(this.texture,e,i),this.fireworksInstances.push(r),i?(this.sceneOrigin.addAndTrack(r.meshGroup),r.meshGroup.position.set(i.x,i.y,i.z)):this.scene.add(r.meshGroup)}repositionAll(){}update(){let t=[];for(let e=this.fireworksInstances.length-1;e>=0;e--){let i=this.fireworksInstances[e];i.update(Q0.gravity),i.isExplode&&t.push(e)}for(let e=0,i=t.length;e<i;e++){let r=t[e],s=this.fireworksInstances[r];if(s&&(s.meshGroup.remove(s.seed.mesh),s.seed.disposeAll(),s.life<=0)){if(this.sceneOrigin.removeAndUntrack(s.meshGroup),s instanceof Fe&&s.tailMeshGroup)for(let o of s.tails)o.disposeAll();s.flower?.disposeAll(),this.fireworksInstances.splice(r,1)}}}clear(){for(let t of this.fireworksInstances)if(this.sceneOrigin.removeAndUntrack(t.meshGroup),t.seed.disposeAll(),t.flower&&t.flower.disposeAll(),t instanceof Fe)for(let e of t.tails)e.disposeAll();this.fireworksInstances=[]}dispose(){this.clear(),this.texture.dispose()}};x();R();M();k();var To=Symbol("tracked-proxy"),W4=new Set(["add","addScalar","addScaledVector","addVectors","sub","subScalar","subVectors","multiply","multiplyScalar","multiplyVectors","divide","divideScalar","applyEuler","applyAxisAngle","applyMatrix3","applyMatrix4","applyNormalMatrix","applyQuaternion","negate","floor","ceil","round","roundToZero","min","max","clamp","clampLength","clampScalar","project","unproject","reflect","lerp","lerpVectors","cross","crossVectors","setFromMatrixPosition","setFromMatrixColumn","setFromMatrix3Column","setFromEuler","setFromSpherical","setFromSphericalCoords","setFromCylindrical","fromArray","fromBufferAttribute","setComponent","randomDirection","random"]),K1=class{constructor(t){u(this,"scene");u(this,"_x",0);u(this,"_y",0);u(this,"_z",0);u(this,"_tracked",new Set);u(this,"_worldCoords",new WeakMap);u(this,"_originalPositions",new WeakMap);u(this,"_trackOptions",new WeakMap);this.scene=t}get x(){return this._x}get y(){return this._y}get z(){return this._z}update(t,e,i){this._x=t,this._y=e,this._z=i;for(let r of this._tracked){let s=this._worldCoords.get(r);this._originalPositions.get(r).set(s.x-t,s.y-e,s.z-i),this._trackOptions.get(r)?.updateMatrix&&r.updateMatrix()}}track(t,e){let i=this._originalPositions.get(t)??t.position,r={x:0,y:0,z:0};this._originalPositions.set(t,i),this._worldCoords.set(t,r),e?this._trackOptions.set(t,e):this._trackOptions.delete(t);let s=this,o=e,a=new Proxy(i,{get(v,l,c){if(l===To)return r;if(l==="set")return(f,m,g)=>(r.x=f,r.y=m,r.z=g,v.set(f-s._x,m-s._y,g-s._z),o?.updateMatrix&&t.updateMatrix(),c);if(l==="copy")return f=>{let m=f[To],g=m?m.x:f.x,b=m?m.y:f.y,A=m?m.z:f.z;return r.x=g,r.y=b,r.z=A,v.set(g-s._x,b-s._y,A-s._z),o?.updateMatrix&&t.updateMatrix(),c};if(l==="setX")return f=>(r.x=f,v.x=f-s._x,o?.updateMatrix&&t.updateMatrix(),c);if(l==="setY")return f=>(r.y=f,v.y=f-s._y,o?.updateMatrix&&t.updateMatrix(),c);if(l==="setZ")return f=>(r.z=f,v.z=f-s._z,o?.updateMatrix&&t.updateMatrix(),c);if(typeof l=="string"&&W4.has(l))return()=>{throw new Error(`Cannot call position.${l}() on a tracked object. Use position.set(x, y, z) instead.`)};let d=v[l];return typeof d=="function"?d.bind(v):d},set(v,l,c){return l==="x"?(r.x=c,v.x=c-s._x,o?.updateMatrix&&t.updateMatrix(),!0):l==="y"?(r.y=c,v.y=c-s._y,o?.updateMatrix&&t.updateMatrix(),!0):l==="z"?(r.z=c,v.z=c-s._z,o?.updateMatrix&&t.updateMatrix(),!0):(v[l]=c,!0)}});Object.defineProperty(t,"position",{value:a,configurable:!0,enumerable:!0}),this._tracked.add(t)}untrack(t){let e=this._originalPositions.get(t);e&&(Object.defineProperty(t,"position",{value:e,configurable:!0,enumerable:!0}),this._tracked.delete(t),this._worldCoords.delete(t),this._originalPositions.delete(t),this._trackOptions.delete(t))}addAndTrack(t,e){this.track(t,e),this.scene.add(t)}removeAndUntrack(t){this.untrack(t),t.removeFromParent()}removeAndUntrackAll(t){t.traverse(e=>{this.untrack(e)}),t.removeFromParent()}getWorldPosition(t){let e=this._worldCoords.get(t);return e?{x:e.x,y:e.y,z:e.z}:void 0}clear(){for(let t of this._tracked)this.untrack(t)}get trackedCount(){return this._tracked.size}toSceneX(t){return t-this._x}toSceneY(t){return t-this._y}toSceneZ(t){return t-this._z}toWorldX(t){return t+this._x}toWorldY(t){return t+this._y}toWorldZ(t){return t+this._z}};Mr();x();R();M();k();import X4 from"prismarine-chat";import*as X from"three";import*as q1 from"prismarine-nbt";import{Vec3 as Tr}from"vec3";x();R();M();k();import*as Z0 from"three";var Ho=20,Oo=40,Q4={white_banner:15,orange_banner:14,magenta_banner:13,light_blue_banner:12,yellow_banner:11,lime_banner:10,pink_banner:9,gray_banner:8,light_gray_banner:7,cyan_banner:6,purple_banner:5,blue_banner:4,brown_banner:3,green_banner:2,red_banner:1,black_banner:0},zo={0:"#1d1d21",1:"#b02e26",2:"#5e7c16",3:"#835432",4:"#3c44aa",5:"#8932b8",6:"#169c9c",7:"#9d9d97",8:"#474f52",9:"#f38baa",10:"#80c71f",11:"#fed83d",12:"#3ab3da",13:"#c74ebd",14:"#f9801d",15:"#f9fffe"};function K4(n){let t=n.replace("_wall_banner","_banner");return Q4[t]??15}var J4=(n,t,e,i,r,s,o)=>{switch(n.fillStyle=e,t){case"bs":n.fillRect(i,r,s,o);break;case"ls":n.fillRect(i,r,s/3,o);break;case"rs":n.fillRect(i+s*2/3,r,s/3,o);break;case"ts":n.fillRect(i,r,s,o/3);break;case"ms":n.fillRect(i,r+o/3,s,o/3);break;case"drs":n.fillRect(i,r,s/2,o/2);break;case"dls":n.fillRect(i+s/2,r,s/2,o/2);break;case"ss":for(let a=0;a<s;a+=2)n.fillRect(i+a,r,1,o);break;case"cr":n.fillRect(i,r+o/3,s,o/3),n.fillRect(i+s/3,r,s/3,o);break;case"sc":n.fillRect(i,r+o/2-1,s,2),n.fillRect(i+s/2-1,r,2,o);break;default:n.fillRect(i,r,s,o)}};function q4(n,t){if(!t||t.length===0)return`banner_${n}_empty`;let e=t.map(i=>`${i.Pattern??"bs"}_${i.Color??0}`).join(",");return`banner_${n}_${e}`}var Z4=(n,t,e=(i,r)=>W0(i,r))=>{let r=e(Ho*1,Oo*1),s=r.getContext("2d");if(s){if(s.imageSmoothingEnabled=!1,t?.Patterns&&t.Patterns.length>0)for(let o of t.Patterns){let a=o.Color??0,v=o.Pattern??"bs",l=zo[a]||zo[0];J4(s,v,l,0,0,Ho*1,Oo*1)}return r}},J1=new Map;function Do(n,t,e){let i=K4(t),r=q4(i,e?.Patterns),s=J1.get(r);if(s)return s.refCount++,s.texture;let o=Z4(i,e);if(!o)return;let a=new Z0.Texture(o);return a.magFilter=Z0.NearestFilter,a.minFilter=Z0.NearestFilter,a.needsUpdate=!0,J1.set(r,{texture:a,refCount:1}),a}function Fo(n){for(let[t,e]of J1.entries())if(e.texture===n){e.refCount--,e.refCount<=0&&(e.texture.dispose(),J1.delete(t));return}}function Lo(n,t,e,i){let a,v,l;e?(a=(-14.6+13.4)/2/16-.5,v=1-14.75/16-.5,l=1/2):(a=(1.4+29.4)/2/16,v=1-7.25/16-.5,l=0);let c=new Z0.Mesh(new Z0.PlaneGeometry(.85,1.75),new Z0.MeshBasicMaterial({map:i,transparent:!0}));c.renderOrder=999;let d=.5/16,f=.25/16;e?c.position.set(0,a,v+f+.004):c.position.set(0,a,v+d/2+.004);let m=new Z0.Group;return m.rotation.set(0,-Z0.MathUtils.degToRad(t*(e?90:45/2)),0),m.add(c),m.bannerTexture=i,m.position.set(n.x+.5,n.y+l,n.z+.5),m}var le=class le{constructor(t,e,i,r,s=3){this.worldRenderer=t;this.scene=e;this.material=i;this.worldHeight=r;u(this,"meshPool",[]);u(this,"activeSections",new Map);u(this,"sectionObjects",{});u(this,"waitingChunksToDisplay",{});u(this,"pendingNearReveal",new Map);u(this,"nearRevealTimers",new Map);u(this,"nearRevealGraceTimers",new Map);u(this,"poolSize");u(this,"maxPoolSize");u(this,"minPoolSize");u(this,"signHeadsRenderer");u(this,"chunkBoxMaterial",new X.MeshBasicMaterial({color:0,transparent:!0,opacity:0}));u(this,"hits",0);u(this,"misses",0);u(this,"bypassPooling",!1);u(this,"renderTimes",[]);u(this,"maxRenderTimeSamples",30);u(this,"_performanceOverrideDistance");u(this,"lastPerformanceCheck",0);u(this,"performanceCheckInterval",2e3);this.updateViewDistance(s),this.signHeadsRenderer=new Sr(t),this.initializePool()}get performanceOverrideDistance(){return this._performanceOverrideDistance??0}set performanceOverrideDistance(t){this._performanceOverrideDistance=t,this.updateSectionsVisibility()}initializePool(){for(let t=0;t<this.poolSize;t++){let e=new X.BufferGeometry,i=new X.Mesh(e,this.material);i.visible=!1,i.matrixAutoUpdate=!1,i.name="pooled-section-mesh";let r={mesh:i,inUse:!1,lastUsedTime:0};this.meshPool.push(r)}}updateSection(t,e){let i=this.sectionObjects[t];i&&this.cleanupSection(t);let r=this.activeSections.get(t);if(!r){if(r=this.acquireMesh(),!r)return null;this.activeSections.set(t,r),r.sectionKey=t}let{mesh:s}=r;this.updateGeometryAttribute(s.geometry,"position",e.positions,3),this.updateGeometryAttribute(s.geometry,"normal",e.normals,3),this.updateGeometryAttribute(s.geometry,"color",e.colors,3),this.updateGeometryAttribute(s.geometry,"uv",e.uvs,2),s.geometry.index=new X.BufferAttribute(e.indices,1),s.geometry.boundingBox=new X.Box3(new X.Vector3(-8,-8,-8),new X.Vector3(8,8,8)),s.geometry.boundingSphere=new X.Sphere(new X.Vector3(0,0,0),Math.sqrt(3*8**2)),this.worldRenderer.sceneOrigin.track(s,{updateMatrix:!0}),s.position.set(e.sx,e.sy,e.sz),s.updateMatrix(),s.visible=!0,s.name="mesh",r.lastUsedTime=performance.now(),i=new X.Group,i.add(s),i.mesh=s,i.tilesCount=e.positions.length/3/4,i.blocksCount=e.blocksCount,i.worldX=e.sx,i.worldY=e.sy,i.worldZ=e.sz,i.sectionKey=t,i.name="chunk";try{if(Object.keys(e.signs).length>0){let c=new X.Group;c.name="signs";for(let[d,{isWall:f,isHanging:m,rotation:g}]of Object.entries(e.signs)){let b=this.worldRenderer.blockEntities[d];if(!b)continue;let[A,_,w]=d.split(","),T=this.signHeadsRenderer.renderSign(new Tr(+A,+_,+w),g,f,m,q1.simplify(b));T&&c.add(T)}i.add(c),i.signsContainer=c}if(Object.keys(e.heads).length>0){let c=new X.Group;c.name="heads";for(let[d,{isWall:f,rotation:m}]of Object.entries(e.heads)){let g=this.worldRenderer.blockEntities[d];if(!g)continue;let[b,A,_]=d.split(","),w=this.signHeadsRenderer.renderHead(new Tr(+b,+A,+_),m,f,q1.simplify(g));w&&c.add(w)}i.add(c),i.headsContainer=c}if(Object.keys(e.banners).length>0){let c=new X.Group;c.name="banners",i.bannersContainer=c,i.add(c);for(let[d,{isWall:f,rotation:m,blockName:g}]of Object.entries(e.banners)){let b=this.worldRenderer.blockEntities[d];if(!b)continue;let[A,_,w]=d.split(","),T=Do(this.worldRenderer,g,q1.simplify(b));if(!T)continue;let S=Lo(new Tr(+A,+_,+w),m,f,T),{x:C,y:H,z:P}=S.position;this.worldRenderer.sceneOrigin.track(S),S.position.set(C,H,P),c.add(S)}}}catch{}this.sectionObjects[t]=i,this.scene.add(i),i.matrixAutoUpdate=!1,this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&this.updateBoxHelper(t,!0);let o=t.split(","),a=`${o[0]},${o[2]}`,v=!!this.worldRenderer.displayOptions?.inWorldRenderingConfig?._renderByChunks,l=!!this.worldRenderer.worldRendererConfig?.wasmMesher;if((v||l)&&!this.worldRenderer.finishedChunks[a]){i.visible=!1,i._waitingForChunkDisplay=!0;let c=this.waitingChunksToDisplay[a]??(this.waitingChunksToDisplay[a]=[]);c.includes(t)||c.push(t)}return i}finishChunkDisplay(t){if(!this.waitingChunksToDisplay[t]){this.tryRevealPending();return}if(this.isWasmGateActive()&&this.isBlockedByNearer(t,0)){this.pendingNearReveal.set(t,Date.now()),this.armNearRevealTimer(t),this.armExpectedGraceTimer(t);return}this.flushChunkDisplay(t),this.tryRevealPending()}flushChunkDisplay(t){let e=this.waitingChunksToDisplay[t];if(this.pendingNearReveal.delete(t),this.clearNearRevealTimer(t),this.clearExpectedGraceTimer(t),!!e){for(let i of e){let r=this.sectionObjects[i];r&&(r._waitingForChunkDisplay=!1,r.visible=!0)}delete this.waitingChunksToDisplay[t]}}tryRevealPending(){if(this.pendingNearReveal.size===0)return;let t=Date.now();for(let[e,i]of[...this.pendingNearReveal])this.isBlockedByNearer(e,t-i)||this.flushChunkDisplay(e)}onChunkRemovedFromGate(t){this.pendingNearReveal.delete(t),this.clearNearRevealTimer(t),this.clearExpectedGraceTimer(t),delete this.waitingChunksToDisplay[t],this.tryRevealPending()}isWasmGateActive(){return!!this.worldRenderer.worldRendererConfig?.wasmMesher}isBlockedByNearer(t,e){let i=this.worldRenderer.viewerChunkPosition;if(!i)return!1;let r=t.split(",");if(r.length!==2)return!1;let s=Number(r[0]),o=Number(r[1]),a=Math.floor(i.x/16),v=Math.floor(i.z/16),l=(s>>4)-a,c=(o>>4)-v,d=l*l+c*c;if(d===0)return!1;let f=this.worldRenderer.finishedChunks,m=this.worldRenderer.loadedChunks,g=this.worldRenderer.viewDistance;if(e<le.EXPECTED_NEAR_GRACE_MS&&g>0){let A=g*g,_=Math.min(g,Math.ceil(Math.sqrt(Math.max(0,d-1))));for(let w=-_;w<=_;w++)for(let T=-_;T<=_;T++){let S=w*w+T*T;if(S>=d||S>A)continue;let C=a+w<<4,H=v+T<<4,P=`${C},${H}`;if(P!==t&&!f[P])return!0}return!1}for(let A in m){if(A===t||f[A])continue;let _=A.split(",");if(_.length!==2)continue;let w=(Number(_[0])>>4)-a,T=(Number(_[1])>>4)-v;if(w*w+T*T<d)return!0}return!1}armNearRevealTimer(t){if(this.nearRevealTimers.has(t))return;let e=setTimeout(()=>{this.nearRevealTimers.delete(t),this.pendingNearReveal.has(t)&&(this.flushChunkDisplay(t),this.tryRevealPending())},le.NEAR_REVEAL_TIMEOUT_MS);this.nearRevealTimers.set(t,e)}clearNearRevealTimer(t){let e=this.nearRevealTimers.get(t);e&&(clearTimeout(e),this.nearRevealTimers.delete(t))}armExpectedGraceTimer(t){if(this.nearRevealGraceTimers.has(t))return;let e=setTimeout(()=>{this.nearRevealGraceTimers.delete(t),this.pendingNearReveal.has(t)&&this.tryRevealPending()},le.EXPECTED_NEAR_GRACE_MS+50);this.nearRevealGraceTimers.set(t,e)}clearExpectedGraceTimer(t){let e=this.nearRevealGraceTimers.get(t);e&&(clearTimeout(e),this.nearRevealGraceTimers.delete(t))}cleanupSection(t){let e=this.sectionObjects[t];if(e){if(e._waitingForChunkDisplay){let i=t.split(","),r=`${i[0]},${i[2]}`,s=this.waitingChunksToDisplay[r];if(s){let o=s.indexOf(t);o!==-1&&s.splice(o,1),s.length===0&&delete this.waitingChunksToDisplay[r]}}if(e.bannersContainer&&(e.bannersContainer.traverse(i=>{i.bannerTexture&&Fo(i.bannerTexture)}),this.disposeContainer(e.bannersContainer)),e.signsContainer&&this.disposeContainer(e.signsContainer),e.headsContainer&&this.disposeContainer(e.headsContainer),this.worldRenderer.sceneOrigin.removeAndUntrackAll(e),this.scene.remove(e),e.boxHelper){this.worldRenderer.sceneOrigin.removeAndUntrack(e.boxHelper),this.scene.remove(e.boxHelper),e.boxHelper.geometry.dispose();let i=e.boxHelper.material;if(Array.isArray(i))for(let r of i)r.dispose();else i.dispose();e.boxHelper=void 0}delete this.sectionObjects[t]}}releaseSection(t){this.cleanupSection(t);let e=this.activeSections.get(t);return e?(e.mesh.visible=!1,e.inUse=!1,e.sectionKey=void 0,e.lastUsedTime=0,this.clearGeometry(e.mesh.geometry),this.activeSections.delete(t),this.cleanupExcessMeshes(),!0):!1}getSectionObject(t){return this.sectionObjects[t]}updateBoxHelper(t,e,i=this.chunkBoxMaterial){let r=this.sectionObjects[t];if(r?.mesh)if(e){if(!r.boxHelper){let s=new X.Mesh(new X.BoxGeometry(16,16,16),i),o=new X.BoxHelper(s,16776960);o.name="helper";let a=r.worldX??0,v=r.worldY??0,l=r.worldZ??0;this.worldRenderer.sceneOrigin.track(o,{updateMatrix:!0}),o.position.set(a,v,l),o.updateMatrix(),this.scene.add(o),r.boxHelper=o}r.boxHelper.visible=!0}else r.boxHelper&&(r.boxHelper.visible=!1)}updateAllBoxHelpers(t){for(let e of Object.keys(this.sectionObjects))this.updateBoxHelper(e,t)}cleanSignChunkTextures(t,e){this.signHeadsRenderer.cleanChunkTextures(t,e)}getSectionMesh(t){return this.activeSections.get(t)?.mesh}hasSection(t){return this.activeSections.has(t)}updateViewDistance(t){let e=(t*2+1)**2,i=this.worldHeight/16,r=5;if(this.minPoolSize=Math.floor(e*r),this.maxPoolSize=Math.floor(e*i)+1,this.poolSize??(this.poolSize=this.minPoolSize),this.minPoolSize>this.poolSize){let s=Math.min(this.minPoolSize,this.maxPoolSize);this.expandPool(s)}}getStats(){let t=this.meshPool.filter(r=>!r.inUse).length,e=this.hits+this.misses>0?(this.hits/(this.hits+this.misses)*100).toFixed(1):"0",i=this.getEstimatedMemoryUsage();return{poolSize:this.poolSize,activeCount:this.activeSections.size,freeCount:t,hitRate:`${e}%`,hits:this.hits,misses:this.misses,memoryUsage:i}}getTotalTiles(){return Object.values(this.sectionObjects).reduce((t,e)=>t+(e.tilesCount||0),0)}getTotalBlocks(){return Object.values(this.sectionObjects).reduce((t,e)=>t+(e.blocksCount||0),0)}getEstimatedMemoryUsage(){let t=0,e=0,i=0,r=0,s=0,o=0;for(let v of this.meshPool)if(v.inUse&&v.mesh.geometry){let{geometry:l}=v.mesh,c=l.getAttribute("position");if(c){let g=c.array.byteLength;e+=g,t+=g}let d=l.getAttribute("normal");if(d){let g=d.array.byteLength;i+=g,t+=g}let f=l.getAttribute("color");if(f){let g=f.array.byteLength;r+=g,t+=g}let m=l.getAttribute("uv");if(m){let g=m.array.byteLength;s+=g,t+=g}if(l.index){let g=l.index.array.byteLength;o+=g,t+=g}}return{total:`${(t/(1024*1024)).toFixed(2)} MB`,breakdown:{position:`${(e/(1024*1024)).toFixed(2)} MB`,normal:`${(i/(1024*1024)).toFixed(2)} MB`,color:`${(r/(1024*1024)).toFixed(2)} MB`,uv:`${(s/(1024*1024)).toFixed(2)} MB`,index:`${(o/(1024*1024)).toFixed(2)} MB`}}}dispose(){let t=[...this.activeSections.keys()];for(let e of t)this.releaseSection(e);this.signHeadsRenderer.dispose();for(let e of this.meshPool)e.mesh.geometry.dispose();this.meshPool.length=0,this.activeSections.clear(),this.chunkBoxMaterial.dispose(),this.pendingNearReveal.clear();for(let e of this.nearRevealTimers.values())clearTimeout(e);this.nearRevealTimers.clear();for(let e of this.nearRevealGraceTimers.values())clearTimeout(e);this.nearRevealGraceTimers.clear()}acquireMesh(){if(this.bypassPooling){let e={mesh:new X.Mesh(new X.BufferGeometry,this.material),inUse:!0,lastUsedTime:performance.now()};return this.meshPool.push(e),this.poolSize++,e}for(let e of this.meshPool)if(!e.inUse)return e.inUse=!0,e.lastUsedTime=performance.now(),this.hits++,e;this.misses++;let t=Math.min(this.poolSize+16,this.maxPoolSize);t<=this.meshPool.length&&(t=this.meshPool.length+8,this.maxPoolSize=t),this.expandPool(t);for(let e=this.meshPool.length-1;e>=0;e--){let i=this.meshPool[e];if(!i.inUse)return i.inUse=!0,i.lastUsedTime=performance.now(),i}throw new Error("ChunkMeshManager: Failed to acquire mesh after pool expansion")}expandPool(t){let e=this.meshPool.length;this.poolSize=t;for(let i=e;i<t;i++){let r=new X.BufferGeometry,s=new X.Mesh(r,this.material);s.visible=!1,s.matrixAutoUpdate=!1,s.name="pooled-section-mesh";let o={mesh:s,inUse:!1,lastUsedTime:0};this.meshPool.push(o)}}updateGeometryAttribute(t,e,i,r){let s=t.getAttribute(e);s&&s.count===i.length/r?(s.array.set(i),s.needsUpdate=!0):t.setAttribute(e,new X.BufferAttribute(i,r))}clearGeometry(t){let e=["position","normal","color","uv"];for(let i of e)t.hasAttribute(i)&&t.deleteAttribute(i);t.index&&t.setIndex(null),t.boundingBox=null,t.boundingSphere=null}cleanupExcessMeshes(){if(this.poolSize>this.maxPoolSize){let t=this.meshPool.filter(e=>!e.inUse).length;if(t>0){let e=Math.min(this.poolSize-this.maxPoolSize,t);for(let i=0;i<e;i++){let r=this.meshPool.findIndex(s=>!s.inUse);r!==-1&&(this.meshPool[r].mesh.geometry.dispose(),this.meshPool.splice(r,1),this.poolSize--)}}}}disposeContainer(t){x0(t,!0)}recordRenderTime(t){this.renderTimes.push(t),this.renderTimes.length>this.maxRenderTimeSamples&&this.renderTimes.shift();let e=performance.now();e-this.lastPerformanceCheck>this.performanceCheckInterval&&(this.checkPerformance(),this.lastPerformanceCheck=e)}getEffectiveRenderDistance(){return this.performanceOverrideDistance||this.worldRenderer.viewDistance}resetPerformanceOverride(){this.performanceOverrideDistance=void 0,this.renderTimes.length=0}getAverageRenderTime(){return this.renderTimes.length===0?0:this.renderTimes.reduce((t,e)=>t+e,0)/this.renderTimes.length}checkPerformance(){if(this.renderTimes.length<this.maxRenderTimeSamples)return;let t=this.getAverageRenderTime(),e=16.67,i=e*1.5;if(t>i){let r=this.worldRenderer.viewDistance,s=Math.max(1,Math.floor(r*.8));(!this.performanceOverrideDistance||s<this.performanceOverrideDistance)&&(this.performanceOverrideDistance=s)}else if(this.performanceOverrideDistance&&t<e*1.1){let r=this.worldRenderer.viewDistance,s=Math.min(r,this.performanceOverrideDistance+1);s!==this.performanceOverrideDistance&&(this.performanceOverrideDistance=s>=r?void 0:s)}}updateSectionsVisibility(){let t=this.worldRenderer.cameraSectionPos;for(let[e,i]of Object.entries(this.sectionObjects)){if(i._waitingForChunkDisplay){i.visible=!1;continue}if(!this.performanceOverrideDistance){i.visible=!0;continue}let[r,s,o]=e.split(",").map(Number),a={x:r/16,y:s/16,z:o/16},v=a.x-t.x,l=a.z-t.z,c=Math.floor(Math.hypot(v,l));i.visible=c<=this.performanceOverrideDistance}}};u(le,"NEAR_REVEAL_TIMEOUT_MS",5e3),u(le,"EXPECTED_NEAR_GRACE_MS",1500);var O5=le,Sr=class{constructor(t){this.worldRendererThree=t;u(this,"chunkTextures",new Map)}dispose(){for(let[,t]of this.chunkTextures)for(let e of Object.keys(t))t[e].dispose();this.chunkTextures.clear()}renderHead(t,e,i,r){let s;if(r.SkullOwner?s=r.SkullOwner.Properties?.textures?.[0]?.Value:s=r.profile?.properties?.find(o=>o.name==="textures")?.value,!!s)try{let a=JSON.parse(F.from(s,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:v}=this.worldRendererThree.worldRendererConfig;v&&(a=a?.replace("http://textures.minecraft.net/",v).replace("https://textures.minecraft.net/",v));let l=It(this.worldRendererThree,a,Ht.head),c=new X.Group;return i&&l.position.set(0,.3125,.3125),l.position.y-=23/16,c.add(l),this.worldRendererThree.sceneOrigin.track(c),c.position.set(t.x+.5,t.y+.045,t.z+.5),c.rotation.set(0,-X.MathUtils.degToRad(e*(i?90:45/2)),0),c.scale.set(.8,.8,.8),c}catch{}}renderSign(t,e,i,r,s){let o=this.getSignTexture(t,s,r);if(!o)return;let a=new X.Mesh(new X.PlaneGeometry(1,1),new X.MeshBasicMaterial({map:o,transparent:!0}));a.renderOrder=999;let v=7/16,l=r?1.3:1;a.scale.set(1*l,v*l,1*l);let c=(r?2:1.5)/16,d=.25/16;i&&!r?a.position.set(0,0,-.5+c+d+1e-4):a.position.set(0,0,c/2+1e-4);let f=new X.Group;f.rotation.set(0,-X.MathUtils.degToRad(e*(i?90:45/2)),0),f.add(a);let m=(r?10:8)/16,g=(r?0:i?4.333:9.333)/16,b=m/2+g;return this.worldRendererThree.sceneOrigin.track(f),f.position.set(t.x+.5,t.y+b,t.z+.5),f}getSignTexture(t,e,i,r=!1){let s=_e(t),o=this.chunkTextures.get(`${s[0]},${s[1]}`);o||(o={},this.chunkTextures.set(`${s[0]},${s[1]}`,o));let a=`${t.x},${t.y},${t.z}`;if(o[a])return o[a];let v=X4(this.worldRendererThree.version),l=s1(e,i,v);if(!l)return;let c=new X.Texture(l);return c.magFilter=X.NearestFilter,c.minFilter=X.NearestFilter,c.needsUpdate=!0,o[a]=c,c}cleanChunkTextures(t,e){let i=`${Math.floor(t/16)},${Math.floor(e/16)}`,r=this.chunkTextures.get(i);if(r)for(let s of Object.keys(r))r[s].dispose(),delete r[s]}};x();R();M();k();x();R();M();k();import*as Dt from"three";var Z1={},Uo=!1;function $4(){if(Uo)return;let n=globalThis.loadedData?.tints;if(n){for(let t of Object.keys(n))Z1[t]=tv(n[t]);Uo=!0}}function tv(n){let t={},e=Go(n.default??16777215);if(n.data)for(let i of n.data){let r=Go(i.color);for(let s of i.keys)t[s]=r}return new Proxy(t,{get(i,r){return i[r]??e}})}function Go(n){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255]}function No(n,t){return $4(),n==="grass_block"?[1,1,1]:n==="redstone_wire"?[1,1,1]:n==="birch_leaves"||n==="spruce_leaves"||n==="lily_pad"?Z1.constant?.[n]??[1,1,1]:n.includes("leaves")||n==="vine"?Z1.foliage?.[t]??[1,1,1]:["short_grass","tall_grass","fern","large_fern","sugar_cane","grass"].includes(n)?Z1.grass?.[t]??[1,1,1]:[1,1,1]}var ev=512,Cr=1/20,Br=class{constructor(t){this.worldRenderer=t;u(this,"particles",[]);u(this,"sharedMaterial");u(this,"enabled",!1);u(this,"tickAccumulator",0);u(this,"nextParticleIndex",0);u(this,"render",t=>{if(!this.enabled)return;for(this.tickAccumulator+=t;this.tickAccumulator>=Cr;)this.tickAccumulator-=Cr,this.tickPhysics();let e=this.tickAccumulator/Cr;this.updateVisuals(e)})}enable(){this.enabled||(this.enabled=!0,this.ensureMaterial())}disable(){this.enabled&&(this.enabled=!1)}dispose(){for(let t of this.particles)t.active&&this.worldRenderer.sceneOrigin.removeAndUntrack(t.mesh),t.mesh.geometry.dispose();this.particles=[],this.sharedMaterial?.dispose(),this.sharedMaterial=void 0,this.nextParticleIndex=0}spawnBlockBreakParticles(t,e,i,r,s,o="plains"){if(!this.enabled)return;let a=this.resolveBlockTexture(r);if(!a)return;let v=No(r,o);for(let l=0;l<4;l++)for(let c=0;c<4;c++)for(let d=0;d<4;d++){let f=t+(l+.5)/4,m=e+(c+.5)/4,g=i+(d+.5)/4,b=f-t-.5,A=m-e-.5,_=g-i-.5;b+=(Math.random()*2-1)*.4,A+=(Math.random()*2-1)*.4,_+=(Math.random()*2-1)*.4;let w=(Math.random()+Math.random()+1)*.15,T=Math.sqrt(b*b+A*A+_*_),S=b/T*w*.4,C=A/T*w*.4+.1,H=_/T*w*.4,P=Math.floor(4/(Math.random()*.9+.1));this.createParticle(f,m,g,S,C,H,P,a,s,t,i,1,v)}}tickPhysics(){for(let t of this.particles){if(!t.active)continue;if(t.prevX=t.x,t.prevY=t.y,t.prevZ=t.z,t.age++,t.age>=t.maxAge){this.deactivateParticle(t);continue}t.yd-=.04,t.x+=t.xd,t.y+=t.yd,t.z+=t.zd;let e=this.getFloorY(t);t.y<=e?(t.y=e,t.yd=0,t.onGround=!0):t.onGround=!1,t.xd*=.98,t.yd*=.98,t.zd*=.98,t.onGround&&(t.xd*=.7,t.zd*=.7)}}updateVisuals(t){let e=this.worldRenderer.camera.position;for(let i of this.particles){if(!i.active)continue;let r=i.prevX+(i.x-i.prevX)*t,s=i.prevY+(i.y-i.prevY)*t,o=i.prevZ+(i.z-i.prevZ)*t;i.mesh.position.set(r,s,o),i.mesh.lookAt(e.x,e.y,e.z)}}spawnCrackParticle(t,e,i,r,s,o,a="plains"){if(!this.enabled)return;let v=this.resolveBlockTexture(s);if(!v)return;let l=No(s,a),c=t+Math.random()*.8+.1,d=e+Math.random()*.8+.1,f=i+Math.random()*.8+.1;switch(r){case 0:d=e-.1;break;case 1:d=e+1+.1;break;case 2:f=i-.1;break;case 3:f=i+1+.1;break;case 4:c=t-.1;break;case 5:c=t+1+.1;break}let m=(Math.random()*2-1)*.4*.2,g=(Math.random()*2-1)*.4*.2+.1*.2,b=(Math.random()*2-1)*.4*.2,A=Math.floor(4/(Math.random()*.9+.1));this.createParticle(c,d,f,m,g,b,A,v,o,t,i,.6,l)}createParticle(t,e,i,r,s,o,a,v,l,c,d,f=1,m=[1,1,1]){this.ensureMaterial();let g=this.findInactiveParticle();g||(this.particles.length<ev?g=this.allocateParticle():g=this.recycleOldest());let b=Math.floor(Math.random()*4),A=Math.floor(Math.random()*4),_=v.u+b/4*v.su,w=v.v+A/4*v.sv,T=v.su/4,S=v.sv/4;this.setGeometryUVs(g.mesh.geometry,_,w,T,S),g.active=!0,g.x=t,g.y=e,g.z=i,g.prevX=t,g.prevY=e,g.prevZ=i,g.xd=r,g.yd=s,g.zd=o,g.age=0,g.maxAge=a,g.onGround=!1,g.floorMap=l,g.blockX=Math.floor(c),g.blockZ=Math.floor(d);let C=.1*(.5+Math.random()*.5)*2*f;g.mesh.scale.set(C,C,C),g.mesh.position.set(t,e,i),g.mesh.visible=!0;let H=.6*m[0],P=.6*m[1],I=.6*m[2],N=new Float32Array([H,P,I,H,P,I,H,P,I,H,P,I]),O=g.mesh.geometry.getAttribute("color");O?(O.set(N),O.needsUpdate=!0):g.mesh.geometry.setAttribute("color",new Dt.Float32BufferAttribute(N,3)),this.worldRenderer.sceneOrigin.addAndTrack(g.mesh)}allocateParticle(){let t=new Dt.PlaneGeometry(1,1),e=new Dt.Mesh(t,this.sharedMaterial);e.visible=!1;let i={mesh:e,active:!1,x:0,y:0,z:0,prevX:0,prevY:0,prevZ:0,xd:0,yd:0,zd:0,age:0,maxAge:0,onGround:!1,floorMap:[],blockX:0,blockZ:0};return this.particles.push(i),i}findInactiveParticle(){for(let t=0;t<this.particles.length;t++){let e=(this.nextParticleIndex+t)%this.particles.length;if(!this.particles[e].active)return this.nextParticleIndex=(e+1)%this.particles.length,this.particles[e]}}recycleOldest(){let t=this.particles[0];for(let e of this.particles)e.age>t.age&&(t=e);return this.deactivateParticle(t),t}deactivateParticle(t){t.active&&(t.active=!1,t.mesh.visible=!1,this.worldRenderer.sceneOrigin.removeAndUntrack(t.mesh))}getFloorY(t){let e=Math.floor(t.x)-t.blockX,i=Math.floor(t.z)-t.blockZ;return e=Math.max(-2,Math.min(2,e)),i=Math.max(-2,Math.min(2,i)),t.floorMap[(i+2)*5+(e+2)]}resolveBlockTexture(t){let e=this.worldRenderer.resourcesManager.currentResources;if(!e)return null;let i=e.blocksAtlasJson,r=i.textures;if(r[t])return this.extractUV(r[t],i);for(let s of["_side","_top","_front","_0",""]){let o=t+s;if(r[o])return this.extractUV(r[o],i)}for(let s of Object.keys(r))if(s.startsWith(t))return this.extractUV(r[s],i);return null}extractUV(t,e){return{u:t.u,v:t.v,su:t.su??e.suSv,sv:t.sv??e.suSv}}setGeometryUVs(t,e,i,r,s){let o=t.getAttribute("uv");o.setXY(0,e,i),o.setXY(1,e+r,i),o.setXY(2,e,i+s),o.setXY(3,e+r,i+s),o.needsUpdate=!0}ensureMaterial(){if(this.sharedMaterial)return;let t=this.worldRenderer.material.map;t&&(this.sharedMaterial=new Dt.MeshBasicMaterial({map:t,vertexColors:!0,transparent:!0,alphaTest:.1}))}},Wo={id:"blockBreakParticles",controller:Br,enabledDefault:!0,cannotBeDisabled:!0,requiresHeightmap:!1};x();R();M();k();var Pr=class{constructor(t){this.worldRenderer=t;u(this,"enabled",!1);u(this,"lastBobWalkDist",0);u(this,"lastBobTickTime",0);u(this,"render",()=>{if(!this.enabled)return;let t=this.worldRenderer.displayOptions.inWorldRenderingConfig,{perspective:e}=this.worldRenderer.playerStateReactive;if(t.viewBobbing&&e==="first_person"&&!this.worldRenderer.playerStateUtils.isSpectator()){this.worldRenderer.playerStateReactive.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=performance.now(),this.lastBobWalkDist=this.worldRenderer.playerStateReactive.walkDist);let r=Math.min((performance.now()-this.lastBobTickTime)/50,1);this.worldRenderer.cameraShake.setCameraBobInput({walkDist:this.worldRenderer.playerStateReactive.walkDist,prevWalkDist:this.worldRenderer.playerStateReactive.prevWalkDist,bob:this.worldRenderer.playerStateReactive.bob,prevBob:this.worldRenderer.playerStateReactive.prevBob,partialTick:r})}else this.worldRenderer.cameraShake.setCameraBobInput(null)})}enable(){this.enabled=!0}disable(){this.enabled=!1,this.worldRenderer.cameraShake.setCameraBobInput(null);let{perspective:t}=this.worldRenderer.playerStateReactive;t==="first_person"&&this.worldRenderer.camera.position.set(0,0,0)}dispose(){this.disable()}},Vo={id:"cameraBobbing",controller:Pr,enabledDefault:!0,cannotBeDisabled:!0};x();R();M();k();import*as P0 from"three";var Ir=2e3,jo=32,Yo=32,X1=12,Qo=24,$1=1.2,iv=-5;var Hr=class{constructor(t){this.worldRenderer=t;u(this,"instancedMesh");u(this,"geometry");u(this,"material");u(this,"particles",[]);u(this,"enabled",!1);u(this,"dummy",new P0.Matrix4);u(this,"tempPosition",new P0.Vector3);u(this,"tempQuaternion",new P0.Quaternion);u(this,"tempScale",new P0.Vector3);u(this,"render",t=>{if(!this.enabled||!this.instancedMesh||!this.material)return;this.syncMaterialToSceneFog();let e=this.worldRenderer.getCameraPosition();this.instancedMesh.position.set(0,0,0);let i=this.worldRenderer.reactiveState.world.heightmaps,{dummy:r,tempPosition:s,tempQuaternion:o,tempScale:a}=this,v=NaN,l=NaN,c;for(let d=0;d<Ir;d++){let f=this.particles[d];this.instancedMesh.getMatrixAt(d,r),r.decompose(s,o,a),s.addScaledVector(f.velocity,t);let m=s.y,g=Math.sqrt(s.x*s.x+s.z*s.z),b=e.x+s.x,A=e.y+s.y,_=e.z+s.z,w=Math.floor(b/16),T=Math.floor(_/16);(w!==v||T!==l)&&(c=i.get(`${w},${T}`),v=w,l=T);let S=(Math.floor(b)%16+16)%16,C=(Math.floor(_)%16+16)%16,H=c?.[C*16+S];if(g>jo||H!==void 0&&H!==-32768&&A<=H+1+f.despawnOffset||m<iv){this.respawnParticle(s);let I=X1+Math.random()*(Qo-X1);f.velocity.set((Math.random()-.5)*$1,-I,(Math.random()-.5)*$1),f.despawnOffset=Math.random()*.5}r.compose(s,o,a),this.instancedMesh.setMatrixAt(d,r)}this.instancedMesh.instanceMatrix.needsUpdate=!0})}enable(){this.enabled||(this.enabled=!0,this.instancedMesh?this.instancedMesh.visible=!0:this.createRain())}disable(){this.enabled&&(this.enabled=!1,this.instancedMesh&&(this.instancedMesh.visible=!1))}autoEnableCheck(){return this.worldRenderer.worldRendererConfig.isRaining===!0}dispose(){this.instancedMesh&&this.worldRenderer.scene.remove(this.instancedMesh),this.geometry?.dispose(),this.material?.dispose(),this.instancedMesh=void 0,this.geometry=void 0,this.material=void 0,this.particles=[]}syncMaterialToSceneFog(){if(!this.material)return;let t=this.worldRenderer.scene.fog;t instanceof P0.Fog||t instanceof P0.FogExp2?this.material.color.copy(t.color):this.material.color.set(13426158),this.material.fog=!0}createRain(){this.geometry=new P0.BoxGeometry(.03,.3,.03),this.material=new P0.MeshBasicMaterial({color:13426158,transparent:!0,opacity:.35,depthWrite:!1,fog:!0}),this.instancedMesh=new P0.InstancedMesh(this.geometry,this.material,Ir),this.instancedMesh.name="rain-particles",this.instancedMesh.frustumCulled=!1,this.syncMaterialToSceneFog();let t=new P0.Matrix4,e=new P0.Vector3;for(let i=0;i<Ir;i++){this.respawnParticle(e),e.y=Math.random()*Yo,t.setPosition(e),this.instancedMesh.setMatrixAt(i,t);let r=X1+Math.random()*(Qo-X1);this.particles.push({velocity:new P0.Vector3((Math.random()-.5)*$1,-r,(Math.random()-.5)*$1),age:0,despawnOffset:Math.random()*.5})}this.instancedMesh.instanceMatrix.needsUpdate=!0,this.worldRenderer.scene.add(this.instancedMesh)}respawnParticle(t){let e=Math.random()*Math.PI*2,i=Math.random()*jo;t.set(Math.cos(e)*i,Yo,Math.sin(e)*i)}},Ko={id:"rain",controller:Hr,enabledDefault:!1,requiresHeightmap:!0};x();R();M();k();import*as B0 from"three";var Jo=new B0.Color(13/255,234/255,238/255),rv=9;var nv=350,sv=650;var ov=120,av=280,Or=class{constructor(t){this.worldRenderer=t;u(this,"pendingGeometries",new Map);u(this,"revealingSections",new Map);u(this,"finishedChunkCount",0);u(this,"revealTriggered",!1);u(this,"revealStartTime",0);u(this,"enabled",!1);u(this,"onWorldSwitchedCb",null);u(this,"patched",!1);u(this,"initialWaveDone",!1);u(this,"wireframeMaterial");u(this,"wireframeGlowMaterial");u(this,"pulseTime",0);u(this,"revealedChunks",new Set);u(this,"originalFinishChunk",null);u(this,"originalDestroy",null);u(this,"originalSceneAdd",null);u(this,"originalHandleWorkerMessage",null);u(this,"configEnabled",!0);u(this,"render",t=>{this.enabled&&this.update(t*1e3)});this.configEnabled=this.worldRenderer.worldRendererConfig.futuristicReveal===!0,this.wireframeMaterial=new B0.LineBasicMaterial({color:Jo,transparent:!0,opacity:1,blending:B0.AdditiveBlending,depthWrite:!1}),this.wireframeGlowMaterial=new B0.LineBasicMaterial({color:Jo,transparent:!0,opacity:.55,blending:B0.AdditiveBlending,depthWrite:!1})}enable(){this.configEnabled&&(this.enabled||(this.enabled=!0,this.patchWorldRenderer()))}disable(){this.enabled&&(this.enabled=!1,this.unpatchWorldRenderer(),this.reset())}toggle(){return this.enabled?this.disable():this.enable(),this.enabled}dispose(){this.disable(),this.wireframeMaterial.dispose(),this.wireframeGlowMaterial.dispose()}patchWorldRenderer(){if(this.patched)return;this.patched=!0;let t=this.worldRenderer;this.onWorldSwitchedCb=()=>this.reset(),t.onWorldSwitched.push(this.onWorldSwitchedCb),this.originalFinishChunk=t.finishChunk.bind(t),t.finishChunk=e=>{this.originalFinishChunk(e),this.onChunkFinished(e)},this.originalDestroy=t.destroy.bind(t),t.destroy=()=>{this.dispose(),this.originalDestroy()},this.originalHandleWorkerMessage=t.handleWorkerMessage.bind(t),t.handleWorkerMessage=e=>{this.originalHandleWorkerMessage(e),this.enabled&&e?.type==="geometry"&&Promise.resolve().then(()=>{try{this.registerSection(e.key,e.geometry)}catch{}})},this.originalSceneAdd=t.scene.add.bind(t.scene),t.scene.add=(...e)=>{let i=this.originalSceneAdd(...e);for(let r of e)this.checkAndPatchMesh(r);return i}}unpatchWorldRenderer(){let t=this.worldRenderer;if(this.originalFinishChunk&&(t.finishChunk=this.originalFinishChunk,this.originalFinishChunk=null),this.originalDestroy&&(t.destroy=this.originalDestroy,this.originalDestroy=null),this.originalHandleWorkerMessage&&(t.handleWorkerMessage=this.originalHandleWorkerMessage,this.originalHandleWorkerMessage=null),this.originalSceneAdd&&(t.scene.add=this.originalSceneAdd,this.originalSceneAdd=null),this.onWorldSwitchedCb){let e=t.onWorldSwitched.indexOf(this.onWorldSwitchedCb);e!==-1&&t.onWorldSwitched.splice(e,1),this.onWorldSwitchedCb=null}this.patched=!1}checkAndPatchMesh(t){if(t instanceof B0.Mesh&&t.name==="mesh"){let e=this.findSectionKeyForMesh(t);e&&this.shouldUseRevealEffect(e)&&(t.visible=!1,t.hiddenByReveal=!0)}for(let e of t.children)this.checkAndPatchMesh(e)}findSectionKeyForMesh(t){let e=t;for(;e;){let{sectionKey:m}=e;if(m&&this.worldRenderer.chunkMeshManager.sectionObjects[m]===e)return m;e=e.parent}let i=this.worldRenderer.sceneOrigin.getWorldPosition(t),r=i?.x??this.worldRenderer.sceneOrigin.toWorldX(t.position.x),s=i?.y??this.worldRenderer.sceneOrigin.toWorldY(t.position.y),o=i?.z??this.worldRenderer.sceneOrigin.toWorldZ(t.position.z),a=16,v=this.worldRenderer.getSectionHeight(),l=Math.floor(r/a)*a,c=Math.floor(s/v)*v,d=Math.floor(o/a)*a,f=`${l},${c},${d}`;return this.worldRenderer.chunkMeshManager.sectionObjects[f]?f:null}get scene(){return this.worldRenderer.realScene}getCameraPosition(){return this.worldRenderer.getCameraPosition()}getOriginalMesh(t){let e=this.worldRenderer.chunkMeshManager.sectionObjects[t];return e?e.children.find(i=>i.name==="mesh"):null}onChunkFinished(t){this.finishedChunkCount++,!this.revealTriggered&&this.finishedChunkCount>=rv&&this.triggerReveal()}registerSection(t,e){this.revealedChunks.has(t)||this.revealingSections.has(t)||(this.revealTriggered?this.startSectionReveal(t,e):this.pendingGeometries.set(t,e))}shouldUseRevealEffect(t){return this.enabled&&!this.revealedChunks.has(t)&&!this.revealingSections.has(t)}triggerReveal(){this.revealTriggered=!0,this.initialWaveDone=!0,this.revealStartTime=performance.now();let t=this.getCameraPosition(),e=[...this.pendingGeometries.entries()];this.pendingGeometries.clear();let i=e.map(([s,o])=>{let a=Math.hypot(o.sx-t.x,o.sy-t.y,o.sz-t.z);return{key:s,geometry:o,distance:a}}).sort((s,o)=>s.distance-o.distance),r=i.at(-1)?.distance||1;for(let{key:s,geometry:o,distance:a}of i){let v=a/r*1500;setTimeout(()=>{!this.revealedChunks.has(s)&&!this.revealingSections.has(s)&&this.startSectionReveal(s,o)},v)}}startSectionReveal(t,e){if(!e.positions?.length||this.revealingSections.has(t)||this.revealedChunks.has(t))return;let i=this.createWireframeGeometry(e),r=this.getOriginalMesh(t);r&&(r.visible=!1,r.hiddenByReveal=!0);let s=new B0.LineSegments(i,this.wireframeMaterial.clone());this.worldRenderer.sceneOrigin.track(s),s.position.set(e.sx,e.sy,e.sz),s.name="scifi-wireframe",s.renderOrder=1e3;let o=new B0.LineSegments(i.clone(),this.wireframeGlowMaterial.clone());this.worldRenderer.sceneOrigin.track(o),o.position.set(e.sx,e.sy,e.sz),o.scale.set(1.02,1.02,1.02),o.name="scifi-glow",o.renderOrder=999;let a=new B0.Group;a.add(s),a.add(o),a.name="scifi-reveal-group",a.sectionKey=t,this.scene.add(a);let v=this.initialWaveDone?ov:nv,l=this.initialWaveDone?av:sv,c={key:t,wireframeGroup:a,revealStartTime:performance.now(),phase:"wireframe",originalMeshRef:null,wireframeMs:v,revealMs:l};setTimeout(()=>{let d=this.getOriginalMesh(t);d&&!d.hiddenByReveal&&(d.visible=!1,d.hiddenByReveal=!0)},0),this.revealingSections.set(t,c)}createWireframeGeometry(t){if(t.wireframePositions&&t.wireframePositions.length>0){let a=new B0.BufferGeometry;return a.setAttribute("position",new B0.Float32BufferAttribute(t.wireframePositions,3)),a}let e=t.positions,i=t.indices,r=[],s=new Set;for(let a=0;a<i.length;a+=3){let v=i[a],l=i[a+1],c=i[a+2];this.addEdge(e,v,l,r,s),this.addEdge(e,l,c,r,s),this.addEdge(e,c,v,r,s)}let o=new B0.BufferGeometry;return o.setAttribute("position",new B0.Float32BufferAttribute(r,3)),o}addEdge(t,e,i,r,s){let o=Math.min(e,i),a=Math.max(e,i),v=`${o}-${a}`;s.has(v)||(s.add(v),r.push(t[e*3],t[e*3+1],t[e*3+2],t[i*3],t[i*3+1],t[i*3+2]))}update(t){if(!this.enabled||this.revealingSections.size===0)return;this.pulseTime+=t*.001;let e=performance.now(),i=.6+.4*Math.sin(this.pulseTime*4),r=[];for(let[s,o]of this.revealingSections){let a=e-o.revealStartTime;if(o.phase==="wireframe"){let v=o.wireframeGroup.children[0],l=o.wireframeGroup.children[1];if(v?.material){let c=v.material;c.opacity=i;let d=.85+.15*Math.sin(this.pulseTime*6+a*.002);c.color.setRGB(13/255*d,234/255*d,238/255*d)}if(l?.material){let c=l.material;c.opacity=i*.4}if(a>o.wireframeMs&&(o.phase="transitioning",o.originalMeshRef=this.getOriginalMesh(s),o.originalMeshRef)){o.originalMeshRef.visible=!0;let c=o.originalMeshRef.material,d=c.clone();d.transparent=!0,d.opacity=0,d.needsUpdate=!0,o.originalMeshRef.originalMaterial=c,o.originalMeshRef.material=d}}else if(o.phase==="transitioning"){let v=a-o.wireframeMs,l=Math.min(1,v/o.revealMs),c=1-(1-l)**3,d=o.wireframeGroup.children[0],f=o.wireframeGroup.children[1];if(d?.material){let m=d.material;m.opacity=1-c}if(f?.material){let m=f.material;m.opacity=(1-c)*.55}if(o.originalMeshRef?.material){let m=o.originalMeshRef.material;m.opacity=c}l>=1&&(o.phase="complete",r.push(o))}}for(let s of r)this.completeReveal(s)}completeReveal(t){if(this.revealingSections.delete(t.key),this.revealedChunks.add(t.key),t.originalMeshRef){let e=t.originalMeshRef.originalMaterial;if(e){let i=t.originalMeshRef.material;t.originalMeshRef.material=e,i.dispose(),delete t.originalMeshRef.originalMaterial}t.originalMeshRef.visible=!0,delete t.originalMeshRef.hiddenByReveal}this.disposeWireframeGroup(t.wireframeGroup)}disposeWireframeGroup(t){this.worldRenderer.sceneOrigin.removeAndUntrackAll(t);let e=[];t.traverse(i=>{e.push(i)});for(let i of e){let r=i;if(r.geometry&&r.geometry.dispose(),r.material){let s=r.material;if(Array.isArray(s))for(let o of s)o.dispose();else s&&typeof s.dispose=="function"&&s.dispose()}}t.clear()}reset(){for(let t of this.revealingSections.values())this.disposeWireframeGroup(t.wireframeGroup);this.pendingGeometries.clear(),this.revealingSections.clear(),this.revealedChunks.clear(),this.finishedChunkCount=0,this.revealTriggered=!1,this.revealStartTime=0,this.pulseTime=0}forceCompleteAll(){let t=[...this.revealingSections.values()];for(let e of t){if(e.originalMeshRef||(e.originalMeshRef=this.getOriginalMesh(e.key)),e.originalMeshRef){let i=e.originalMeshRef.originalMaterial;i&&(e.originalMeshRef.material=i),e.originalMeshRef.visible=!0}this.completeReveal(e)}}debugGetWireframeGroups(){let t=[];return this.scene.traverse(e=>{e.name==="scifi-reveal-group"&&t.push(e)}),t}debugForceCleanup(){let t=this.debugGetWireframeGroups();for(let e of t)this.disposeWireframeGroup(e);for(let e of this.revealingSections.values())this.disposeWireframeGroup(e.wireframeGroup);this.revealingSections.clear()}debugStatus(){let t=this.debugGetWireframeGroups(),e=new Set(this.revealingSections.keys()),i=t.filter(r=>!e.has(r.sectionKey));return{revealTriggered:this.revealTriggered,finishedChunkCount:this.finishedChunkCount,pendingGeometries:this.pendingGeometries.size,revealingSections:this.revealingSections.size,revealedChunks:this.revealedChunks.size,wireframeGroupsInScene:t.length,orphanedWireframeGroups:i.length,orphanedKeys:i.map(r=>r.sectionKey),sections:[...this.revealingSections.entries()].map(([r,s])=>({key:r,phase:s.phase,hasOriginalMesh:!!s.originalMeshRef,wireframeInScene:s.wireframeGroup.parent!==null}))}}debugLog(){}},qo={id:"futuristicReveal",controller:Or,enabledDefault:!0};x();R();M();k();import*as M0 from"three";var vv=parseInt(M0.REVISION.replaceAll(/\D+/g,""),10),zr=class extends M0.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
|
|
21217
21217
|
uniform float time;
|
|
21218
21218
|
attribute float size;
|
|
21219
21219
|
varying vec3 vColor;
|
|
@@ -21232,8 +21232,8 @@ void main() {
|
|
|
21232
21232
|
gl_FragColor = vec4(vColor, 1.0);
|
|
21233
21233
|
|
|
21234
21234
|
#include <tonemapping_fragment>
|
|
21235
|
-
#include <${
|
|
21236
|
-
}`})}},Ir=class{constructor(t){this.worldRenderer=t;u(this,"points");u(this,"clock",new T0.Clock);u(this,"enabled",!1);u(this,"currentTime");u(this,"enablementCheck",()=>this.currentTime?this.currentTime>13500&&this.currentTime<23e3:!1);u(this,"render",t=>{this.points&&(this.points.position.set(0,0,0),this.points.material.uniforms.time.value=this.clock.getElapsedTime()*.2)})}enable(){this.enabled||(this.enabled=!0,this.updateVisibility())}disable(){this.enabled&&(this.enabled=!1,this.removeStars())}toggle(){return this.enabled?this.disable():this.enable(),this.enabled}updateTimeOfDay(t){this.currentTime=t,this.enabled&&this.updateVisibility()}updateVisibility(){if(!this.enabled)return;let t=this.enablementCheck?.()??!1;t&&!this.points?this.createStars():!t&&this.points&&this.removeStars()}createStars(){if(this.points)return;let t=80,e=50,i=7e3,r=7,s=10,o=new T0.BufferGeometry,a=b=>new T0.Vector3().setFromSpherical(new T0.Spherical(b,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),v=[],l=[],c=Array.from({length:i},()=>(.5+.5*Math.random())*r),d=new T0.Color,f=t+e,m=e/i;for(let b=0;b<i;b++)f-=m*Math.random(),v.push(...a(f).toArray()),d.setHSL(b/i,s,.9),l.push(d.r,d.g,d.b);o.setAttribute("position",new T0.Float32BufferAttribute(v,3)),o.setAttribute("color",new T0.Float32BufferAttribute(l,3)),o.setAttribute("size",new T0.Float32BufferAttribute(c,1));let g=new Br;g.blending=T0.AdditiveBlending,g.depthTest=!1,g.transparent=!0,this.points=new T0.Points(o,g),this.points.renderOrder=-1,this.worldRenderer.scene.add(this.points)}dispose(){this.removeStars()}removeStars(){this.points&&(this.points.geometry.dispose(),this.points.material.dispose(),this.worldRenderer.scene.remove(this.points),this.points=void 0)}},Vo={id:"starfield",controller:Ir,enabledDefault:!0,cannotBeDisabled:!0};var jo={starfield:Vo,futuristicReveal:Wo,rain:Go,cameraBobbing:Do,blockBreakParticles:zo};var P5=class P5 extends a1{constructor(e,i,r){if(!r.resourcesManager)throw new Error("resourcesManager is required in displayOptions");super(r.resourcesManager,r,i);this.renderer=e;this.initOptions=i;this.displayOptions=r;u(this,"outputFormat","threeJs");u(this,"chunkMeshManager");u(this,"chunkTextures",new Map);u(this,"signsCache",new Map);u(this,"cameraSectionPos",new Dt(0,0,0));u(this,"holdingBlock");u(this,"holdingBlockLeft");u(this,"scene",new Q.Scene);u(this,"ambientLight",new Q.AmbientLight(13421772));u(this,"directionalLight",new Q.DirectionalLight(16777215,.5));u(this,"entities",new S1(this,globalThis.mcData));u(this,"performanceMonitor");u(this,"cameraGroupVr");u(this,"material",new Q.MeshBasicMaterial({vertexColors:!0,transparent:!0,alphaTest:.1}));u(this,"itemsTexture");u(this,"cursorBlock");u(this,"onRender",[]);u(this,"lastRenderTime",0);u(this,"cameraShake");u(this,"cameraContainer");u(this,"media");u(this,"waypoints");u(this,"cinimaticScript");u(this,"camera");u(this,"renderTimeAvg",0);u(this,"pendingSectionUpdates",new Map);u(this,"pendingSectionBufferStartTimes",new Map);u(this,"modules",{});u(this,"sectionsOffsetsAnimations",{});u(this,"fountains",[]);u(this,"fireworksLegacy");u(this,"DEBUG_RAYCAST",!1);u(this,"skyboxRenderer");u(this,"fireworks");u(this,"sceneOrigin",new G1(this.scene));u(this,"cameraWorldPos",{x:0,y:0,z:0});u(this,"_cameraPositionAccessWarned",!1);u(this,"_tmpCameraPos",new Q.Vector3);u(this,"currentPosTween");u(this,"currentRotTween");u(this,"_tpDirection",new Q.Vector3);u(this,"_tpPitchQuat",new Q.Quaternion);u(this,"_tpYawQuat",new Q.Quaternion);u(this,"_tpFinalQuat",new Q.Quaternion);u(this,"_tpScenePos",new Q.Vector3);u(this,"_tpAxisX",new Q.Vector3(1,0,0));u(this,"_tpAxisY",new Q.Vector3(0,1,0));u(this,"_tpRaycaster",new Q.Raycaster);u(this,"_tpChunkWorldPos",new Q.Vector3);u(this,"debugOverlayAdded",!1);u(this,"debugRaycastHelper");u(this,"debugHitPoint");u(this,"prevFramePerspective",null);this.performanceMonitor=new Je(this.reactiveState.world.instabilityFactors),this.renderer=e,r.rendererState.renderer=P5.getRendererInfo(e)??"...",this.chunkMeshManager=new C5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.onRenderDistanceChanged=s=>{this.chunkMeshManager.updateViewDistance(s)},this.cursorBlock=new C1(this),this.holdingBlock=x5(this),this.holdingBlockLeft=x5(this,!0);for(let s of Object.values(jo))this.registerModule(s);this.skyboxRenderer=new L1(this.realScene,!1,null),this.skyboxRenderer.init(),this.addDebugOverlay(),this.resetScene(),this.init(),this.soundSystem=new B1(this),this.cameraShake=new I1(this,this.onRender),this.media=new H1(this),this.fireworksLegacy=new D1(this),this.waypoints=new z1(this),this.cinimaticScript=new F1(this,(s,o,a)=>this.setCinimaticCamera(s,o,a),s=>this.setCinimaticFov(s),()=>({position:new Dt(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),yaw:this.cameraShake.getBaseRotation().yaw,pitch:this.cameraShake.getBaseRotation().pitch,fov:this.camera.fov})),this.fireworks=new U1(this.realScene,this.sceneOrigin),this.renderUpdateEmitter.on("chunkFinished",s=>{this.finishChunk(s)}),this.worldSwitchActions(),this.initializeModules()}get sectionObjects(){return this.chunkMeshManager.sectionObjects}get realScene(){return this.scene}get waitingChunksToDisplay(){return this.chunkMeshManager.waitingChunksToDisplay}get estimatedMemoryUsage(){return this.chunkMeshManager.getEstimatedMemoryUsage().total}get tilesRendered(){return this.chunkMeshManager.getTotalTiles()}get blocksRendered(){return this.chunkMeshManager.getTotalBlocks()}registerModule(e){if(e.id in this.modules)return;let i=new e.controller(this),r={manifest:e,controller:i,enabled:!1,toggle:()=>this.toggleModule(e.id)};this.modules[e.id]=r,e.enabledDefault&&this.toggleModule(e.id,!0)}enableModule(e){let i=this.modules[e];i&&(i.enabled||(i.enabled=!0,i.controller.enable(),i.controller.render&&this.onRender.push(i.controller.render)))}disableModule(e){let i=this.modules[e];if(i&&!i.manifest.cannotBeDisabled&&i.enabled&&(i.enabled=!1,i.controller.disable(),i.controller.render)){let r=this.onRender.indexOf(i.controller.render);r>-1&&this.onRender.splice(r,1)}}toggleModule(e,i){let r=this.modules[e];if(!r)return!1;let s=i!==void 0?i:!r.enabled;if(s===r.enabled)return r.enabled;if(!s&&r.manifest.cannotBeDisabled)return!0;if(r.enabled=s,s)r.controller.enable(),r.controller.render&&!this.onRender.includes(r.controller.render)&&this.onRender.push(r.controller.render);else if(r.controller.disable(),r.controller.render){let o=this.onRender.indexOf(r.controller.render);o>-1&&this.onRender.splice(o,1)}return s}disposeModules(){for(let e of Object.values(this.modules))e.controller.dispose();this.modules={}}initializeModules(){this.updateModulesFromConfig()}getModule(e){return this.modules[e]?.controller}anyModuleRequiresHeightmap(){return Object.values(this.modules).some(e=>e.enabled&&e.manifest.requiresHeightmap)}get cameraObject(){return this.cameraGroupVr??this.cameraContainer}_wrapCameraPositionWithWarning(){let e=this.camera.position,i=this,r=20,s=(v,l,c)=>Math.abs(v)>r||Math.abs(l)>r||Math.abs(c)>r,o=()=>{!i._cameraPositionAccessWarned&&typeof D<"u"},a=new Proxy(e,{set(v,l,c){return(l==="x"||l==="y"||l==="z")&&typeof c=="number"&&Math.abs(c)>r&&o(),v[l]=c,!0},get(v,l,c){let d=v[l];return l==="set"?function(f,m,g){return s(f,m,g)&&o(),v.set(f,m,g)}:l==="setX"||l==="setY"||l==="setZ"?function(f){return Math.abs(f)>r&&o(),v[l](f)}:l==="copy"?function(f){return s(f.x,f.y,f.z)&&o(),v.copy(f)}:typeof d=="function"?d.bind(v):d}});Object.defineProperty(this.camera,"position",{value:a,configurable:!0,enumerable:!0})}worldSwitchActions(){this.onWorldSwitched.push(()=>{this.protocolCustomBlocks.clear(),this.sectionsOffsetsAnimations={},this.waypoints.clear(),this.cinimaticScript.stopScript(),this.fireworks.clear()})}downloadWorldGeometry(){Ar(this,new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraShake.getBaseRotation(),"world-geometry.json")}updateEntity(e,i=!1){let r={rotation:{head:{x:e.headPitch??e.pitch,y:e.headYaw,z:0}}};i?this.entities.updateEntityPosition(e,!1,r):this.entities.update(e,r)}updatePlayerEntity(e){this.entities.handlePlayerEntity(e)}resetScene(){this.sceneOrigin.update(0,0,0),this.cameraWorldPos.x=0,this.cameraWorldPos.y=0,this.cameraWorldPos.z=0,this.scene.matrixAutoUpdate=!1,this.scene.background=new Q.Color(this.initOptions.config.sceneBackground),this.scene.add(this.ambientLight),this.directionalLight.position.set(1,1,.5).normalize(),this.directionalLight.castShadow=!0,this.scene.add(this.directionalLight);let e=this.renderer.getSize(new Q.Vector2);this.camera=new Q.PerspectiveCamera(75,e.x/e.y,.1,1e3),this._wrapCameraPositionWithWarning(),this.cameraContainer=new Q.Object3D,this.cameraContainer.add(this.camera),this.scene.add(this.cameraContainer)}watchReactivePlayerState(){super.watchReactivePlayerState(),this.onReactivePlayerStateUpdated("inWater",e=>{this.skyboxRenderer.updateWaterState(e,this.playerStateReactive.waterBreathing)}),this.onReactivePlayerStateUpdated("waterBreathing",e=>{this.skyboxRenderer.updateWaterState(this.playerStateReactive.inWater,e)}),this.onReactivePlayerStateUpdated("ambientLight",e=>{e&&(this.ambientLight.intensity=e)}),this.onReactivePlayerStateUpdated("directionalLight",e=>{e&&(this.directionalLight.intensity=e)}),this.onReactivePlayerStateUpdated("lookingAtBlock",e=>{this.cursorBlock.setHighlightCursorBlock(e?new Dt(e.x,e.y,e.z):null,e?.shapes)}),this.onReactivePlayerStateUpdated("diggingBlock",e=>{this.cursorBlock.updateBreakAnimation(e?{x:e.x,y:e.y,z:e.z}:void 0,e?.stage??null,e?.mergedShape)}),this.onReactivePlayerStateUpdated("perspective",e=>{let i=new Dt(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z);this.updateCamera(i,this.cameraShake.getBaseRotation().yaw,this.cameraShake.getBaseRotation().pitch)})}watchReactiveConfig(){super.watchReactiveConfig(),this.onReactiveConfigUpdated("showChunkBorders",i=>{this.updateShowChunksBorder(i)}),this.onReactiveConfigUpdated("defaultSkybox",i=>{this.skyboxRenderer.updateDefaultSkybox(i)});let e=this.displayOptions.inWorldRenderingConfig.handRenderer;this.onReactiveConfigUpdated("handRenderer",i=>{if(i===e)return;e=i;let r=this.holdingBlock.ready,s=this.holdingBlockLeft.ready;this.holdingBlock.dispose(),this.holdingBlockLeft.dispose(),this.holdingBlock=x5(this),this.holdingBlockLeft=x5(this,!0),r&&(this.holdingBlock.ready=!0,this.holdingBlock.updateItem()),s&&(this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem())}),this.onReactiveConfigUpdated("*",()=>{this.updateModulesFromConfig()}),this.updateModulesFromConfig()}updateModulesFromConfig(){let{moduleStates:e}=this.worldRendererConfig;for(let[i,r]of Object.entries(this.modules)){let s=e[i];if(s==="enabled"){r.enabled||this.toggleModule(i,!0);continue}if(s==="disabled"){r.enabled&&!r.manifest.cannotBeDisabled&&this.toggleModule(i,!1);continue}if(s==="auto"||s===void 0)if(r.controller.autoEnableCheck){let o=r.controller.autoEnableCheck();o&&!r.enabled?this.toggleModule(i,!0):!o&&r.enabled&&!r.manifest.cannotBeDisabled&&this.toggleModule(i,!1)}else{let o=r.manifest.enabledDefault??!1;o&&!r.enabled?this.toggleModule(i,!0):!o&&r.enabled&&!r.manifest.cannotBeDisabled&&this.toggleModule(i,!1)}}}changeHandSwingingState(e,i=!1){let r=i?this.holdingBlockLeft:this.holdingBlock;e?r.startSwing():r.stopSwing()}async updateAssetsData(){let e=this.resourcesManager.currentResources,i=this.material.map,r=this.itemsTexture,s=s5(e.blocksAtlasImage);s.needsUpdate=!0,s.flipY=!1,this.material.map=s;let o=s5(e.itemsAtlasImage);o.needsUpdate=!0,o.flipY=!1,this.itemsTexture=o,i&&i.dispose(),r&&r.dispose(),await super.updateAssetsData(),this.onAllTexturesLoaded(),Object.keys(this.loadedChunks).length>0&&this.rerenderAllChunks()}onAllTexturesLoaded(){this.holdingBlock.ready=!0,this.holdingBlock.updateItem(),this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem()}changeBackgroundColor(e){this.realScene.background=new Q.Color(e[0],e[1],e[2])}changeCardinalLight(e){this.worldRendererConfig.cardinalLight=e}timeUpdated(e){let i=this.getModule("starfield");i?.updateTimeOfDay&&i.updateTimeOfDay(e),this.skyboxRenderer.updateTime(e)}biomeUpdated(e){e?.temperature!==void 0&&this.skyboxRenderer.updateTemperature(e.temperature)}biomeReset(){this.skyboxRenderer.updateTemperature(yr)}getItemRenderData(e,i){return po(e,i,this.resourcesManager,this.playerStateReactive)}async demoModel(){let e=cursorBlockRel(0,1,0).position,i=await g5();X2(i,e);let r=new Q.BoxHelper(i,16776960);i.add(r),this.realScene.add(i)}demoItem(){let e=cursorBlockRel(0,1,0).position,{mesh:i}=this.entities.getItemMesh({itemId:541},{});i.position.set(e.x+.5,e.y+.5,e.z+.5);let r=new Q.BoxHelper(i,16776960);i.add(r),this.realScene.add(i)}addDebugOverlay(){if(this.debugOverlayAdded)return;this.debugOverlayAdded=!0;let e=_e("debug-overlay",80,0,void 0,{className:n5});setInterval(()=>{if(e.setVisibility(this.displayAdvancedStats),this.displayAdvancedStats){let i=v=>new Intl.NumberFormat("en-US",{}).format(v),r=v=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(v),s="";s+=`TE: ${i(this.renderer.info.memory.textures)} `,s+=`F: ${r(this.tilesRendered)} `,s+=`B: ${r(this.blocksRendered)} `,s+=`MEM: ${this.chunkMeshManager.getEstimatedMemoryUsage().total} `;let o=this.chunkMeshManager.getStats();s+=`POOL: ${o.activeCount}/${o.poolSize} `;let a=ci(this.reactiveState.world.instabilityFactors);a&&(s+=`PF: ${a} `),e.updateText(s),this.backendInfoReport=s}},200)}updatePosDataChunk(e){let[i,r,s]=e.split(",").map(l=>Math.floor(+l/16)),o=Math.abs(i-this.cameraSectionPos.x)+Math.abs(r-this.cameraSectionPos.y)+Math.abs(s-this.cameraSectionPos.z),a=this.sectionObjects[e],v=a.mesh??a.children.find(l=>l.name==="mesh");v.renderOrder=500-o}updateViewerPosition(e){this.viewerChunkPosition=e}cameraSectionPositionUpdate(){for(let e in this.sectionObjects)this.sectionObjects[e]&&this.updatePosDataChunk(e)}getDir(e,i){return e===i?0:e<i?1:-1}finishChunk(e){this.chunkMeshManager.finishChunkDisplay(e)}applyPendingSectionUpdates(){if(this.pendingSectionUpdates.size===0)return;let e=performance.now(),i=this.getSectionHeight(),r=[];for(let s of this.pendingSectionUpdates.keys()){let o=this.pendingSectionBufferStartTimes.get(s)??e;if(e-o<P5.MAX_SECTION_UPDATE_BUFFER_MS){let[v,l,c]=s.split(",").map(Number),d=[`${v-16},${l},${c}`,`${v+16},${l},${c}`,`${v},${l-i},${c}`,`${v},${l+i},${c}`,`${v},${l},${c-16}`,`${v},${l},${c+16}`],f=!1;for(let m of d)if(this.sectionsWaiting.has(m)&&!this.pendingSectionUpdates.has(m)&&this.sectionObjects[m]){f=!0;break}if(f)continue}r.push(s)}if(r.length!==0)for(let s of r){let o=this.pendingSectionUpdates.get(s);this.pendingSectionUpdates.delete(s),this.pendingSectionBufferStartTimes.delete(s);let a=o.key.split(","),v=`${a[0]},${a[2]}`;if(!this.loadedChunks[v]||!this.active){this.chunkMeshManager.releaseSection(o.key);continue}if(!o.geometry.positions.length){this.chunkMeshManager.releaseSection(o.key);continue}this.chunkMeshManager.updateSection(o.key,o.geometry),this.updatePosDataChunk(o.key)}}clearPendingSectionUpdatesForChunk(e,i){for(let r of[...this.pendingSectionUpdates.keys()])r.startsWith(`${e},`)&&r.endsWith(`,${i}`)&&(this.pendingSectionUpdates.delete(r),this.pendingSectionBufferStartTimes.delete(r))}handleWorkerMessage(e){if(e.type==="geometry"){let i=e.key.split(","),r=`${i[0]},${i[2]}`;if(!this.loadedChunks[r]||!this.active){this.pendingSectionUpdates.delete(e.key),this.pendingSectionBufferStartTimes.delete(e.key);return}if(this.sectionObjects[e.key]){this.pendingSectionUpdates.set(e.key,e),this.pendingSectionBufferStartTimes.has(e.key)||this.pendingSectionBufferStartTimes.set(e.key,performance.now());return}if(!e.geometry.positions.length){this.chunkMeshManager.releaseSection(e.key);return}this.chunkMeshManager.updateSection(e.key,e.geometry),this.updatePosDataChunk(e.key)}}getSignTexture(e,i,r,s=!1){let o=ye(e),a=this.chunkTextures.get(`${o[0]},${o[1]}`);a||(a={},this.chunkTextures.set(`${o[0]},${o[1]}`,a));let v=`${e.x},${e.y},${e.z}`;if(a[v])return a[v];let l=X4(this.version),c=t1(i,r,l);if(!c)return;let d=new Q.Texture(c);return d.magFilter=Q.NearestFilter,d.minFilter=Q.NearestFilter,d.needsUpdate=!0,a[v]=d,d}getCameraPosition(e){return(e??this._tmpCameraPos).set(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z)}getSectionCameraPosition(){let e=this.getCameraPosition();return new Dt(Math.floor(e.x/16),Math.floor(e.y/16),Math.floor(e.z/16))}updateCameraSectionPos(){let e=this.getSectionCameraPosition();this.cameraSectionPos.equals(e)||(this.cameraSectionPos=e,this.cameraSectionPositionUpdate())}setFirstPersonCamera(e,i,r){let s=this.playerStateReactive.eyeHeight;this.updateCamera(e?.offset(0,s,0)??null,i,r),this.updateCameraSectionPos()}getThirdPersonCamera(e,i,r){e??(e=new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z));let s=this.playerStateReactive.perspective==="third_person_back",o=4,a=this._tpDirection.set(0,0,-1),v=this._tpPitchQuat.setFromAxisAngle(this._tpAxisX,r),l=this._tpYawQuat.setFromAxisAngle(this._tpAxisY,i),c=this._tpFinalQuat.multiplyQuaternions(l,v);a.applyQuaternion(c),s&&a.multiplyScalar(-1),this.DEBUG_RAYCAST&&this.debugRaycast(e,a,o);let d=this._tpScenePos.set(this.sceneOrigin.toSceneX(e.x),this.sceneOrigin.toSceneY(e.y),this.sceneOrigin.toSceneZ(e.z)),f=this._tpRaycaster;f.set(d,a),f.far=o;let m=Object.values(this.sectionObjects).filter(w=>w.name==="chunk"&&w.visible).filter(w=>{let M=w.children.find(H=>H.name==="mesh");if(!M)return!1;let S=this._tpChunkWorldPos;return M.getWorldPosition(S),d.distanceTo(S)<80}),g=[];for(let w of m){let M=w.children.find(S=>S.name==="mesh");M&&g.push(M)}let b=f.intersectObjects(g,!1),A=o;return b.length>0&&(A=Math.max(.5,b[0].distance-.2)),new Dt(e.x+a.x*A,e.y+a.y*A,e.z+a.z*A)}debugRaycast(e,i,r){this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0);let s=new Q.Vector3(this.sceneOrigin.toSceneX(e.x),this.sceneOrigin.toSceneY(e.y),this.sceneOrigin.toSceneZ(e.z));this.debugRaycastHelper=new Q.ArrowHelper(i.clone().normalize(),s,r,16711680,r*.1,r*.05),this.realScene.add(this.debugRaycastHelper);let o=new Q.SphereGeometry(.2,8,8),a=new Q.MeshBasicMaterial({color:65280});this.debugHitPoint=new Q.Mesh(o,a),this.debugHitPoint.position.copy(s).add(i.clone().multiplyScalar(r)),this.realScene.add(this.debugHitPoint)}setCinimaticCamera(e,i,r){this.cameraWorldPos.x=e.x,this.cameraWorldPos.y=e.y,this.cameraWorldPos.z=e.z,this.sceneOrigin.update(e.x,e.y,e.z),this.cameraObject.position.set(0,0,0),this.cameraShake.setBaseRotation(r,i),this.updateCameraSectionPos()}setCinimaticFov(e){this.camera.fov=e,this.camera.updateProjectionMatrix()}updateCamera(e,i,r){if(!this.cinimaticScript.running){if(e){this.renderer.xr.isPresenting&&(e.y-=this.camera.position.y),this.currentPosTween?.stop();let s=this.displayOptions.inWorldRenderingConfig.instantCameraUpdate?0:this.playerStateUtils.isSpectatingEntity()?150:50;this.currentPosTween=new O0(this.cameraWorldPos).to({x:e.x,y:e.y,z:e.z},s).onUpdate(()=>{this.sceneOrigin.update(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraObject.position.set(0,0,0)}).start()}if(this.playerStateUtils.isSpectatingEntity()){let s=this.cameraShake.getBaseRotation(),o=0,a=Math.PI/2;s.yaw<a&&i>Math.PI+a?o=-Math.PI*2:i<a&&s.yaw>Math.PI+a&&(o=Math.PI*2),this.currentRotTween?.stop(),this.currentRotTween=new O0(s).to({pitch:r,yaw:i+o},100).onUpdate(v=>this.cameraShake.setBaseRotation(v.pitch,v.yaw-o)).start()}else{this.currentRotTween?.stop(),this.cameraShake.setBaseRotation(r,i);let{perspective:s}=this.playerStateReactive;if(s==="third_person_back"||s==="third_person_front"){let o=new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),a=this.getThirdPersonCamera(o,i,r),v=o.distanceTo(new Q.Vector3(a.x,a.y,a.z)),l=s==="third_person_back"?v:-v;this.camera.position.set(0,0,l),s==="third_person_front"?this.camera.rotation.set(0,Math.PI,0):this.camera.rotation.set(0,0,0)}else this.camera.position.z=0,this.camera.rotation.set(0,0,0),this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0)}this.updateCameraSectionPos()}}debugChunksVisibilityOverride(){let{chunksRenderAboveOverride:e,chunksRenderBelowOverride:i,chunksRenderDistanceOverride:r,chunksRenderAboveEnabled:s,chunksRenderBelowEnabled:o,chunksRenderDistanceEnabled:a}=this.reactiveDebugParams,v=this.getSectionHeight(),l=this.cameraSectionPos.y*v;if(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay&&e!==void 0||i!==void 0||r!==void 0)for(let[c,d]of Object.entries(this.sectionObjects)){if(d._waitingForChunkDisplay)continue;let[f,m,g]=c.split(",").map(Number),b=s&&e!==void 0?m<=l+e:o&&i!==void 0?m>=l-i:a&&r!==void 0?Math.abs(m-l)<=r:!0;d.visible=b}else this.chunkMeshManager.updateSectionsVisibility()}render(e=!1){if(this.currentRenderedFrames++,this.reactiveDebugParams.stopRendering)return;this.debugChunksVisibilityOverride();let i=performance.now();this.lastRendered=performance.now();let r=this.lastRenderTime>0?Math.min(Math.max((i-this.lastRenderTime)/1e3,0),.1):1/60;this.lastRenderTime=i,this.cursorBlock.render(),this.updateSectionOffsets();let s=this.getCameraPosition();if(this.skyboxRenderer.update(s,this.viewDistance),e||this.displayOptions.inWorldRenderingConfig.fov!==this.camera.fov){let d=this.renderer.getSize(new Q.Vector2);this.camera.aspect=d.width/d.height,this.camera.fov=this.displayOptions.inWorldRenderingConfig.fov,this.camera.updateProjectionMatrix()}let a=0;if(!this.reactiveDebugParams.disableEntities){let d=performance.now();this.entities.render(),a=performance.now()-d}let v=this.cameraGroupVr instanceof Q.Group?this.cameraGroupVr.children.find(d=>d instanceof Q.PerspectiveCamera):this.camera;this.applyPendingSectionUpdates(),this.renderer.render(this.scene,v),this.displayOptions.inWorldRenderingConfig.showHand&&this.playerStateReactive.gameMode!=="spectator"&&this.playerStateReactive.perspective==="first_person"&&!this.renderer.xr.isPresenting&&(this.holdingBlock.render(this.camera,this.renderer,this.ambientLight,this.directionalLight),this.holdingBlockLeft.render(this.camera,this.renderer,this.ambientLight,this.directionalLight));for(let d of this.fountains)this.sectionObjects[d.sectionId]&&!this.sectionObjects[d.sectionId].foutain&&(d.createParticles(this.sectionObjects[d.sectionId]),this.sectionObjects[d.sectionId].foutain=!0),d.render();this.waypoints.render(),this.fireworks.update();for(let d of this.onRender)d(r);let c=performance.now()-i;this.worldRendererConfig.autoLowerRenderDistance&&this.chunkMeshManager.recordRenderTime(c),this.renderTimeAvgCount++,this.renderTimeAvg=(this.renderTimeAvg*(this.renderTimeAvgCount-1)+c)/this.renderTimeAvgCount,this.renderTimeMax=Math.max(this.renderTimeMax,c),this.performanceMonitor.onFrame({totalMs:c,entitiesMs:a,loadedTextureCount:this.renderer.info.memory.textures,fps:this.lastFps})}renderHead(e,i,r,s){let o;if(s.SkullOwner?o=s.SkullOwner.Properties?.textures?.[0]?.Value:o=s.profile?.properties?.find(a=>a.name==="textures")?.value,!!o)try{let v=JSON.parse(F.from(o,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:l}=this.worldRendererConfig;l&&(v=v?.replace("http://textures.minecraft.net/",l).replace("https://textures.minecraft.net/",l));let c=Bt(this,v,It.head),d=new Q.Group;return r&&c.position.set(0,.3125,.3125),c.position.y-=23/16,d.add(c),this.sceneOrigin.track(d),d.position.set(e.x+.5,e.y+.045,e.z+.5),d.rotation.set(0,-Q.MathUtils.degToRad(i*(r?90:45/2)),0),d.scale.set(.8,.8,.8),d}catch{}}renderSign(e,i,r,s,o){let a=this.getSignTexture(e,o,s);if(!a)return;let v=new Q.Mesh(new Q.PlaneGeometry(1,1),new Q.MeshBasicMaterial({map:a,transparent:!0}));v.renderOrder=999;let l=7/16,c=s?1.3:1;v.scale.set(1*c,l*c,1*c);let d=(s?2:1.5)/16,f=.25/16;r&&!s?v.position.set(0,0,-.5+d+f+1e-4):v.position.set(0,0,d/2+1e-4);let m=new Q.Group;m.rotation.set(0,-Q.MathUtils.degToRad(i*(r?90:45/2)),0),m.add(v);let g=(s?10:8)/16,b=(s?0:r?4.333:9.333)/16,A=g/2+b;return this.sceneOrigin.track(m),m.position.set(e.x+.5,e.y+A,e.z+.5),m}lightUpdate(e,i){for(let r=this.worldSizeParams.minY;r<this.worldSizeParams.worldHeight;r+=16)this.setSectionDirty(new Dt(e,r,i))}rerenderAllChunks(){for(let e of Object.keys(this.sectionObjects)){let[i,r,s]=e.split(",").map(Number);this.setSectionDirty(new Dt(i,r,s))}}updateShowChunksBorder(e){this.chunkMeshManager.updateAllBoxHelpers(e)}resetWorld(){super.resetWorld(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.chunkMeshManager=new C5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0)}getLoadedChunksRelative(e,i=!1){let[r,s,o]=hi(e);return Object.fromEntries(Object.entries(this.sectionObjects).map(([a,v])=>{let[l,c,d]=a.split(",").map(Number),[f,m,g]=hi({x:l,y:c,z:d});return[i?`${f-r},${m-s},${g-o}`:`${f-r},${g-o}`,v]}))}cleanChunkTextures(e,i){let r=this.chunkTextures.get(`${Math.floor(e/16)},${Math.floor(i/16)}`)??{};for(let s of Object.keys(r))r[s].dispose(),delete r[s];this.chunkMeshManager.cleanSignChunkTextures(e,i)}readdChunks(){for(let e of Object.keys(this.sectionObjects))this.scene.remove(this.sectionObjects[e]);setTimeout(()=>{for(let e of Object.keys(this.sectionObjects))this.scene.add(this.sectionObjects[e])},500)}disableUpdates(e=this.scene.children){for(let i of e)i.matrixWorldNeedsUpdate=!1,this.disableUpdates(i.children??[])}removeColumn(e,i){super.removeColumn(e,i),this.cleanChunkTextures(e,i),this.clearPendingSectionUpdatesForChunk(e,i);let r=this.getSectionHeight(),s=this.worldMinYRender;for(let o=s;o<this.worldSizeParams.worldHeight;o+=r){let a=`${e},${o},${i}`;this.chunkMeshManager.sectionObjects[a]&&this.chunkMeshManager.releaseSection(a)}this.chunkMeshManager.onChunkRemovedFromGate(`${e},${i}`)}onViewerChunkPositionChanged(){this.chunkMeshManager.tryRevealPending()}setSectionDirty(...e){let[i]=e;this.cleanChunkTextures(i.x,i.z),super.setSectionDirty(...e)}static getRendererInfo(e){try{let i=e.getContext();return`${i.getParameter(i.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)}`}catch{}}worldStop(){this.media.onWorldStop()}destroy(){this.performanceMonitor?.reset(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.disposeModules(),this.fireworksLegacy.destroy(),super.destroy(),this.skyboxRenderer.dispose(),this.fireworks.dispose()}shouldObjectVisible(e){let r=this.getSectionHeight(),s,o,a,v=this.sceneOrigin.getWorldPosition(e);v?(s=v.x,o=v.y,a=v.z):(s=this.sceneOrigin.toWorldX(e.position.x),o=this.sceneOrigin.toWorldY(e.position.y),a=this.sceneOrigin.toWorldZ(e.position.z));let l=Math.floor(s/16)*16,c=Math.floor(a/16)*16,d=Math.floor(o/r)*r,f=`${l},${c}`,m=`${l},${d},${c}`;return!!this.finishedChunks[f]||!!this.sectionObjects[m]}handleUserClick(e){this.media.handleUserClick(e)}updateSectionOffsets(){let e=performance.now();for(let[i,r]of Object.entries(this.sectionsOffsetsAnimations)){let s=(e-r.time)/1e3;r.time=e,r.currentOffsetX+=r.speedX*s,r.currentOffsetY+=r.speedY*s,r.currentOffsetZ+=r.speedZ*s,r.limitX!==void 0&&(r.speedX>0?r.currentOffsetX=Math.min(r.currentOffsetX,r.limitX):r.currentOffsetX=Math.max(r.currentOffsetX,r.limitX)),r.limitY!==void 0&&(r.speedY>0?r.currentOffsetY=Math.min(r.currentOffsetY,r.limitY):r.currentOffsetY=Math.max(r.currentOffsetY,r.limitY)),r.limitZ!==void 0&&(r.speedZ>0?r.currentOffsetZ=Math.min(r.currentOffsetZ,r.limitZ):r.currentOffsetZ=Math.max(r.currentOffsetZ,r.limitZ));let o=this.sectionObjects[i];o&&(o.position.set(r.currentOffsetX,r.currentOffsetY,r.currentOffsetZ),o.updateMatrix())}}reloadWorld(){this.entities.reloadEntities()}};u(P5,"MAX_SECTION_UPDATE_BUFFER_MS",500);var oe=P5;x();R();T();k();x();R();T();k();var ze="1.21.4";x();R();T();k();function ae(n,t){n.aspect=t.width/t.height,n.updateProjectionMatrix()}x();R();T();k();x();R();T();k();var ht={mode:"futuristic",minecraftTextures:!0,futuristicScene:"light",futuristicCamera:"dive",futuristicBlockGroup:"stainedGlass",futuristicCameraSpeedPercent:80,futuristicBlockSpeedPercent:40},Q1=n=>n/100,B5={camera:Q1(ht.futuristicCameraSpeedPercent),block:Q1(ht.futuristicBlockSpeedPercent)};function Hr(n,t=!1){return n?.mode?n.mode:t?"worldBlocks":ht.mode}x();R();T();k();x();R();T();k();x();R();T();k();x();R();T();k();function Fr(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}var xt=[],De=!1,ve,K1=-1;function $4(){!De||!ve||(De=!1,ve.length?xt=ve.concat(xt):K1=-1,xt.length&&Yo())}function Yo(){if(!De){var n=setTimeout($4,0);De=!0;for(var t=xt.length;t;){for(ve=xt,xt=[];++K1<t;)ve&&ve[K1].run();K1=-1,t=xt.length}ve=null,De=!1,clearTimeout(n)}}function tv(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];xt.push(new Qo(n,t)),xt.length===1&&!De&&setTimeout(Yo,0)}function Qo(n,t){this.fun=n,this.array=t}Qo.prototype.run=function(){this.fun.apply(null,this.array)};var ev="browser",iv="x64",rv="browser",nv={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},sv=["/usr/bin/node"],ov=[],av="v16.8.0",vv={},lv=function(n,t){},cv=function(n){Fr("binding")},dv=function(n){return 0},uv=function(){return"/"},fv=function(n){},hv={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};function K0(){}var mv=K0,pv=[];function gv(n){Fr("_linkedBinding")}var bv={},yv=!1,_v={};function wv(n){Fr("dlopen")}function Av(){return[]}function Ev(){return[]}var xv=K0,Rv=K0,Lr=function(){return{}},kv=Lr,Tv=Lr,Mv=K0,Sv=K0,Cv=K0,Pv={};function Bv(n,t){if(!n)throw new Error(t||"assertion error")}var Iv={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Hv=K0,Ov=K0;function zv(){return!1}var Dv=K0,Fv=K0,Lv=K0,Uv=K0,Gv=K0,Nv=void 0,Wv=void 0,Vv=void 0,jv=K0,Yv=2,Qv=1,Kv="/bin/usr/node",Jv=9229,qv="node",Zv=[],Xv=K0,Ft={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Ft.now===void 0&&(Or=Date.now(),Ft.timing&&Ft.timing.navigationStart&&(Or=Ft.timing.navigationStart),Ft.now=()=>Date.now()-Or);var Or;function $v(){return Ft.now()/1e3}var zr=1e9;function Dr(n){var t=Math.floor((Date.now()-Ft.now())*.001),e=Ft.now()*.001,i=Math.floor(e)+t,r=Math.floor(e%1*1e9);return n&&(i=i-n[0],r=r-n[1],r<0&&(i--,r+=zr)),[i,r]}Dr.bigint=function(n){var t=Dr(n);return typeof BigInt>"u"?t[0]*zr+t[1]:BigInt(t[0]*zr)+BigInt(t[1])};var t9=10,e9={},i9=0;function Lt(){return Ur}var r9=Lt,n9=Lt,s9=Lt,o9=Lt,a9=Lt,v9=K0,l9=Lt,c9=Lt;function d9(n){return[]}var Ur={version:av,versions:vv,arch:iv,platform:rv,release:hv,_rawDebug:mv,moduleLoadList:pv,binding:cv,_linkedBinding:gv,_events:e9,_eventsCount:i9,_maxListeners:t9,on:Lt,addListener:r9,once:n9,off:s9,removeListener:o9,removeAllListeners:a9,emit:v9,prependListener:l9,prependOnceListener:c9,listeners:d9,domain:bv,_exiting:yv,config:_v,dlopen:wv,uptime:$v,_getActiveRequests:Av,_getActiveHandles:Ev,reallyExit:xv,_kill:Rv,cpuUsage:Lr,resourceUsage:kv,memoryUsage:Tv,kill:Mv,exit:Sv,openStdin:Cv,allowedNodeEnvironmentFlags:Pv,assert:Bv,features:Iv,_fatalExceptions:Hv,setUncaughtExceptionCaptureCallback:Ov,hasUncaughtExceptionCaptureCallback:zv,emitWarning:lv,nextTick:tv,_tickCallback:Dv,_debugProcess:Fv,_debugEnd:Lv,_startProfilerIdleNotifier:Uv,_stopProfilerIdleNotifier:Gv,stdout:Nv,stdin:Vv,stderr:Wv,abort:jv,umask:dv,chdir:fv,cwd:uv,env:nv,title:ev,argv:sv,execArgv:ov,pid:Yv,ppid:Qv,execPath:Kv,debugPort:Jv,hrtime:Dr,argv0:qv,_preload_modules:Zv,setSourceMapsEnabled:Xv};var Gr={},Ko=!1;function u9(){if(Ko)return Gr;Ko=!0;var n=Ur;function t(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function e(s,o){for(var a="",v=0,l=-1,c=0,d,f=0;f<=s.length;++f){if(f<s.length)d=s.charCodeAt(f);else{if(d===47)break;d=47}if(d===47){if(!(l===f-1||c===1))if(l!==f-1&&c===2){if(a.length<2||v!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",v=0):(a=a.slice(0,m),v=a.length-1-a.lastIndexOf("/")),l=f,c=0;continue}}else if(a.length===2||a.length===1){a="",v=0,l=f,c=0;continue}}o&&(a.length>0?a+="/..":a="..",v=2)}else a.length>0?a+="/"+s.slice(l+1,f):a=s.slice(l+1,f),v=f-l-1;l=f,c=0}else d===46&&c!==-1?++c:c=-1}return a}function i(s,o){var a=o.dir||o.root,v=o.base||(o.name||"")+(o.ext||"");return a?a===o.root?a+v:a+s+v:v}var r={resolve:function(){for(var o="",a=!1,v,l=arguments.length-1;l>=-1&&!a;l--){var c;l>=0?c=arguments[l]:(v===void 0&&(v=n.cwd()),c=v),t(c),c.length!==0&&(o=c+"/"+o,a=c.charCodeAt(0)===47)}return o=e(o,!a),a?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(t(o),o.length===0)return".";var a=o.charCodeAt(0)===47,v=o.charCodeAt(o.length-1)===47;return o=e(o,!a),o.length===0&&!a&&(o="."),o.length>0&&v&&(o+="/"),a?"/"+o:o},isAbsolute:function(o){return t(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,a=0;a<arguments.length;++a){var v=arguments[a];t(v),v.length>0&&(o===void 0?o=v:o+="/"+v)}return o===void 0?".":r.normalize(o)},relative:function(o,a){if(t(o),t(a),o===a||(o=r.resolve(o),a=r.resolve(a),o===a))return"";for(var v=1;v<o.length&&o.charCodeAt(v)===47;++v);for(var l=o.length,c=l-v,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var f=a.length,m=f-d,g=c<m?c:m,b=-1,A=0;A<=g;++A){if(A===g){if(m>g){if(a.charCodeAt(d+A)===47)return a.slice(d+A+1);if(A===0)return a.slice(d+A)}else c>g&&(o.charCodeAt(v+A)===47?b=A:A===0&&(b=0));break}var _=o.charCodeAt(v+A),w=a.charCodeAt(d+A);if(_!==w)break;_===47&&(b=A)}var M="";for(A=v+b+1;A<=l;++A)(A===l||o.charCodeAt(A)===47)&&(M.length===0?M+="..":M+="/..");return M.length>0?M+a.slice(d+b):(d+=b,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(o){return o},dirname:function(o){if(t(o),o.length===0)return".";for(var a=o.charCodeAt(0),v=a===47,l=-1,c=!0,d=o.length-1;d>=1;--d)if(a=o.charCodeAt(d),a===47){if(!c){l=d;break}}else c=!1;return l===-1?v?"/":".":v&&l===1?"//":o.slice(0,l)},basename:function(o,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');t(o);var v=0,l=-1,c=!0,d;if(a!==void 0&&a.length>0&&a.length<=o.length){if(a.length===o.length&&a===o)return"";var f=a.length-1,m=-1;for(d=o.length-1;d>=0;--d){var g=o.charCodeAt(d);if(g===47){if(!c){v=d+1;break}}else m===-1&&(c=!1,m=d+1),f>=0&&(g===a.charCodeAt(f)?--f===-1&&(l=d):(f=-1,l=m))}return v===l?l=m:l===-1&&(l=o.length),o.slice(v,l)}else{for(d=o.length-1;d>=0;--d)if(o.charCodeAt(d)===47){if(!c){v=d+1;break}}else l===-1&&(c=!1,l=d+1);return l===-1?"":o.slice(v,l)}},extname:function(o){t(o);for(var a=-1,v=0,l=-1,c=!0,d=0,f=o.length-1;f>=0;--f){var m=o.charCodeAt(f);if(m===47){if(!c){v=f+1;break}continue}l===-1&&(c=!1,l=f+1),m===46?a===-1?a=f:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||l===-1||d===0||d===1&&a===l-1&&a===v+1?"":o.slice(a,l)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return i("/",o)},parse:function(o){t(o);var a={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return a;var v=o.charCodeAt(0),l=v===47,c;l?(a.root="/",c=1):c=0;for(var d=-1,f=0,m=-1,g=!0,b=o.length-1,A=0;b>=c;--b){if(v=o.charCodeAt(b),v===47){if(!g){f=b+1;break}continue}m===-1&&(g=!1,m=b+1),v===46?d===-1?d=b:A!==1&&(A=1):d!==-1&&(A=-1)}return d===-1||m===-1||A===0||A===1&&d===m-1&&d===f+1?m!==-1&&(f===0&&l?a.base=a.name=o.slice(1,m):a.base=a.name=o.slice(f,m)):(f===0&&l?(a.name=o.slice(1,d),a.base=o.slice(1,m)):(a.name=o.slice(f,d),a.base=o.slice(f,m)),a.ext=o.slice(d,m)),f>0?a.dir=o.slice(0,f-1):l&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Gr=r,Gr}var J0=u9();var ET=J0._makeLong,xT=J0.basename,RT=J0.delimiter,kT=J0.dirname,TT=J0.extname,MT=J0.format,ST=J0.isAbsolute,Nr=J0.join,CT=J0.normalize,PT=J0.parse,BT=J0.posix,IT=J0.relative,HT=J0.resolve,OT=J0.sep,zT=J0.win32;import*as a0 from"three";var Wr=new Date,Jo=Wr.getMonth()===11&&Wr.getDate()>=24&&Wr.getDate()<=26,f9=["panorama_3.webp","panorama_1.webp","panorama_4.webp","panorama_5.webp","panorama_0.webp","panorama_2.webp"],h9=200,Fe=class{constructor(t){this.documentRenderer=t;u(this,"scene");u(this,"camera");u(this,"startTimes",new Map);u(this,"time",0);u(this,"panoramaGroup",null);this.scene=new a0.Scene,this.scene.background=new a0.Color(3294568);let e=new a0.AmbientLight(13421772);this.scene.add(e);let i=new a0.DirectionalLight(16777215,.5);i.position.set(1,1,.5).normalize(),i.castShadow=!0,this.scene.add(i),this.camera=new a0.PerspectiveCamera(85,t.canvas.width/t.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}async init(){this.buildCubemap()}update(t,e){e&&ae(this.camera,this.documentRenderer.canvas)}dispose(){this.scene.clear(),this.panoramaGroup=null,this.startTimes.clear()}buildCubemap(){let t=new a0.BoxGeometry(1e3,1e3,1e3),e=[];for(let s of f9)(async()=>{let{texture:a}=s1(Nr("background",Jo?"christmas":"",s));a.matrixAutoUpdate=!1,a.matrix.set(-1,0,1,0,1,0,0,0,1),a.wrapS=a0.ClampToEdgeWrapping,a.wrapT=a0.ClampToEdgeWrapping,a.minFilter=a0.LinearFilter,a.magFilter=a0.LinearFilter;let v=new a0.MeshBasicMaterial({map:a,transparent:!0,side:a0.DoubleSide,depthWrite:!1,opacity:0});this.startTimes.set(v,Date.now()),e.push(v)})();let i=new a0.Mesh(t,e);i.onBeforeRender=()=>{this.time+=.01,i.rotation.y=Math.PI+this.time*.01,i.rotation.z=Math.sin(-this.time*.001)*.001;for(let s of e){let o=this.startTimes.get(s);if(o){let a=Date.now()-o;s.opacity=Math.min(1,a/h9)}}};let r=new a0.Object3D;if(r.add(i),!Jo)for(let s=0;s<20;s++){let o=new Et("1.16.4","squid").mesh;o.position.set(Math.random()*30-15,Math.random()*20-10,Math.random()*10-17),o.rotation.set(0,Math.PI+Math.random(),-Math.PI/4,"ZYX");let a=Math.random()*.01;o.children[0].onBeforeRender=()=>{o.rotation.y+=a,o.rotation.z=Math.cos(i.rotation.y*3)*Math.PI/4-Math.PI/2},r.add(o)}this.scene.add(r),this.panoramaGroup=r}async debugImageInFrontOfCamera(){let t=await St(Nr("background","panorama_0.webp")),e=new a0.Mesh(new a0.PlaneGeometry(1e3,1e3),new a0.MeshBasicMaterial({map:t}));e.position.set(0,0,-500),this.scene.add(e)}};x();R();T();k();import*as V from"three";var I5=["galaxy","nether","end","cyber","light"],H5=["cruise","barrel","dive","orbit","snake"],Z1={galaxy:"Galaxy",nether:"Nether",end:"The End",cyber:"Cyber",light:"Light Space"},X1={cruise:"Cruise",barrel:"Barrel",dive:"Dive",orbit:"Orbit",snake:"Snake"},qo=.1,jr={mixed:["white_wool","cyan_wool","blue_wool","purple_wool","white_stained_glass","cyan_stained_glass","blue_stained_glass","purple_stained_glass","glowstone","sea_lantern","amethyst_block","copper_block","gold_block","diamond_block"],stainedGlass:["white_stained_glass","orange_stained_glass","magenta_stained_glass","light_blue_stained_glass","yellow_stained_glass","lime_stained_glass","pink_stained_glass","gray_stained_glass","light_gray_stained_glass","cyan_stained_glass","purple_stained_glass","blue_stained_glass","brown_stained_glass","green_stained_glass","red_stained_glass","black_stained_glass"],wool:["white_wool","orange_wool","magenta_wool","light_blue_wool","yellow_wool","lime_wool","pink_wool","gray_wool","light_gray_wool","cyan_wool","purple_wool","blue_wool","brown_wool","green_wool","red_wool","black_wool"],construction:["copper_block","exposed_copper","weathered_copper","oxidized_copper","cut_copper","exposed_cut_copper","weathered_cut_copper","oxidized_cut_copper","iron_block","gold_block","diamond_block","emerald_block","netherite_block","lapis_block","redstone_block","coal_block","quartz_block","amethyst_block","bricks","stone_bricks","deepslate_bricks","polished_blackstone"],glow:["glowstone","sea_lantern","shroomlight","ochre_froglight","verdant_froglight","pearlescent_froglight","redstone_lamp","beacon"],world:["grass_block","podzol","mycelium","dirt","coarse_dirt","rooted_dirt","mud","clay","stone","cobblestone","mossy_cobblestone","deepslate","cobbled_deepslate","tuff","calcite","sand","red_sand","gravel","snow_block","coal_ore","deepslate_coal_ore","iron_ore","deepslate_iron_ore","copper_ore","deepslate_copper_ore","gold_ore","deepslate_gold_ore","diamond_ore","deepslate_diamond_ore","emerald_ore","deepslate_emerald_ore","lapis_ore","deepslate_lapis_ore","redstone_ore","deepslate_redstone_ore","nether_gold_ore","ancient_debris","oak_log","birch_log","spruce_log","jungle_log","acacia_log","dark_oak_log","mangrove_log","cherry_log","netherrack","soul_sand","basalt","end_stone"]},O5=["mixed","stainedGlass","wool","construction","glow","world"],$1={mixed:"Mixed",stainedGlass:"Stained glass",wool:"Wool",construction:"Construction",glow:"Glow",world:"World (grass & ores)"},Zo={galaxy:{bg:132114,fog:132114,fogD:.011,blocks:[61695,54527,47359,59647,2280703,43263],emit:[13158,8789,6724],nebula:[4403,1114146,4386],galFn:n=>new V.Color(n*.05,n*.2,n),ambient:264216,dir:3368703,pt1:43775,pt2:16729343,name:"GALAXY"},nether:{bg:917760,fog:917760,fogD:.016,blocks:[16720384,16737792,16750848,13373696,16729122,16755200],emit:[2230272,1114112,3346688],nebula:[1704960,851968,1705984],galFn:n=>new V.Color(n,n*.15,0),ambient:1573376,dir:16724736,pt1:16729088,pt2:16755200,name:"NETHER"},end:{bg:0,fog:0,fogD:.009,blocks:[7807658,11158732,5570679,14527231,3342421,12299007],emit:[655381,1572901,327696],nebula:[524312,851989,262158],galFn:n=>new V.Color(n*.4,0,n),ambient:393232,dir:10040319,pt1:11158783,pt2:4456618,name:"THE END"},cyber:{bg:2566,fog:2566,fogD:.01,blocks:[65535,65416,11206400,52479,6749952,65518],emit:[8721,6656,6690],nebula:[6674,5120,4634],galFn:n=>new V.Color(0,n,n*.6),ambient:6669,dir:65450,pt1:65484,pt2:4521728,name:"CYBER"},light:{bg:8951984,fog:7899296,fogD:.006,gradientBg:{top:14214392,mid:10531016,bottom:6846608,radial:!0},blocks:[15266559,13691135,12114175,10537208,8960240,7383272,10012927,12640511,15792383,7909608,14216447,14739711],emit:[6854864,8958176,11061488,12638456],nebula:[9480392,11059424,12637420,14215416,7901360],galFn:n=>{let t=new V.Color;return n<.4?t.lerpColors(new V.Color(16054527),new V.Color(14215423),n/.4):n<.75?t.lerpColors(new V.Color(14215423),new V.Color(11061488),(n-.4)/.35):t.lerpColors(new V.Color(11061488),new V.Color(9482464),(n-.75)/.25),t},ambient:7899296,dir:13688040,pt1:11061503,pt2:13162751,name:"LIGHT",starColor:15266047,starOpacity:.5,galaxyOpacity:.7,nebulaOpacity:.32,edgeLineColor:10010856,blockOpacity:[.42,.56]}},m9={cruise:{pos:(n,t,e)=>({x:Math.sin(n*.28)*18+Math.cos(n*.11)*7+t*10,y:Math.sin(n*.19)*6+Math.cos(n*.31)*3+e*6,z:0}),look:(n,t,e)=>({x:Math.sin((n+.18)*.28)*18+t*8,y:Math.sin((n+.18)*.19)*6+e*4,z:-25}),roll:(n,t=0)=>t*.05+Math.sin(n*.22)*.015,spd:.18},barrel:{pos:(n,t,e)=>{let r=n*2.4;return{x:Math.cos(r)*10+t*4,y:Math.sin(r)*10+e*4,z:Math.sin(n*.4)*8}},look:n=>({x:Math.sin(n*.5)*5,y:Math.cos(n*.5)*5,z:-30}),roll:n=>n*2.4+Math.PI*.5,spd:.24},dive:{pos:(n,t,e)=>({x:Math.sin(n*.6)*30+t*8,y:Math.cos(n*.4)*18+e*6,z:Math.sin(n*.3)*12}),look:(n,t,e)=>({x:Math.sin(n*.6+.2)*30+t*6,y:Math.cos(n*.4+.2)*18-8+e*4,z:-35}),roll:(n,t=0)=>t*.08+Math.sin(n*.6)*.12,spd:.3},orbit:{pos:(n,t,e)=>({x:Math.cos(n*.5)*20+t*5,y:Math.sin(n*.25)*10+e*5,z:Math.sin(n*.5)*20}),look:()=>({x:0,y:0,z:-60}),roll:n=>Math.sin(n*.5)*.08,spd:.15},snake:{pos:(n,t,e)=>({x:Math.sin(n*1.1)*22+Math.sin(n*.37)*8+t*10,y:Math.sin(n*.7)*10+t*4+e*8,z:0}),look:(n,t,e)=>{let i=n+.12;return{x:Math.sin(i*1.1)*22+Math.sin(i*.37)*8+t*8,y:Math.sin(i*.7)*10+e*6,z:-22}},roll:(n,t=0)=>t*.1+Math.sin(n*1.1)*.06,spd:.22}},p9={cruise:1,barrel:1.6,dive:2.2,orbit:.7,snake:1.4},g9=250,J1=1e4,q1=3e3,Le=n=>n[Math.floor(Math.random()*n.length)],Vr=n=>"#"+n.toString(16).padStart(6,"0"),Xo=n=>{if(typeof document>"u")return null;let t=document.createElement("canvas");t.width=4,t.height=512;let e=t.getContext("2d");if(!e)return null;let i=t.width,r=t.height,s=n.radial?e.createRadialGradient(i/2,r*.32,0,i/2,r*.32,r*.85):e.createLinearGradient(0,0,0,r);s.addColorStop(0,Vr(n.top)),n.mid!=null&&s.addColorStop(.45,Vr(n.mid)),s.addColorStop(1,Vr(n.bottom)),e.fillStyle=s,e.fillRect(0,0,i,r);let o=new V.CanvasTexture(t);return o.needsUpdate=!0,o},le=class{constructor(t,e={},i){this.documentRenderer=t;this.abortSignal=i;u(this,"scene");u(this,"camera");u(this,"ambient");u(this,"dir");u(this,"pt1");u(this,"pt2");u(this,"blocks",[]);u(this,"bGroup",new V.Group);u(this,"galaxy");u(this,"nebula");u(this,"stars");u(this,"galGeo");u(this,"nebGeo");u(this,"bGeo",new V.BoxGeometry(1,1,1));u(this,"eGeo",new V.EdgesGeometry(this.bGeo));u(this,"curScene");u(this,"curCam");u(this,"blockGroup");u(this,"cameraSpeed");u(this,"blockSpeed");u(this,"camT",0);u(this,"mx",0);u(this,"my",0);u(this,"tmx",0);u(this,"tmy",0);u(this,"transitioning",!1);u(this,"useMinecraftTextures",!1);u(this,"resourcesManager");u(this,"atlasTexture",null);u(this,"blockMaterialPool",new Map);u(this,"gradientSky",null);u(this,"gradientSkyTexture",null);u(this,"disposed",!1);u(this,"animTime",0);let r=ht;this.curScene=e.initialScene??r.futuristicScene,this.curCam=e.initialCamera??r.futuristicCamera,this.blockGroup=e.initialBlockGroup??r.futuristicBlockGroup,this.cameraSpeed=e.initialCameraSpeed??B5.camera,this.blockSpeed=e.initialBlockSpeed??B5.block,this.useMinecraftTextures=e.useMinecraftTextures??r.minecraftTextures,this.resourcesManager=e.resourcesManager;let s=Zo[this.curScene];this.scene=new V.Scene,this.scene.fog=new V.FogExp2(s.fog,s.fogD),this.applyScenePalette(s),this.camera=new V.PerspectiveCamera(80,this.documentRenderer.canvas.width/this.documentRenderer.canvas.height,.1,700),this.ambient=new V.AmbientLight(s.ambient,2.5),this.scene.add(this.ambient),this.dir=new V.DirectionalLight(s.dir,4),this.dir.position.set(1,1,0),this.scene.add(this.dir),this.pt1=new V.PointLight(s.pt1,5,100),this.scene.add(this.pt1),this.pt2=new V.PointLight(s.pt2,4,80),this.pt2.position.set(30,20,-30),this.scene.add(this.pt2);for(let f=0;f<g9;f++)this.spawnBlock(s,!0);if(!this.useMinecraftTextures){let f=s.edgeLineColor??62975;for(let m=0;m<40;m++){let g=new V.LineBasicMaterial({color:f,transparent:!0,opacity:.25});Le(this.blocks).mesh.add(new V.LineSegments(this.eGeo,g))}}this.scene.add(this.bGroup);let o=new V.BufferGeometry,a=new Float32Array(5e3*3);for(let f=0;f<5e3*3;f++)a[f]=(Math.random()-.5)*500;o.setAttribute("position",new V.BufferAttribute(a,3)),this.stars=new V.Points(o,new V.PointsMaterial({color:s.starColor??16777215,size:.3,transparent:!0,opacity:s.starOpacity??.7,sizeAttenuation:!0})),this.scene.add(this.stars),this.galGeo=new V.BufferGeometry;let v=new Float32Array(J1*3),l=new Float32Array(J1*3);for(let f=0;f<J1;f++){let m=f%3,g=Math.random(),b=m/3*Math.PI*2+g*Math.PI*5,A=g*90+Math.random()*10,_=(1-g)*18;v[f*3]=Math.cos(b)*A+(Math.random()-.5)*_,v[f*3+1]=(Math.random()-.5)*7,v[f*3+2]=Math.sin(b)*A+(Math.random()-.5)*_-180;let w=.2+g*.8,M=s.galFn(w);l[f*3]=M.r,l[f*3+1]=M.g,l[f*3+2]=M.b}this.galGeo.setAttribute("position",new V.BufferAttribute(v,3)),this.galGeo.setAttribute("color",new V.BufferAttribute(l,3)),this.galaxy=new V.Points(this.galGeo,new V.PointsMaterial({size:.9,vertexColors:!0,transparent:!0,opacity:s.galaxyOpacity??.55,sizeAttenuation:!0})),this.scene.add(this.galaxy),this.nebGeo=new V.BufferGeometry;let c=new Float32Array(q1*3),d=new Float32Array(q1*3);for(let f=0;f<q1;f++){let m=25+Math.random()*110,g=Math.random()*Math.PI*2,b=(Math.random()-.5)*Math.PI*.5;c[f*3]=m*Math.cos(g)*Math.cos(b),c[f*3+1]=m*Math.sin(b)*.6,c[f*3+2]=m*Math.sin(g)*Math.cos(b)-80;let A=new V.Color(Le(s.nebula));d[f*3]=A.r,d[f*3+1]=A.g,d[f*3+2]=A.b}this.nebGeo.setAttribute("position",new V.BufferAttribute(c,3)),this.nebGeo.setAttribute("color",new V.BufferAttribute(d,3)),this.nebula=new V.Points(this.nebGeo,new V.PointsMaterial({size:3,vertexColors:!0,transparent:!0,opacity:s.nebulaOpacity??.3,sizeAttenuation:!0})),this.scene.add(this.nebula),this.addBackgroundTextPlane(),this.setupMouseTracking()}async init(){if(this.useMinecraftTextures)try{await this.loadMinecraftTextures()}catch{this.useMinecraftTextures=!1}}applyScenePalette(t){if(this.documentRenderer.renderer.setClearColor(t.bg),t.gradientBg)if(this.scene.background=null,this.gradientSky){if(this.gradientSky.visible=!0,this.gradientSkyTexture&&t.gradientBg){let s=Xo(t.gradientBg);s&&(this.gradientSkyTexture.dispose(),this.gradientSkyTexture=s,this.gradientSky.material.map=s,this.gradientSky.material.needsUpdate=!0)}}else{let s=Xo(t.gradientBg);s?(this.gradientSkyTexture=s,this.gradientSky=new V.Mesh(new V.PlaneGeometry(900,700),new V.MeshBasicMaterial({map:s,depthWrite:!1,side:V.DoubleSide})),this.gradientSky.position.set(0,0,-280),this.gradientSky.renderOrder=-1e3,this.scene.add(this.gradientSky)):this.scene.background=new V.Color(t.bg)}else this.scene.background=new V.Color(t.bg),this.gradientSky&&(this.gradientSky.visible=!1);this.scene.fog instanceof V.FogExp2&&(this.scene.fog.color.set(t.fog),this.scene.fog.density=t.fogD);let e=this.stars?.material;e&&(e.color.set(t.starColor??16777215),e.opacity=t.starOpacity??.7);let i=this.galaxy?.material;i&&(i.opacity=t.galaxyOpacity??.55);let r=this.nebula?.material;r&&(r.opacity=t.nebulaOpacity??.3)}setupMouseTracking(){let t=i=>{let r=typeof window<"u"?window.innerWidth:this.documentRenderer.canvas.width,s=typeof window<"u"?window.innerHeight:this.documentRenderer.canvas.height;this.tmx=(i.clientX/r-.5)*2,this.tmy=-(i.clientY/s-.5)*2};(typeof document<"u"?document:void 0)?.addEventListener("mousemove",t,{signal:this.abortSignal})}addBackgroundTextPlane(){let i=typeof document<"u"?document.createElement("canvas"):null;if(!i)return;i.width=2048,i.height=768;let r=i.getContext("2d");if(!r)return;r.clearRect(0,0,2048,768),r.save(),r.font="bold 560px Orbitron, sans-serif",r.textAlign="center",r.textBaseline="middle",r.shadowColor="rgba(0,200,255,0.35)",r.shadowBlur=80,r.fillStyle="rgba(255,255,255,0.055)",r.fillText("V2",2048*.28,768*.5),r.restore(),r.save(),r.font="bold 148px Orbitron, sans-serif",r.textAlign="center",r.textBaseline="middle",r.shadowColor="rgba(0,200,255,0.2)",r.shadowBlur=40,r.fillStyle="rgba(255,255,255,0.038)",r.fillText("by ZARDOY",2048*.72,768*.52),r.restore();let s=new V.CanvasTexture(i),o=new V.Mesh(new V.PlaneGeometry(280,105),new V.MeshBasicMaterial({map:s,transparent:!0,opacity:1,depthWrite:!1,side:V.DoubleSide,blending:V.AdditiveBlending}));o.position.set(8,4,-320),this.scene.add(o)}spawnBlock(t,e,i){let r=this.createBlockMaterial(t,i),s=new V.Mesh(this.bGeo,r),o=.3+Math.random()*3;s.scale.setScalar(o),s.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,e?-(Math.random()*140):-155-Math.random()*30),s.rotation.set(Math.random()*Math.PI*2,Math.random()*Math.PI*2,Math.random()*Math.PI*2);let a={mesh:s,spd:.04+Math.random()*.12,dx:(Math.random()-.5)*.012,dy:(Math.random()-.5)*.008,rx:(Math.random()-.5)*.012,ry:(Math.random()-.5)*.012,rz:(Math.random()-.5)*.01,minecraftBlockName:i};this.blocks.push(a),this.bGroup.add(s)}createBlockMaterial(t,e){if(this.useMinecraftTextures&&e){let s=this.blockMaterialPool.get(e);if(s)return s.clone()}let[i,r]=t.blockOpacity??[.32,.46];return new V.MeshBasicMaterial({color:Le(t.blocks),transparent:!0,opacity:i+Math.random()*(r-i),depthWrite:!1,blending:V.AdditiveBlending})}removeBlockEdgeLines(){for(let t of this.blocks){let e=t.mesh.children.filter(i=>i instanceof V.LineSegments);for(let i of e){t.mesh.remove(i),i.geometry?.dispose();let r=i.material;Array.isArray(r)?r.forEach(s=>s.dispose()):r.dispose()}}}async ensureMcDataLoaded(){let t=globalThis._LOAD_MC_DATA;t&&await t()}resolveBlockAtlasUv(t,e,i){let r=s=>{let o=e[s];return o?{u:o.u,v:o.v,su:o.su??i.suSv,sv:o.sv??i.suSv}:null};if(e[t])return r(t);for(let s of["_top","_side","_front","_0"]){let o=r(`${t}${s}`);if(o)return o}for(let s of Object.keys(e))if(s.startsWith(t))return r(s);return null}async loadMinecraftTextures(){await this.ensureMcDataLoaded();let t=this.resourcesManager??new lt;!t.currentResources?.blocksAtlasImage&&(t.currentConfig={...t.currentConfig,version:ze,noInventoryGui:!0},await t.updateAssetsData?.({}));let i=t.currentResources;if(!i?.blocksAtlasImage||!i.blocksAtlasJson)throw new Error("Block atlas not available");let r=i.blocksAtlasJson,s=r.textures;this.atlasTexture=s5(i.blocksAtlasImage),this.atlasTexture.flipY=!1,this.atlasTexture.needsUpdate=!0;for(let o of jr[this.blockGroup]){let a=this.resolveBlockAtlasUv(o,s,r);if(!a)continue;let v=this.atlasTexture.clone();v.flipY=!1,v.offset.set(a.u,a.v),v.repeat.set(a.su,a.sv),v.needsUpdate=!0;let l=o.includes("glass"),c=new V.MeshBasicMaterial({map:v,side:V.DoubleSide,transparent:l,opacity:l?.85:1,alphaTest:l?.08:0,depthWrite:!0,toneMapped:!1});this.blockMaterialPool.set(o,c)}if(this.blockMaterialPool.size===0)throw new Error("No block textures resolved from atlas (check block names vs atlas keys)");this.removeBlockEdgeLines();for(let o of this.blocks){let a=Le([...this.blockMaterialPool.keys()]);o.minecraftBlockName=a,o.mesh.material=this.blockMaterialPool.get(a).clone()}}setScene(t){if(!I5.includes(t)||t===this.curScene||this.transitioning)return;this.transitioning=!0,this.curScene=t;let e=Zo[t];setTimeout(()=>{if(this.disposed)return;this.applyScenePalette(e),this.ambient.color.set(e.ambient),this.dir.color.set(e.dir),this.pt1.color.set(e.pt1),this.pt2.color.set(e.pt2);for(let s of this.blocks)this.useMinecraftTextures&&s.minecraftBlockName||s.mesh.material instanceof V.MeshBasicMaterial&&s.mesh.material.color.set(Le(e.blocks));let i=this.nebGeo.attributes.color;for(let s=0;s<q1;s++){let o=new V.Color(Le(e.nebula));i.setXYZ(s,o.r,o.g,o.b)}i.needsUpdate=!0;let r=this.galGeo.attributes.color;for(let s=0;s<J1;s++){let o=.2+Math.random()*.8,a=e.galFn(o);r.setXYZ(s,a.r,a.g,a.b)}r.needsUpdate=!0,this.transitioning=!1},150)}setCamera(t){H5.includes(t)&&(this.curCam=t)}setCameraSpeed(t){this.cameraSpeed=Math.max(0,t)}setBlockSpeed(t){this.blockSpeed=Math.max(0,t)}async setBlockGroup(t){if(O5.includes(t)&&t!==this.blockGroup&&(this.blockGroup=t,!(!this.useMinecraftTextures||this.disposed))){for(let e of this.blockMaterialPool.values())e.map?.dispose(),e.dispose();this.blockMaterialPool.clear();try{await this.loadMinecraftTextures()}catch{}}}getSceneId(){return this.curScene}getCameraId(){return this.curCam}getBlockGroupId(){return this.blockGroup}update(t,e){e&&ae(this.camera,this.documentRenderer.canvas);let i=m9[this.curCam],r=this.cameraSpeed,s=this.blockSpeed;this.camT+=t*i.spd*r,this.mx+=(this.tmx-this.mx)*.05,this.my+=(this.tmy-this.my)*.05;let o=this.mx*qo,a=this.my*qo,v=i.pos(this.camT,o,a),l=i.look(this.camT,o,a);this.camera.position.set(v.x,v.y,v.z),this.camera.lookAt(l.x,l.y,l.z),this.camera.rotation.z=i.roll(this.camT,o);let c=p9[this.curCam]*s;this.animTime+=t*1e3*s;for(let d of this.blocks){if(d.mesh.position.z+=d.spd*c*60*t,d.mesh.position.x+=d.dx*60*t*s,d.mesh.position.y+=d.dy*60*t*s,d.mesh.rotation.x+=d.rx*c,d.mesh.rotation.y+=d.ry*c,d.mesh.rotation.z+=d.rz,!this.useMinecraftTextures&&d.mesh.material instanceof V.MeshBasicMaterial){let f=d.mesh.userData.baseOpacity??.38;d.mesh.userData.baseOpacity==null&&(d.mesh.userData.baseOpacity=f);let m=.88+Math.abs(Math.sin(this.animTime*8e-4+d.mesh.position.x*.3))*.12;d.mesh.material.opacity=f*m}d.mesh.position.z>this.camera.position.z+15&&d.mesh.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,this.camera.position.z-155-Math.random()*30)}this.pt1.position.set(Math.sin(this.camT*.8)*25+this.camera.position.x,Math.cos(this.camT*.6)*12+this.camera.position.y,this.camera.position.z-18),this.pt2.position.set(Math.cos(this.camT*.5)*20+this.camera.position.x,Math.sin(this.camT*.9)*15+this.camera.position.y,this.camera.position.z-30),this.galaxy.rotation.y+=t*.006*s,this.nebula.rotation.y-=t*.003*s,this.stars.rotation.y+=t*4e-4*s}dispose(){this.disposed=!0,this.scene.clear(),this.bGeo.dispose(),this.eGeo.dispose(),this.galGeo.dispose(),this.nebGeo.dispose(),this.gradientSkyTexture?.dispose(),this.atlasTexture?.dispose();for(let t of this.blockMaterialPool.values())t.map?.dispose(),t.dispose();this.blockMaterialPool.clear()}};x();R();T();k();import*as Ge from"three";import{Vec3 as t6}from"vec3";x();R();T();k();import b9 from"prismarine-world";import y9 from"prismarine-chunk";var $o=n=>{let t=b9(n),e=y9(n),i=new t(n).sync,r=_9(i);for(let s of r)if(s.startsWith("set")&&s!=="setColumn"){let o=i[s].bind(i);i[s]=(...a)=>{let v=a[0];v.x!==void 0&&!i.getColumnAt(v)&&i.setColumn(Math.floor(v.x/16),Math.floor(v.z/16),new e(void 0)),o(...a)}}return i};function _9(n){let t=new Set,e=n;do for(let i of Object.getOwnPropertyNames(e))typeof n[i]=="function"&&i!=="constructor"&&t.add(i);while(e=Object.getPrototypeOf(e));return[...t]}var Ue=class{constructor(t,e,i){this.documentRenderer=t;this.options=e;this.abortSignal=i;u(this,"_scene");u(this,"_camera");u(this,"worldRenderer");u(this,"WorldRendererClass",oe);this._scene=new Ge.Scene,this._scene.background=new Ge.Color(3294568),this._camera=new Ge.PerspectiveCamera(85,t.canvas.width/t.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}get scene(){return this._scene}get camera(){return this._camera}async init(){let t=ze,e=new lt;if(e.currentConfig={version:t,noInventoryGui:!0},await e.updateAssetsData?.({}),this.abortSignal.aborted)return;let i=$o(t),s=h6("prismarine-block")(t),a=globalThis.mcData.blocksArray.filter(m=>{if(!m.name.includes("stained_glass"))return!1;let g=s.fromStateId(m.defaultState,0);if(g.shapes?.length!==1)return!1;let b=g.shapes[0];return b[0]===0&&b[1]===0&&b[2]===0&&b[3]===1&&b[4]===1&&b[5]===1}),v=-15,l=100,c=100;for(let m=-l;m<l;m++)for(let g=-c;g<c;g++){let b=a[Math.floor(Math.random()*a.length)];i.setBlockStateId(new t6(m,g,v),b.defaultState)}this._camera.updateProjectionMatrix(),this._camera.position.set(.5,c/2+.5,.5),this._camera.rotation.set(0,0,0);let d=new t6(...this._camera.position.toArray()),f=new qt(i,2,d);this.abortSignal.aborted||(this.worldRenderer=new this.WorldRendererClass(this.documentRenderer.renderer,this.options,{version:t,worldView:f,inWorldRenderingConfig:qe,playerStateReactive:_2().reactive,rendererState:Yt().reactive,nonReactiveState:Yt().nonReactive,resourcesManager:e}),this.worldRenderer instanceof oe&&(this._scene=this.worldRenderer.realScene,this._camera=this.worldRenderer.camera),f.init(d),await this.worldRenderer.waitForChunksToRender(),!this.abortSignal.aborted&&this.setupMouseParallax())}update(t,e){e&&ae(this.camera,this.documentRenderer.canvas)}dispose(){this.worldRenderer?.destroy(),this.worldRenderer=void 0,this._scene.clear()}setupMouseParallax(){let t=this._camera,e=t.position.x,i=t.position.y,r;document.body.addEventListener("pointermove",s=>{if(s.pointerType!=="mouse")return;let o=.2,a=s.clientX/window.innerWidth-.5,v=-(s.clientY/window.innerHeight-.5);r?.stop(),r=new O0(t.position).to({x:e+a*o,y:i+v*o},0),r.start(),t.updateProjectionMatrix()},{signal:this.abortSignal})}};x();R();T();k();import*as e6 from"three";var Ne=class{constructor(t,e,i={},r=!1){this.documentRenderer=t;this.options=e;u(this,"active");u(this,"abortController",new AbortController);u(this,"mode");u(this,"lastFrameTime",0);this.mode=Hr(i,r)}get futuristic(){return this.active instanceof le?this.active:void 0}get scene(){return this.active?.scene}get camera(){return this.active?.camera}async start(t={}){this.active=this.createImplementation(t),await this.active.init(),this.active.scene.background instanceof e6.Color&&this.documentRenderer.renderer.setClearColor(this.active.scene.background),this.lastFrameTime=performance.now(),this.documentRenderer.render=(e=!1)=>{let i=performance.now(),r=Math.min((i-this.lastFrameTime)/1e3,.05);this.lastFrameTime=i;let s=this.active;s&&(s.update(r,e),this.documentRenderer.renderer.render(s.scene,s.camera))}}createImplementation(t){switch(this.mode){case"futuristic":return new le(this.documentRenderer,{useMinecraftTextures:t.useMinecraftTextures,initialScene:t.futuristicScene,initialCamera:t.futuristicCamera,initialBlockGroup:t.futuristicBlockGroup,initialCameraSpeed:t.futuristicCameraSpeed,initialBlockSpeed:t.futuristicBlockSpeed,resourcesManager:t.resourcesManager},this.abortController.signal);case"worldBlocks":return new Ue(this.documentRenderer,this.options,this.abortController.signal);default:return new Fe(this.documentRenderer)}}dispose(){this.active?.dispose(),this.active=void 0,this.abortController.abort()}};x();R();T();k();var ce=ht,i6={rendererWorldPerformance:"normal",rendererMeshersCountOverride:null,starfieldRendering:!0,defaultSkybox:!0,menuBackgroundMode:ce.mode,menuBackgroundMinecraftTextures:ce.minecraftTextures,menuBackgroundFuturisticScene:ce.futuristicScene,menuBackgroundFuturisticCamera:ce.futuristicCamera,menuBackgroundFuturisticBlockGroup:ce.futuristicBlockGroup,menuBackgroundFuturisticCameraSpeed:ce.futuristicCameraSpeedPercent,menuBackgroundFuturisticBlockSpeed:ce.futuristicBlockSpeedPercent,rendererFuturisticReveal:!1,rendererPerfDebugOverlay:!1,disableBlockEntityTextures:!1},r6={menuBackgroundMode:{possibleValues:[["classic","Classic"],["futuristic","Futuristic"]],requiresRestart:!0},menuBackgroundMinecraftTextures:{text:"Minecraft block textures",tooltip:"Use block atlas on futuristic menu cubes (loads assets on menu)"},menuBackgroundFuturisticScene:{possibleValues:I5.map(n=>[n,Z1[n]])},menuBackgroundFuturisticCamera:{possibleValues:H5.map(n=>[n,X1[n]])},menuBackgroundFuturisticBlockGroup:{possibleValues:O5.map(n=>[n,$1[n]]),text:"Block pool",tooltip:"Block set for textured menu cubes (requires Minecraft textures)"},menuBackgroundFuturisticCameraSpeed:{text:"Camera speed",tooltip:"Orbit / fly-through camera path speed. 0 freezes the path; mouse parallax still works.",min:0,max:200,unit:"%"},menuBackgroundFuturisticBlockSpeed:{text:"Block speed",tooltip:"Floating blocks and sky rotation. Independent of camera path speed.",min:0,max:200,unit:"%"},rendererWorldPerformance:{text:"World performance",tooltip:"Background workers for chunk geometry. Reload to apply.",requiresRestart:!0,possibleValues:[["low-energy","Low Energy"],["normal","Normal"],["maximum","Maximum"]]},starfieldRendering:{text:"Starfield"},defaultSkybox:{text:"Default skybox"},rendererFuturisticReveal:{text:"Futuristic world reveal"},rendererPerfDebugOverlay:{text:"Performance debug overlay"},disableBlockEntityTextures:{text:"Disable block entity textures",tooltip:"Skips signs, banners, heads, maps, etc."}},n6=[{title:"Menu background",keys:["menuBackgroundMode","menuBackgroundMinecraftTextures","menuBackgroundFuturisticScene","menuBackgroundFuturisticCamera","menuBackgroundFuturisticBlockGroup","menuBackgroundFuturisticCameraSpeed","menuBackgroundFuturisticBlockSpeed"]},{title:"World rendering",keys:["rendererWorldPerformance","starfieldRendering","defaultSkybox","disableBlockEntityTextures"]},{title:"Renderer debug",keys:["rendererFuturisticReveal","rendererPerfDebugOverlay"]}];z5.ColorManagement.enabled=!1;globalThis.THREE=z5;var s6=n=>({updateMap:n.entities.updateMap.bind(n.entities),updateCustomBlock:n.updateCustomBlock.bind(n),getBlockInfo:n.getBlockInfo.bind(n),playEntityAnimation:n.entities.playAnimation.bind(n.entities),damageEntity:n.entities.handleDamageEvent.bind(n.entities),updatePlayerSkin:n.entities.updatePlayerSkin.bind(n.entities),changeHandSwingingState:n.changeHandSwingingState.bind(n),getHighestBlocks:n.getHighestBlocks.bind(n),reloadWorld:n.reloadWorld.bind(n),updateEntityModel:n.entities.updateEntityModel.bind(n.entities),playEntityModelAnimation:n.entities.playEntityModelAnimation.bind(n.entities),addMedia:n.media.addMedia.bind(n.media),destroyMedia:n.media.destroyMedia.bind(n.media),setControlMode:n.media.setControlMode.bind(n.media),setVideoPlaying:n.media.setVideoPlaying.bind(n.media),setVideoSeeking:n.media.setVideoSeeking.bind(n.media),setVideoVolume:n.media.setVideoVolume.bind(n.media),setVideoSpeed:n.media.setVideoSpeed.bind(n.media),handleUserClick:n.media.handleUserClick.bind(n.media),addSectionAnimation(t,e){n.sectionsOffsetsAnimations[t]=e},removeSectionAnimation(t){delete n.sectionsOffsetsAnimations[t]},shakeFromDamage:n.cameraShake.shakeFromDamage.bind(n.cameraShake),onPageInteraction:n.media.onPageInteraction.bind(n.media),downloadMesherLog:n.downloadMesherLog.bind(n),explodeFirework:n.fireworksLegacy.explode.bind(n.fireworksLegacy),explodeFireworkFacingCamera:n.fireworksLegacy.explodeFacingCamera.bind(n.fireworksLegacy),addWaypoint:n.waypoints.addWaypoint.bind(n.waypoints),removeWaypoint:n.waypoints.removeWaypoint.bind(n.waypoints),startCinimaticScript:n.cinimaticScript.startScript.bind(n.cinimaticScript),stopCinimaticScript:n.cinimaticScript.stopScript.bind(n.cinimaticScript),launchFirework:n.fireworks.launchFirework.bind(n.fireworks),setSkyboxImage:n.skyboxRenderer.setSkyboxImage.bind(n.skyboxRenderer),setRain:t=>n.toggleModule("rain",t),spawnBlockBreakParticles(t,e,i,r,s,o){n.getModule("blockBreakParticles")?.spawnBlockBreakParticles(t,e,i,r,s,o)},spawnBlockCrackParticle(t,e,i,r,s,o,a){n.getModule("blockBreakParticles")?.spawnCrackParticle(t,e,i,r,s,o,a)},async loadGeometryExport(t){let{applyWorldGeometryExport:e}=await Promise.resolve().then(()=>(Er(),ko));return e(n,t)},feedChunkPacket(t){let{kind:e,...i}=t,r={type:e,...i};for(let s of n.workers)s.postMessage(r)}}),A9=[],ti=(n,...t)=>{for(let e of Object.values(globalThis.loadedMods??{}))try{e.threeJsBackendModule?.[n]?.(...t)}catch(i){let r=`[mod three.js] Error calling ${n} on ${e.name}: ${i}`;throw new Error(r)}},o6=()=>{let n,t=null,e=null,i=null,r=null,s=(c,d)=>{x0?n=Z5(c,A9,globalThis):n=c,t=new r5(n,d?.canvas),globalThis.renderer=t.renderer,globalThis.documentRenderer=t,globalThis.threeJsBackend=l,ti("default",l)},o=async c=>{if(!t)throw new Error("Document renderer not initialized");if(!i&&!e){let d={...n.config.menuBackground,...c};e=new Ne(t,{...n},d,!!D.env.SINGLE_FILE_BUILD_MODE),globalThis.menuBackgroundRenderer=e,ti("menuBackgroundCreated",e),await e.start(d),ti("menuBackgroundReady",e)}},a=async c=>{let f=x0?Z5(c,[lt,Jt],globalThis):c;if(!t)throw new Error("Document renderer not initialized");t.nonReactiveState=f.nonReactiveState,globalThis.resourcesManager=f.resourcesManager,e&&(e.dispose(),e=null),i=new oe(t.renderer,n,f),await i.worldReadyPromise,r=new X5(f.nonReactiveState),globalThis.frameTimingCollector=r;let m=t.render;t.render=function(g){m.call(this,g),r?.markFrameStart(),f.inWorldRenderingConfig.paused||i?.render(g),r?.markFrameEnd(),r?.markFrameDisplay()},t.inWorldRenderingConfig=f.inWorldRenderingConfig,globalThis.world=i,ti("worldReady",i)},v=()=>{e&&(e.dispose(),e=null),t&&t.dispose(),i&&(i.destroy(),i=null)},l={id:"threejs",displayName:`three.js ${z5.REVISION}`,startMenuBackground:o,startWorld:a,disconnect:v,setRendering(c){t.setPaused(!c),i&&(i.renderingActive=c)},getDebugOverlay:()=>({get entitiesString(){return i?.entities.getDebugString()},get left(){return{"Geo Memory":i?.chunkMeshManager.getEstimatedMemoryUsage().total??"-"}}}),updateCamera(c,d,f){r?.markCameraUpdate(!c),i?.setFirstPersonCamera(c,d,f)},get soundSystem(){return i?.soundSystem},get backendMethods(){if(i)return s6(i)}};return{main:{init:s,backend:l},workerProxy(){return I2({init(c,d){s(c,{canvas:d})},updateSizeExternal(c,d,f){t?.updateSizeExternal(c,d,f)},startMenuBackground:o,startWorld:a,disconnect:v,setRendering:l.setRendering,updateCamera(c,d,f){let m=c?new w9(c.x,c.y,c.z):null;r?.markCameraUpdate(!m),l.updateCamera(m,d,f)},async callBackendMethod(c,...d){if(!i)throw new Error("World renderer not initialized");let m=s6(i)[c];if(!m)throw new Error(`Backend method ${String(c)} is unavailable`);return m(...d)}})}}};var ei=n=>{let{main:t}=o6();return t.init(n),t.backend};ei.id="threejs";ei.displayName="three.js Blocking";ei.description="Simple, old and stable main thread graphics backend providing balanced performance on top of WebGL2.";x();R();T();k();import*as a6 from"three";function E9(n){let t="threeWorker.js",e;if(D.env.SINGLE_FILE_BUILD){let i=document.getElementById("three-worker-code").textContent,r=new Blob([i],{type:"text/javascript"});e=new Worker(window.URL.createObjectURL(r))}else e=new Worker(t);return e.onmessage=({data:i})=>{n(i)},e.on&&e.on("message",i=>{e.onmessage({data:i})}),e}var ii=async n=>{let t=E9(()=>{}),e=H2(t),i=yi();i.onSizeChanged((a,v)=>{e.updateSizeExternal(a,v,window.devicePixelRatio||1)});let r=q5(n,t);try{e.init(r,i.canvas)}catch(a){throw t5(r),a}let s=new Proxy({},{get(a,v){if(typeof v=="string")return async(...l)=>e.callBackendMethod(v,...l)}});return{id:"threejs",displayName:`three.js ${a6.REVISION}`,async startMenuBackground(){},async startWorld(a){let v={...i5,items:"itemsArray",entities:"entitiesArray"};Ci([t],a.version,v,a.resourcesManager.currentResources.mcData),a.inWorldRenderingConfig.__syncToWorker=!0,a.playerStateReactive&&(a.playerStateReactive.__syncToWorker=!0),a.rendererState&&(a.rendererState.__syncFromWorker=!0),a.nonReactiveState&&(a.nonReactiveState.__syncFromWorker=!0),a.nonReactiveState.__syncFromWorkerInterval=200;let l=q5(a,t);try{await e.startWorld(structuredClone(l))}catch(d){throw t5(l),d}e.updateSizeExternal(i.size.width,i.size.height,window.devicePixelRatio||1);let c=_e("fps");setInterval(()=>{let{fps:d,avgRenderTime:f,worstRenderTime:m}=a.nonReactiveState;c.updateText(`FPS: ${d.toFixed(0)} (${f.toFixed(0)}ms/${m.toFixed(0)}ms)`),a.nonReactiveState.fps=0},1e3)},disconnect(){i.destroy(),e.disconnect(),t.terminate()},setRendering(a){e.setRendering(a)},updateCamera(a,v,l){e.updateCamera(a?{x:a.x,y:a.y,z:a.z}:null,v,l)},soundSystem:void 0,backendMethods:s}};ii.id="threejs-off-thread";ii.displayName="three.js Multi-thread";ii.description=["Edge-cutting technology that uses a dedicated thread for graphics.","Slightly higher power and RAM usage.","More stable FPS (mid-range devices), but possible inputlag if TPS is low.","On low-end devices it might result in device throttling and stuttering."].join(" ");export{k2 as AppViewer,Fe as ClassicMenuBackground,r5 as DocumentRenderer,H5 as FUTURISTIC_CAMERA_IDS,X1 as FUTURISTIC_CAMERA_LABELS,I5 as FUTURISTIC_SCENE_IDS,Z1 as FUTURISTIC_SCENE_LABELS,le as FuturisticMenuBackground,li as HIGH_TEXTURE_COUNT,j5 as LONG_RENDER_TIME_MS,vi as LOW_FPS_THRESHOLD,pe as LoadedResourcesTransferrable,n5 as MC_RENDERER_DEBUG_OVERLAY_CLASS,ze as MENU_BACKGROUND_MC_VERSION,B5 as MENU_BACKGROUND_MOTION_DEFAULTS,ht as MENU_BACKGROUND_OPTION_DEFAULTS,jr as MINECRAFT_BLOCK_GROUPS,O5 as MINECRAFT_BLOCK_GROUP_IDS,$1 as MINECRAFT_BLOCK_GROUP_LABELS,Ne as MenuBackgroundRenderer,Je as PerformanceMonitor,i6 as RENDERER_DEFAULT_OPTIONS,r6 as RENDERER_OPTIONS_META,n6 as RENDERER_RENDER_GUI_SECTIONS,lt as ResourcesManager,Ue as WorldBlocksMenuBackground,qt as WorldView,Jt as WorldViewWorker,yi as addCanvasForWorker,me as chunkPos,ii as createGraphicsBackendOffThread,ei as createGraphicsBackendSingleThread,Bl as createWorldRendererConfig,b2 as defaultGraphicsBackendConfig,ai as defaultPerformanceInstabilityFactors,qe as defaultWorldRendererConfig,A2 as delayedIterator,ci as formatPerformanceFactorsDebug,Yt as getDefaultRendererState,T2 as getInitialPlayerState,Y6 as getInitialPlayerStateRenderer,j6 as getPlayerStateUtils,x0 as isWebWorker,Q1 as menuBackgroundSpeedToMultiplier,T6 as sectionPos};
|
|
21235
|
+
#include <${vv>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
21236
|
+
}`})}},Dr=class{constructor(t){this.worldRenderer=t;u(this,"points");u(this,"clock",new M0.Clock);u(this,"enabled",!1);u(this,"currentTime");u(this,"enablementCheck",()=>this.currentTime?this.currentTime>13500&&this.currentTime<23e3:!1);u(this,"render",t=>{this.points&&(this.points.position.set(0,0,0),this.points.material.uniforms.time.value=this.clock.getElapsedTime()*.2)})}enable(){this.enabled||(this.enabled=!0,this.updateVisibility())}disable(){this.enabled&&(this.enabled=!1,this.removeStars())}toggle(){return this.enabled?this.disable():this.enable(),this.enabled}updateTimeOfDay(t){this.currentTime=t,this.enabled&&this.updateVisibility()}updateVisibility(){if(!this.enabled)return;let t=this.enablementCheck?.()??!1;t&&!this.points?this.createStars():!t&&this.points&&this.removeStars()}createStars(){if(this.points)return;let t=80,e=50,i=7e3,r=7,s=10,o=new M0.BufferGeometry,a=b=>new M0.Vector3().setFromSpherical(new M0.Spherical(b,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),v=[],l=[],c=Array.from({length:i},()=>(.5+.5*Math.random())*r),d=new M0.Color,f=t+e,m=e/i;for(let b=0;b<i;b++)f-=m*Math.random(),v.push(...a(f).toArray()),d.setHSL(b/i,s,.9),l.push(d.r,d.g,d.b);o.setAttribute("position",new M0.Float32BufferAttribute(v,3)),o.setAttribute("color",new M0.Float32BufferAttribute(l,3)),o.setAttribute("size",new M0.Float32BufferAttribute(c,1));let g=new zr;g.blending=M0.AdditiveBlending,g.depthTest=!1,g.transparent=!0,this.points=new M0.Points(o,g),this.points.renderOrder=-1,this.worldRenderer.scene.add(this.points)}dispose(){this.removeStars()}removeStars(){this.points&&(this.points.geometry.dispose(),this.points.material.dispose(),this.worldRenderer.scene.remove(this.points),this.points=void 0)}},Zo={id:"starfield",controller:Dr,enabledDefault:!0,cannotBeDisabled:!0};var Xo={starfield:Zo,futuristicReveal:qo,rain:Ko,cameraBobbing:Vo,blockBreakParticles:Wo};var z5=class z5 extends h1{constructor(e,i,r){if(!r.resourcesManager)throw new Error("resourcesManager is required in displayOptions");super(r.resourcesManager,r,i);this.renderer=e;this.initOptions=i;this.displayOptions=r;u(this,"outputFormat","threeJs");u(this,"chunkMeshManager");u(this,"chunkTextures",new Map);u(this,"signsCache",new Map);u(this,"cameraSectionPos",new Ft(0,0,0));u(this,"holdingBlock");u(this,"holdingBlockLeft");u(this,"scene",new Q.Scene);u(this,"ambientLight",new Q.AmbientLight(13421772));u(this,"directionalLight",new Q.DirectionalLight(16777215,.5));u(this,"entities",new z1(this,globalThis.mcData));u(this,"performanceMonitor");u(this,"cameraGroupVr");u(this,"material",new Q.MeshBasicMaterial({vertexColors:!0,transparent:!0,alphaTest:.1}));u(this,"itemsTexture");u(this,"cursorBlock");u(this,"onRender",[]);u(this,"lastRenderTime",0);u(this,"cameraShake");u(this,"cameraContainer");u(this,"media");u(this,"waypoints");u(this,"cinimaticScript");u(this,"camera");u(this,"renderTimeAvg",0);u(this,"pendingSectionUpdates",new Map);u(this,"pendingSectionBufferStartTimes",new Map);u(this,"modules",{});u(this,"sectionsOffsetsAnimations",{});u(this,"fountains",[]);u(this,"fireworksLegacy");u(this,"DEBUG_RAYCAST",!1);u(this,"skyboxRenderer");u(this,"fireworks");u(this,"sceneOrigin",new K1(this.scene));u(this,"cameraWorldPos",{x:0,y:0,z:0});u(this,"_cameraPositionAccessWarned",!1);u(this,"_tmpCameraPos",new Q.Vector3);u(this,"currentPosTween");u(this,"currentRotTween");u(this,"_tpDirection",new Q.Vector3);u(this,"_tpPitchQuat",new Q.Quaternion);u(this,"_tpYawQuat",new Q.Quaternion);u(this,"_tpFinalQuat",new Q.Quaternion);u(this,"_tpScenePos",new Q.Vector3);u(this,"_tpAxisX",new Q.Vector3(1,0,0));u(this,"_tpAxisY",new Q.Vector3(0,1,0));u(this,"_tpRaycaster",new Q.Raycaster);u(this,"_tpChunkWorldPos",new Q.Vector3);u(this,"debugOverlayAdded",!1);u(this,"debugRaycastHelper");u(this,"debugHitPoint");u(this,"prevFramePerspective",null);this.performanceMonitor=new qe(this.reactiveState.world.instabilityFactors),this.renderer=e,r.rendererState.renderer=z5.getRendererInfo(e)??"...",this.chunkMeshManager=new O5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.onRenderDistanceChanged=s=>{this.chunkMeshManager.updateViewDistance(s)},this.cursorBlock=new D1(this),this.holdingBlock=S5(this),this.holdingBlockLeft=S5(this,!0);for(let s of Object.values(Xo))this.registerModule(s);this.skyboxRenderer=new Y1(this.realScene,!1,null),this.skyboxRenderer.init(),this.addDebugOverlay(),this.resetScene(),this.init(),this.soundSystem=new L1(this),this.cameraShake=new U1(this,this.onRender),this.media=new G1(this),this.fireworksLegacy=new V1(this),this.waypoints=new W1(this),this.cinimaticScript=new j1(this,(s,o,a)=>this.setCinimaticCamera(s,o,a),s=>this.setCinimaticFov(s),()=>({position:new Ft(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),yaw:this.cameraShake.getBaseRotation().yaw,pitch:this.cameraShake.getBaseRotation().pitch,fov:this.camera.fov})),this.fireworks=new Q1(this.realScene,this.sceneOrigin),this.renderUpdateEmitter.on("chunkFinished",s=>{this.finishChunk(s)}),this.worldSwitchActions(),this.initializeModules()}get sectionObjects(){return this.chunkMeshManager.sectionObjects}get realScene(){return this.scene}get waitingChunksToDisplay(){return this.chunkMeshManager.waitingChunksToDisplay}get estimatedMemoryUsage(){return this.chunkMeshManager.getEstimatedMemoryUsage().total}get tilesRendered(){return this.chunkMeshManager.getTotalTiles()}get blocksRendered(){return this.chunkMeshManager.getTotalBlocks()}registerModule(e){if(e.id in this.modules)return;let i=new e.controller(this),r={manifest:e,controller:i,enabled:!1,toggle:()=>this.toggleModule(e.id)};this.modules[e.id]=r,e.enabledDefault&&this.toggleModule(e.id,!0)}enableModule(e){let i=this.modules[e];i&&(i.enabled||(i.enabled=!0,i.controller.enable(),i.controller.render&&this.onRender.push(i.controller.render)))}disableModule(e){let i=this.modules[e];if(i&&!i.manifest.cannotBeDisabled&&i.enabled&&(i.enabled=!1,i.controller.disable(),i.controller.render)){let r=this.onRender.indexOf(i.controller.render);r>-1&&this.onRender.splice(r,1)}}toggleModule(e,i){let r=this.modules[e];if(!r)return!1;let s=i!==void 0?i:!r.enabled;if(s===r.enabled)return r.enabled;if(!s&&r.manifest.cannotBeDisabled)return!0;if(r.enabled=s,s)r.controller.enable(),r.controller.render&&!this.onRender.includes(r.controller.render)&&this.onRender.push(r.controller.render);else if(r.controller.disable(),r.controller.render){let o=this.onRender.indexOf(r.controller.render);o>-1&&this.onRender.splice(o,1)}return s}disposeModules(){for(let e of Object.values(this.modules))e.controller.dispose();this.modules={}}initializeModules(){this.updateModulesFromConfig()}getModule(e){return this.modules[e]?.controller}anyModuleRequiresHeightmap(){return Object.values(this.modules).some(e=>e.enabled&&e.manifest.requiresHeightmap)}get cameraObject(){return this.cameraGroupVr??this.cameraContainer}_wrapCameraPositionWithWarning(){let e=this.camera.position,i=this,r=20,s=(v,l,c)=>Math.abs(v)>r||Math.abs(l)>r||Math.abs(c)>r,o=()=>{!i._cameraPositionAccessWarned&&typeof D<"u"},a=new Proxy(e,{set(v,l,c){return(l==="x"||l==="y"||l==="z")&&typeof c=="number"&&Math.abs(c)>r&&o(),v[l]=c,!0},get(v,l,c){let d=v[l];return l==="set"?function(f,m,g){return s(f,m,g)&&o(),v.set(f,m,g)}:l==="setX"||l==="setY"||l==="setZ"?function(f){return Math.abs(f)>r&&o(),v[l](f)}:l==="copy"?function(f){return s(f.x,f.y,f.z)&&o(),v.copy(f)}:typeof d=="function"?d.bind(v):d}});Object.defineProperty(this.camera,"position",{value:a,configurable:!0,enumerable:!0})}worldSwitchActions(){this.onWorldSwitched.push(()=>{this.protocolCustomBlocks.clear(),this.sectionsOffsetsAnimations={},this.waypoints.clear(),this.cinimaticScript.stopScript(),this.fireworks.clear()})}downloadWorldGeometry(){kr(this,new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraShake.getBaseRotation(),"world-geometry.json")}updateEntity(e,i=!1){let r={rotation:{head:{x:e.headPitch??e.pitch,y:e.headYaw,z:0}}};i?this.entities.updateEntityPosition(e,!1,r):this.entities.update(e,r)}updatePlayerEntity(e){this.entities.handlePlayerEntity(e)}resetScene(){this.sceneOrigin.update(0,0,0),this.cameraWorldPos.x=0,this.cameraWorldPos.y=0,this.cameraWorldPos.z=0,this.scene.matrixAutoUpdate=!1,this.scene.background=new Q.Color(this.initOptions.config.sceneBackground),this.scene.add(this.ambientLight),this.directionalLight.position.set(1,1,.5).normalize(),this.directionalLight.castShadow=!0,this.scene.add(this.directionalLight);let e=this.renderer.getSize(new Q.Vector2);this.camera=new Q.PerspectiveCamera(75,e.x/e.y,.1,1e3),this._wrapCameraPositionWithWarning(),this.cameraContainer=new Q.Object3D,this.cameraContainer.add(this.camera),this.scene.add(this.cameraContainer)}watchReactivePlayerState(){super.watchReactivePlayerState(),this.onReactivePlayerStateUpdated("inWater",e=>{this.skyboxRenderer.updateWaterState(e,this.playerStateReactive.waterBreathing)}),this.onReactivePlayerStateUpdated("waterBreathing",e=>{this.skyboxRenderer.updateWaterState(this.playerStateReactive.inWater,e)}),this.onReactivePlayerStateUpdated("ambientLight",e=>{e&&(this.ambientLight.intensity=e)}),this.onReactivePlayerStateUpdated("directionalLight",e=>{e&&(this.directionalLight.intensity=e)}),this.onReactivePlayerStateUpdated("lookingAtBlock",e=>{this.cursorBlock.setHighlightCursorBlock(e?new Ft(e.x,e.y,e.z):null,e?.shapes)}),this.onReactivePlayerStateUpdated("diggingBlock",e=>{this.cursorBlock.updateBreakAnimation(e?{x:e.x,y:e.y,z:e.z}:void 0,e?.stage??null,e?.mergedShape)}),this.onReactivePlayerStateUpdated("perspective",e=>{let i=new Ft(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z);this.updateCamera(i,this.cameraShake.getBaseRotation().yaw,this.cameraShake.getBaseRotation().pitch)})}watchReactiveConfig(){super.watchReactiveConfig(),this.onReactiveConfigUpdated("showChunkBorders",i=>{this.updateShowChunksBorder(i)}),this.onReactiveConfigUpdated("defaultSkybox",i=>{this.skyboxRenderer.updateDefaultSkybox(i)});let e=this.displayOptions.inWorldRenderingConfig.handRenderer;this.onReactiveConfigUpdated("handRenderer",i=>{if(i===e)return;e=i;let r=this.holdingBlock.ready,s=this.holdingBlockLeft.ready;this.holdingBlock.dispose(),this.holdingBlockLeft.dispose(),this.holdingBlock=S5(this),this.holdingBlockLeft=S5(this,!0),r&&(this.holdingBlock.ready=!0,this.holdingBlock.updateItem()),s&&(this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem())}),this.onReactiveConfigUpdated("*",()=>{this.updateModulesFromConfig()}),this.updateModulesFromConfig()}updateModulesFromConfig(){let{moduleStates:e}=this.worldRendererConfig;for(let[i,r]of Object.entries(this.modules)){let s=e[i];if(s==="enabled"){r.enabled||this.toggleModule(i,!0);continue}if(s==="disabled"){r.enabled&&!r.manifest.cannotBeDisabled&&this.toggleModule(i,!1);continue}if(s==="auto"||s===void 0)if(r.controller.autoEnableCheck){let o=r.controller.autoEnableCheck();o&&!r.enabled?this.toggleModule(i,!0):!o&&r.enabled&&!r.manifest.cannotBeDisabled&&this.toggleModule(i,!1)}else{let o=r.manifest.enabledDefault??!1;o&&!r.enabled?this.toggleModule(i,!0):!o&&r.enabled&&!r.manifest.cannotBeDisabled&&this.toggleModule(i,!1)}}}changeHandSwingingState(e,i=!1){let r=i?this.holdingBlockLeft:this.holdingBlock;e?r.startSwing():r.stopSwing()}async updateAssetsData(){let e=this.resourcesManager.currentResources,i=this.material.map,r=this.itemsTexture,s=e5(e.blocksAtlasImage);s.needsUpdate=!0,s.flipY=!1,this.material.map=s;let o=e5(e.itemsAtlasImage);o.needsUpdate=!0,o.flipY=!1,this.itemsTexture=o,i&&i.dispose(),r&&r.dispose(),await super.updateAssetsData(),this.onAllTexturesLoaded(),Object.keys(this.loadedChunks).length>0&&this.rerenderAllChunks()}onAllTexturesLoaded(){this.holdingBlock.ready=!0,this.holdingBlock.updateItem(),this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem()}changeBackgroundColor(e){this.realScene.background=new Q.Color(e[0],e[1],e[2])}changeCardinalLight(e){this.worldRendererConfig.cardinalLight=e}timeUpdated(e){let i=this.getModule("starfield");i?.updateTimeOfDay&&i.updateTimeOfDay(e),this.skyboxRenderer.updateTime(e)}biomeUpdated(e){e?.temperature!==void 0&&this.skyboxRenderer.updateTemperature(e.temperature)}biomeReset(){this.skyboxRenderer.updateTemperature(Er)}getItemRenderData(e,i){return Eo(e,i,this.resourcesManager,this.playerStateReactive)}async demoModel(){let e=cursorBlockRel(0,1,0).position,i=await A5();s3(i,e);let r=new Q.BoxHelper(i,16776960);i.add(r),this.realScene.add(i)}demoItem(){let e=cursorBlockRel(0,1,0).position,{mesh:i}=this.entities.getItemMesh({itemId:541},{});i.position.set(e.x+.5,e.y+.5,e.z+.5);let r=new Q.BoxHelper(i,16776960);i.add(r),this.realScene.add(i)}addDebugOverlay(){if(this.debugOverlayAdded)return;this.debugOverlayAdded=!0;let e=Ee("debug-overlay",80,0,void 0,{className:c5});setInterval(()=>{if(e.setVisibility(this.displayAdvancedStats),this.displayAdvancedStats){let i=v=>new Intl.NumberFormat("en-US",{}).format(v),r=v=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(v),s="";s+=`TE: ${i(this.renderer.info.memory.textures)} `,s+=`F: ${r(this.tilesRendered)} `,s+=`B: ${r(this.blocksRendered)} `,s+=`MEM: ${this.chunkMeshManager.getEstimatedMemoryUsage().total} `;let o=this.chunkMeshManager.getStats();s+=`POOL: ${o.activeCount}/${o.poolSize} `;let a=di(this.reactiveState.world.instabilityFactors);a&&(s+=`PF: ${a} `),e.updateText(s),this.backendInfoReport=s}},200)}updatePosDataChunk(e){let[i,r,s]=e.split(",").map(l=>Math.floor(+l/16)),o=Math.abs(i-this.cameraSectionPos.x)+Math.abs(r-this.cameraSectionPos.y)+Math.abs(s-this.cameraSectionPos.z),a=this.sectionObjects[e],v=a.mesh??a.children.find(l=>l.name==="mesh");v.renderOrder=500-o}updateViewerPosition(e){this.viewerChunkPosition=e}cameraSectionPositionUpdate(){for(let e in this.sectionObjects)this.sectionObjects[e]&&this.updatePosDataChunk(e)}getDir(e,i){return e===i?0:e<i?1:-1}finishChunk(e){this.chunkMeshManager.finishChunkDisplay(e)}applyPendingSectionUpdates(){if(this.pendingSectionUpdates.size===0)return;let e=performance.now(),i=this.getSectionHeight(),r=[];for(let s of this.pendingSectionUpdates.keys()){let o=this.pendingSectionBufferStartTimes.get(s)??e;if(e-o<z5.MAX_SECTION_UPDATE_BUFFER_MS){let[v,l,c]=s.split(",").map(Number),d=[`${v-16},${l},${c}`,`${v+16},${l},${c}`,`${v},${l-i},${c}`,`${v},${l+i},${c}`,`${v},${l},${c-16}`,`${v},${l},${c+16}`],f=!1;for(let m of d)if(this.sectionsWaiting.has(m)&&!this.pendingSectionUpdates.has(m)&&this.sectionObjects[m]){f=!0;break}if(f)continue}r.push(s)}if(r.length!==0)for(let s of r){let o=this.pendingSectionUpdates.get(s);this.pendingSectionUpdates.delete(s),this.pendingSectionBufferStartTimes.delete(s);let a=o.key.split(","),v=`${a[0]},${a[2]}`;if(!this.loadedChunks[v]||!this.active){this.chunkMeshManager.releaseSection(o.key);continue}if(!o.geometry.positions.length){this.chunkMeshManager.releaseSection(o.key);continue}this.chunkMeshManager.updateSection(o.key,o.geometry),this.updatePosDataChunk(o.key)}}clearPendingSectionUpdatesForChunk(e,i){for(let r of[...this.pendingSectionUpdates.keys()])r.startsWith(`${e},`)&&r.endsWith(`,${i}`)&&(this.pendingSectionUpdates.delete(r),this.pendingSectionBufferStartTimes.delete(r))}handleWorkerMessage(e){if(e.type==="geometry"){let i=e.key.split(","),r=`${i[0]},${i[2]}`;if(!this.loadedChunks[r]||!this.active){this.pendingSectionUpdates.delete(e.key),this.pendingSectionBufferStartTimes.delete(e.key);return}if(this.sectionObjects[e.key]){this.pendingSectionUpdates.set(e.key,e),this.pendingSectionBufferStartTimes.has(e.key)||this.pendingSectionBufferStartTimes.set(e.key,performance.now());return}if(!e.geometry.positions.length){this.chunkMeshManager.releaseSection(e.key);return}this.chunkMeshManager.updateSection(e.key,e.geometry),this.updatePosDataChunk(e.key)}}getSignTexture(e,i,r,s=!1){let o=_e(e),a=this.chunkTextures.get(`${o[0]},${o[1]}`);a||(a={},this.chunkTextures.set(`${o[0]},${o[1]}`,a));let v=`${e.x},${e.y},${e.z}`;if(a[v])return a[v];let l=lv(this.version),c=s1(i,r,l);if(!c)return;let d=new Q.Texture(c);return d.magFilter=Q.NearestFilter,d.minFilter=Q.NearestFilter,d.needsUpdate=!0,a[v]=d,d}getCameraPosition(e){return(e??this._tmpCameraPos).set(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z)}getSectionCameraPosition(){let e=this.getCameraPosition();return new Ft(Math.floor(e.x/16),Math.floor(e.y/16),Math.floor(e.z/16))}updateCameraSectionPos(){let e=this.getSectionCameraPosition();this.cameraSectionPos.equals(e)||(this.cameraSectionPos=e,this.cameraSectionPositionUpdate())}setFirstPersonCamera(e,i,r){let s=this.playerStateReactive.eyeHeight;this.updateCamera(e?.offset(0,s,0)??null,i,r),this.updateCameraSectionPos()}getThirdPersonCamera(e,i,r){e??(e=new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z));let s=this.playerStateReactive.perspective==="third_person_back",o=4,a=this._tpDirection.set(0,0,-1),v=this._tpPitchQuat.setFromAxisAngle(this._tpAxisX,r),l=this._tpYawQuat.setFromAxisAngle(this._tpAxisY,i),c=this._tpFinalQuat.multiplyQuaternions(l,v);a.applyQuaternion(c),s&&a.multiplyScalar(-1),this.DEBUG_RAYCAST&&this.debugRaycast(e,a,o);let d=this._tpScenePos.set(this.sceneOrigin.toSceneX(e.x),this.sceneOrigin.toSceneY(e.y),this.sceneOrigin.toSceneZ(e.z)),f=this._tpRaycaster;f.set(d,a),f.far=o;let m=Object.values(this.sectionObjects).filter(w=>w.name==="chunk"&&w.visible).filter(w=>{let T=w.children.find(H=>H.name==="mesh");if(!T)return!1;let S=this._tpChunkWorldPos;return T.getWorldPosition(S),d.distanceTo(S)<80}),g=[];for(let w of m){let T=w.children.find(S=>S.name==="mesh");T&&g.push(T)}let b=f.intersectObjects(g,!1),A=o;return b.length>0&&(A=Math.max(.5,b[0].distance-.2)),new Ft(e.x+a.x*A,e.y+a.y*A,e.z+a.z*A)}debugRaycast(e,i,r){this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0);let s=new Q.Vector3(this.sceneOrigin.toSceneX(e.x),this.sceneOrigin.toSceneY(e.y),this.sceneOrigin.toSceneZ(e.z));this.debugRaycastHelper=new Q.ArrowHelper(i.clone().normalize(),s,r,16711680,r*.1,r*.05),this.realScene.add(this.debugRaycastHelper);let o=new Q.SphereGeometry(.2,8,8),a=new Q.MeshBasicMaterial({color:65280});this.debugHitPoint=new Q.Mesh(o,a),this.debugHitPoint.position.copy(s).add(i.clone().multiplyScalar(r)),this.realScene.add(this.debugHitPoint)}setCinimaticCamera(e,i,r){this.cameraWorldPos.x=e.x,this.cameraWorldPos.y=e.y,this.cameraWorldPos.z=e.z,this.sceneOrigin.update(e.x,e.y,e.z),this.cameraObject.position.set(0,0,0),this.cameraShake.setBaseRotation(r,i),this.updateCameraSectionPos()}setCinimaticFov(e){this.camera.fov=e,this.camera.updateProjectionMatrix()}updateCamera(e,i,r){if(!this.cinimaticScript.running){if(e){this.renderer.xr.isPresenting&&(e.y-=this.camera.position.y),this.currentPosTween?.stop();let s=this.displayOptions.inWorldRenderingConfig.instantCameraUpdate?0:this.playerStateUtils.isSpectatingEntity()?150:50;this.currentPosTween=new O0(this.cameraWorldPos).to({x:e.x,y:e.y,z:e.z},s).onUpdate(()=>{this.sceneOrigin.update(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraObject.position.set(0,0,0)}).start()}if(this.playerStateUtils.isSpectatingEntity()){let s=this.cameraShake.getBaseRotation(),o=0,a=Math.PI/2;s.yaw<a&&i>Math.PI+a?o=-Math.PI*2:i<a&&s.yaw>Math.PI+a&&(o=Math.PI*2),this.currentRotTween?.stop(),this.currentRotTween=new O0(s).to({pitch:r,yaw:i+o},100).onUpdate(v=>this.cameraShake.setBaseRotation(v.pitch,v.yaw-o)).start()}else{this.currentRotTween?.stop(),this.cameraShake.setBaseRotation(r,i);let{perspective:s}=this.playerStateReactive;if(s==="third_person_back"||s==="third_person_front"){let o=new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),a=this.getThirdPersonCamera(o,i,r),v=o.distanceTo(new Q.Vector3(a.x,a.y,a.z)),l=s==="third_person_back"?v:-v;this.camera.position.set(0,0,l),s==="third_person_front"?this.camera.rotation.set(0,Math.PI,0):this.camera.rotation.set(0,0,0)}else this.camera.position.z=0,this.camera.rotation.set(0,0,0),this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0)}this.updateCameraSectionPos()}}debugChunksVisibilityOverride(){let{chunksRenderAboveOverride:e,chunksRenderBelowOverride:i,chunksRenderDistanceOverride:r,chunksRenderAboveEnabled:s,chunksRenderBelowEnabled:o,chunksRenderDistanceEnabled:a}=this.reactiveDebugParams,v=this.getSectionHeight(),l=this.cameraSectionPos.y*v;if(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay&&e!==void 0||i!==void 0||r!==void 0)for(let[c,d]of Object.entries(this.sectionObjects)){if(d._waitingForChunkDisplay)continue;let[f,m,g]=c.split(",").map(Number),b=s&&e!==void 0?m<=l+e:o&&i!==void 0?m>=l-i:a&&r!==void 0?Math.abs(m-l)<=r:!0;d.visible=b}else this.chunkMeshManager.updateSectionsVisibility()}render(e=!1){if(this.currentRenderedFrames++,this.reactiveDebugParams.stopRendering)return;this.debugChunksVisibilityOverride();let i=performance.now();this.lastRendered=performance.now();let r=this.lastRenderTime>0?Math.min(Math.max((i-this.lastRenderTime)/1e3,0),.1):1/60;this.lastRenderTime=i,this.cursorBlock.render(),this.updateSectionOffsets();let s=this.getCameraPosition();if(this.skyboxRenderer.update(s,this.viewDistance),e||this.displayOptions.inWorldRenderingConfig.fov!==this.camera.fov){let d=this.renderer.getSize(new Q.Vector2);this.camera.aspect=d.width/d.height,this.camera.fov=this.displayOptions.inWorldRenderingConfig.fov,this.camera.updateProjectionMatrix()}let a=0;if(!this.reactiveDebugParams.disableEntities){let d=performance.now();this.entities.render(),a=performance.now()-d}let v=this.cameraGroupVr instanceof Q.Group?this.cameraGroupVr.children.find(d=>d instanceof Q.PerspectiveCamera):this.camera;this.applyPendingSectionUpdates(),this.renderer.render(this.scene,v),this.displayOptions.inWorldRenderingConfig.showHand&&this.playerStateReactive.gameMode!=="spectator"&&this.playerStateReactive.perspective==="first_person"&&!this.renderer.xr.isPresenting&&(this.holdingBlock.render(this.camera,this.renderer,this.ambientLight,this.directionalLight),this.holdingBlockLeft.render(this.camera,this.renderer,this.ambientLight,this.directionalLight));for(let d of this.fountains)this.sectionObjects[d.sectionId]&&!this.sectionObjects[d.sectionId].foutain&&(d.createParticles(this.sectionObjects[d.sectionId]),this.sectionObjects[d.sectionId].foutain=!0),d.render();this.waypoints.render(),this.fireworks.update();for(let d of this.onRender)d(r);let c=performance.now()-i;this.worldRendererConfig.autoLowerRenderDistance&&this.chunkMeshManager.recordRenderTime(c),this.renderTimeAvgCount++,this.renderTimeAvg=(this.renderTimeAvg*(this.renderTimeAvgCount-1)+c)/this.renderTimeAvgCount,this.renderTimeMax=Math.max(this.renderTimeMax,c),this.performanceMonitor.onFrame({totalMs:c,entitiesMs:a,loadedTextureCount:this.renderer.info.memory.textures,fps:this.lastFps})}renderHead(e,i,r,s){let o;if(s.SkullOwner?o=s.SkullOwner.Properties?.textures?.[0]?.Value:o=s.profile?.properties?.find(a=>a.name==="textures")?.value,!!o)try{let v=JSON.parse(F.from(o,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:l}=this.worldRendererConfig;l&&(v=v?.replace("http://textures.minecraft.net/",l).replace("https://textures.minecraft.net/",l));let c=It(this,v,Ht.head),d=new Q.Group;return r&&c.position.set(0,.3125,.3125),c.position.y-=23/16,d.add(c),this.sceneOrigin.track(d),d.position.set(e.x+.5,e.y+.045,e.z+.5),d.rotation.set(0,-Q.MathUtils.degToRad(i*(r?90:45/2)),0),d.scale.set(.8,.8,.8),d}catch{}}renderSign(e,i,r,s,o){let a=this.getSignTexture(e,o,s);if(!a)return;let v=new Q.Mesh(new Q.PlaneGeometry(1,1),new Q.MeshBasicMaterial({map:a,transparent:!0}));v.renderOrder=999;let l=7/16,c=s?1.3:1;v.scale.set(1*c,l*c,1*c);let d=(s?2:1.5)/16,f=.25/16;r&&!s?v.position.set(0,0,-.5+d+f+1e-4):v.position.set(0,0,d/2+1e-4);let m=new Q.Group;m.rotation.set(0,-Q.MathUtils.degToRad(i*(r?90:45/2)),0),m.add(v);let g=(s?10:8)/16,b=(s?0:r?4.333:9.333)/16,A=g/2+b;return this.sceneOrigin.track(m),m.position.set(e.x+.5,e.y+A,e.z+.5),m}lightUpdate(e,i){for(let r=this.worldSizeParams.minY;r<this.worldSizeParams.worldHeight;r+=16)this.setSectionDirty(new Ft(e,r,i))}rerenderAllChunks(){for(let e of Object.keys(this.sectionObjects)){let[i,r,s]=e.split(",").map(Number);this.setSectionDirty(new Ft(i,r,s))}}updateShowChunksBorder(e){this.chunkMeshManager.updateAllBoxHelpers(e)}resetWorld(){super.resetWorld(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.chunkMeshManager=new O5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0)}getLoadedChunksRelative(e,i=!1){let[r,s,o]=wi(e);return Object.fromEntries(Object.entries(this.sectionObjects).map(([a,v])=>{let[l,c,d]=a.split(",").map(Number),[f,m,g]=wi({x:l,y:c,z:d});return[i?`${f-r},${m-s},${g-o}`:`${f-r},${g-o}`,v]}))}cleanChunkTextures(e,i){let r=this.chunkTextures.get(`${Math.floor(e/16)},${Math.floor(i/16)}`)??{};for(let s of Object.keys(r))r[s].dispose(),delete r[s];this.chunkMeshManager.cleanSignChunkTextures(e,i)}readdChunks(){for(let e of Object.keys(this.sectionObjects))this.scene.remove(this.sectionObjects[e]);setTimeout(()=>{for(let e of Object.keys(this.sectionObjects))this.scene.add(this.sectionObjects[e])},500)}disableUpdates(e=this.scene.children){for(let i of e)i.matrixWorldNeedsUpdate=!1,this.disableUpdates(i.children??[])}removeColumn(e,i){super.removeColumn(e,i),this.cleanChunkTextures(e,i),this.clearPendingSectionUpdatesForChunk(e,i);let r=this.getSectionHeight(),s=this.worldMinYRender;for(let o=s;o<this.worldSizeParams.worldHeight;o+=r){let a=`${e},${o},${i}`;this.chunkMeshManager.sectionObjects[a]&&this.chunkMeshManager.releaseSection(a)}this.chunkMeshManager.onChunkRemovedFromGate(`${e},${i}`)}onViewerChunkPositionChanged(){this.chunkMeshManager.tryRevealPending()}setSectionDirty(...e){let[i]=e;this.cleanChunkTextures(i.x,i.z),super.setSectionDirty(...e)}static getRendererInfo(e){try{let i=e.getContext();return`${i.getParameter(i.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)}`}catch{}}worldStop(){this.media.onWorldStop()}destroy(){this.performanceMonitor?.reset(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.disposeModules(),this.fireworksLegacy.destroy(),super.destroy(),this.skyboxRenderer.dispose(),this.fireworks.dispose()}shouldObjectVisible(e){let r=this.getSectionHeight(),s,o,a,v=this.sceneOrigin.getWorldPosition(e);v?(s=v.x,o=v.y,a=v.z):(s=this.sceneOrigin.toWorldX(e.position.x),o=this.sceneOrigin.toWorldY(e.position.y),a=this.sceneOrigin.toWorldZ(e.position.z));let l=Math.floor(s/16)*16,c=Math.floor(a/16)*16,d=Math.floor(o/r)*r,f=`${l},${c}`,m=`${l},${d},${c}`;return!!this.finishedChunks[f]||!!this.sectionObjects[m]}handleUserClick(e){this.media.handleUserClick(e)}updateSectionOffsets(){let e=performance.now();for(let[i,r]of Object.entries(this.sectionsOffsetsAnimations)){let s=(e-r.time)/1e3;r.time=e,r.currentOffsetX+=r.speedX*s,r.currentOffsetY+=r.speedY*s,r.currentOffsetZ+=r.speedZ*s,r.limitX!==void 0&&(r.speedX>0?r.currentOffsetX=Math.min(r.currentOffsetX,r.limitX):r.currentOffsetX=Math.max(r.currentOffsetX,r.limitX)),r.limitY!==void 0&&(r.speedY>0?r.currentOffsetY=Math.min(r.currentOffsetY,r.limitY):r.currentOffsetY=Math.max(r.currentOffsetY,r.limitY)),r.limitZ!==void 0&&(r.speedZ>0?r.currentOffsetZ=Math.min(r.currentOffsetZ,r.limitZ):r.currentOffsetZ=Math.max(r.currentOffsetZ,r.limitZ));let o=this.sectionObjects[i];o&&(o.position.set(r.currentOffsetX,r.currentOffsetY,r.currentOffsetZ),o.updateMatrix())}}reloadWorld(){this.entities.reloadEntities()}};u(z5,"MAX_SECTION_UPDATE_BUFFER_MS",500);var ce=z5;x();R();M();k();x();R();M();k();function Fr(n,t=!1){return n?.mode?n.mode:t?"worldBlocks":dt.mode}x();R();M();k();x();R();M();k();x();R();M();k();x();R();M();k();function Nr(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}var Rt=[],Le=!1,de,ti=-1;function cv(){!Le||!de||(Le=!1,de.length?Rt=de.concat(Rt):ti=-1,Rt.length&&$o())}function $o(){if(!Le){var n=setTimeout(cv,0);Le=!0;for(var t=Rt.length;t;){for(de=Rt,Rt=[];++ti<t;)de&&de[ti].run();ti=-1,t=Rt.length}de=null,Le=!1,clearTimeout(n)}}function dv(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];Rt.push(new t6(n,t)),Rt.length===1&&!Le&&setTimeout($o,0)}function t6(n,t){this.fun=n,this.array=t}t6.prototype.run=function(){this.fun.apply(null,this.array)};var uv="browser",fv="x64",hv="browser",mv={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},pv=["/usr/bin/node"],gv=[],bv="v16.8.0",yv={},_v=function(n,t){},wv=function(n){Nr("binding")},Av=function(n){return 0},Ev=function(){return"/"},xv=function(n){},Rv={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};function K0(){}var kv=K0,Mv=[];function Tv(n){Nr("_linkedBinding")}var Sv={},Cv=!1,Bv={};function Pv(n){Nr("dlopen")}function Iv(){return[]}function Hv(){return[]}var Ov=K0,zv=K0,Wr=function(){return{}},Dv=Wr,Fv=Wr,Lv=K0,Uv=K0,Gv=K0,Nv={};function Wv(n,t){if(!n)throw new Error(t||"assertion error")}var Vv={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},jv=K0,Yv=K0;function Qv(){return!1}var Kv=K0,Jv=K0,qv=K0,Zv=K0,Xv=K0,$v=void 0,t9=void 0,e9=void 0,i9=K0,r9=2,n9=1,s9="/bin/usr/node",o9=9229,a9="node",v9=[],l9=K0,Lt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Lt.now===void 0&&(Lr=Date.now(),Lt.timing&&Lt.timing.navigationStart&&(Lr=Lt.timing.navigationStart),Lt.now=()=>Date.now()-Lr);var Lr;function c9(){return Lt.now()/1e3}var Ur=1e9;function Gr(n){var t=Math.floor((Date.now()-Lt.now())*.001),e=Lt.now()*.001,i=Math.floor(e)+t,r=Math.floor(e%1*1e9);return n&&(i=i-n[0],r=r-n[1],r<0&&(i--,r+=Ur)),[i,r]}Gr.bigint=function(n){var t=Gr(n);return typeof BigInt>"u"?t[0]*Ur+t[1]:BigInt(t[0]*Ur)+BigInt(t[1])};var d9=10,u9={},f9=0;function Ut(){return Vr}var h9=Ut,m9=Ut,p9=Ut,g9=Ut,b9=Ut,y9=K0,_9=Ut,w9=Ut;function A9(n){return[]}var Vr={version:bv,versions:yv,arch:fv,platform:hv,release:Rv,_rawDebug:kv,moduleLoadList:Mv,binding:wv,_linkedBinding:Tv,_events:u9,_eventsCount:f9,_maxListeners:d9,on:Ut,addListener:h9,once:m9,off:p9,removeListener:g9,removeAllListeners:b9,emit:y9,prependListener:_9,prependOnceListener:w9,listeners:A9,domain:Sv,_exiting:Cv,config:Bv,dlopen:Pv,uptime:c9,_getActiveRequests:Iv,_getActiveHandles:Hv,reallyExit:Ov,_kill:zv,cpuUsage:Wr,resourceUsage:Dv,memoryUsage:Fv,kill:Lv,exit:Uv,openStdin:Gv,allowedNodeEnvironmentFlags:Nv,assert:Wv,features:Vv,_fatalExceptions:jv,setUncaughtExceptionCaptureCallback:Yv,hasUncaughtExceptionCaptureCallback:Qv,emitWarning:_v,nextTick:dv,_tickCallback:Kv,_debugProcess:Jv,_debugEnd:qv,_startProfilerIdleNotifier:Zv,_stopProfilerIdleNotifier:Xv,stdout:$v,stdin:e9,stderr:t9,abort:i9,umask:Av,chdir:xv,cwd:Ev,env:mv,title:uv,argv:pv,execArgv:gv,pid:r9,ppid:n9,execPath:s9,debugPort:o9,hrtime:Gr,argv0:a9,_preload_modules:v9,setSourceMapsEnabled:l9};var jr={},e6=!1;function E9(){if(e6)return jr;e6=!0;var n=Vr;function t(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function e(s,o){for(var a="",v=0,l=-1,c=0,d,f=0;f<=s.length;++f){if(f<s.length)d=s.charCodeAt(f);else{if(d===47)break;d=47}if(d===47){if(!(l===f-1||c===1))if(l!==f-1&&c===2){if(a.length<2||v!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",v=0):(a=a.slice(0,m),v=a.length-1-a.lastIndexOf("/")),l=f,c=0;continue}}else if(a.length===2||a.length===1){a="",v=0,l=f,c=0;continue}}o&&(a.length>0?a+="/..":a="..",v=2)}else a.length>0?a+="/"+s.slice(l+1,f):a=s.slice(l+1,f),v=f-l-1;l=f,c=0}else d===46&&c!==-1?++c:c=-1}return a}function i(s,o){var a=o.dir||o.root,v=o.base||(o.name||"")+(o.ext||"");return a?a===o.root?a+v:a+s+v:v}var r={resolve:function(){for(var o="",a=!1,v,l=arguments.length-1;l>=-1&&!a;l--){var c;l>=0?c=arguments[l]:(v===void 0&&(v=n.cwd()),c=v),t(c),c.length!==0&&(o=c+"/"+o,a=c.charCodeAt(0)===47)}return o=e(o,!a),a?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(t(o),o.length===0)return".";var a=o.charCodeAt(0)===47,v=o.charCodeAt(o.length-1)===47;return o=e(o,!a),o.length===0&&!a&&(o="."),o.length>0&&v&&(o+="/"),a?"/"+o:o},isAbsolute:function(o){return t(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,a=0;a<arguments.length;++a){var v=arguments[a];t(v),v.length>0&&(o===void 0?o=v:o+="/"+v)}return o===void 0?".":r.normalize(o)},relative:function(o,a){if(t(o),t(a),o===a||(o=r.resolve(o),a=r.resolve(a),o===a))return"";for(var v=1;v<o.length&&o.charCodeAt(v)===47;++v);for(var l=o.length,c=l-v,d=1;d<a.length&&a.charCodeAt(d)===47;++d);for(var f=a.length,m=f-d,g=c<m?c:m,b=-1,A=0;A<=g;++A){if(A===g){if(m>g){if(a.charCodeAt(d+A)===47)return a.slice(d+A+1);if(A===0)return a.slice(d+A)}else c>g&&(o.charCodeAt(v+A)===47?b=A:A===0&&(b=0));break}var _=o.charCodeAt(v+A),w=a.charCodeAt(d+A);if(_!==w)break;_===47&&(b=A)}var T="";for(A=v+b+1;A<=l;++A)(A===l||o.charCodeAt(A)===47)&&(T.length===0?T+="..":T+="/..");return T.length>0?T+a.slice(d+b):(d+=b,a.charCodeAt(d)===47&&++d,a.slice(d))},_makeLong:function(o){return o},dirname:function(o){if(t(o),o.length===0)return".";for(var a=o.charCodeAt(0),v=a===47,l=-1,c=!0,d=o.length-1;d>=1;--d)if(a=o.charCodeAt(d),a===47){if(!c){l=d;break}}else c=!1;return l===-1?v?"/":".":v&&l===1?"//":o.slice(0,l)},basename:function(o,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');t(o);var v=0,l=-1,c=!0,d;if(a!==void 0&&a.length>0&&a.length<=o.length){if(a.length===o.length&&a===o)return"";var f=a.length-1,m=-1;for(d=o.length-1;d>=0;--d){var g=o.charCodeAt(d);if(g===47){if(!c){v=d+1;break}}else m===-1&&(c=!1,m=d+1),f>=0&&(g===a.charCodeAt(f)?--f===-1&&(l=d):(f=-1,l=m))}return v===l?l=m:l===-1&&(l=o.length),o.slice(v,l)}else{for(d=o.length-1;d>=0;--d)if(o.charCodeAt(d)===47){if(!c){v=d+1;break}}else l===-1&&(c=!1,l=d+1);return l===-1?"":o.slice(v,l)}},extname:function(o){t(o);for(var a=-1,v=0,l=-1,c=!0,d=0,f=o.length-1;f>=0;--f){var m=o.charCodeAt(f);if(m===47){if(!c){v=f+1;break}continue}l===-1&&(c=!1,l=f+1),m===46?a===-1?a=f:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||l===-1||d===0||d===1&&a===l-1&&a===v+1?"":o.slice(a,l)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return i("/",o)},parse:function(o){t(o);var a={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return a;var v=o.charCodeAt(0),l=v===47,c;l?(a.root="/",c=1):c=0;for(var d=-1,f=0,m=-1,g=!0,b=o.length-1,A=0;b>=c;--b){if(v=o.charCodeAt(b),v===47){if(!g){f=b+1;break}continue}m===-1&&(g=!1,m=b+1),v===46?d===-1?d=b:A!==1&&(A=1):d!==-1&&(A=-1)}return d===-1||m===-1||A===0||A===1&&d===m-1&&d===f+1?m!==-1&&(f===0&&l?a.base=a.name=o.slice(1,m):a.base=a.name=o.slice(f,m)):(f===0&&l?(a.name=o.slice(1,d),a.base=o.slice(1,m)):(a.name=o.slice(f,d),a.base=o.slice(f,m)),a.ext=o.slice(d,m)),f>0?a.dir=o.slice(0,f-1):l&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,jr=r,jr}var J0=E9();var lT=J0._makeLong,cT=J0.basename,dT=J0.delimiter,uT=J0.dirname,fT=J0.extname,hT=J0.format,mT=J0.isAbsolute,Yr=J0.join,pT=J0.normalize,gT=J0.parse,bT=J0.posix,yT=J0.relative,_T=J0.resolve,wT=J0.sep,AT=J0.win32;import*as a0 from"three";var Qr=new Date,i6=Qr.getMonth()===11&&Qr.getDate()>=24&&Qr.getDate()<=26,x9=["panorama_3.webp","panorama_1.webp","panorama_4.webp","panorama_5.webp","panorama_0.webp","panorama_2.webp"],R9=200,Ue=class{constructor(t){this.documentRenderer=t;u(this,"scene");u(this,"camera");u(this,"startTimes",new Map);u(this,"time",0);u(this,"panoramaGroup",null);this.scene=new a0.Scene,this.scene.background=new a0.Color(3294568);let e=new a0.AmbientLight(13421772);this.scene.add(e);let i=new a0.DirectionalLight(16777215,.5);i.position.set(1,1,.5).normalize(),i.castShadow=!0,this.scene.add(i),this.camera=new a0.PerspectiveCamera(85,t.canvas.width/t.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}async init(){this.buildCubemap()}update(t,e){e&&$t(this.camera,this.documentRenderer.canvas)}dispose(){this.scene.clear(),this.panoramaGroup=null,this.startTimes.clear()}buildCubemap(){let t=new a0.BoxGeometry(1e3,1e3,1e3),e=[];for(let s of x9)(async()=>{let{texture:a}=X5(Yr("background",i6?"christmas":"",s));a.matrixAutoUpdate=!1,a.matrix.set(-1,0,1,0,1,0,0,0,1),a.wrapS=a0.ClampToEdgeWrapping,a.wrapT=a0.ClampToEdgeWrapping,a.minFilter=a0.LinearFilter,a.magFilter=a0.LinearFilter;let v=new a0.MeshBasicMaterial({map:a,transparent:!0,side:a0.DoubleSide,depthWrite:!1,opacity:0});this.startTimes.set(v,Date.now()),e.push(v)})();let i=new a0.Mesh(t,e);i.onBeforeRender=()=>{this.time+=.01,i.rotation.y=Math.PI+this.time*.01,i.rotation.z=Math.sin(-this.time*.001)*.001;for(let s of e){let o=this.startTimes.get(s);if(o){let a=Date.now()-o;s.opacity=Math.min(1,a/R9)}}};let r=new a0.Object3D;if(r.add(i),!i6)for(let s=0;s<20;s++){let o=new xt("1.16.4","squid").mesh;o.position.set(Math.random()*30-15,Math.random()*20-10,Math.random()*10-17),o.rotation.set(0,Math.PI+Math.random(),-Math.PI/4,"ZYX");let a=Math.random()*.01;o.children[0].onBeforeRender=()=>{o.rotation.y+=a,o.rotation.z=Math.cos(i.rotation.y*3)*Math.PI/4-Math.PI/2},r.add(o)}this.scene.add(r),this.panoramaGroup=r}async debugImageInFrontOfCamera(){let t=await St(Yr("background","panorama_0.webp")),e=new a0.Mesh(new a0.PlaneGeometry(1e3,1e3),new a0.MeshBasicMaterial({map:t}));e.position.set(0,0,-500),this.scene.add(e)}};x();R();M();k();import*as Ne from"three";import{Vec3 as n6}from"vec3";x();R();M();k();import k9 from"prismarine-world";import M9 from"prismarine-chunk";var r6=n=>{let t=k9(n),e=M9(n),i=new t(n).sync,r=T9(i);for(let s of r)if(s.startsWith("set")&&s!=="setColumn"){let o=i[s].bind(i);i[s]=(...a)=>{let v=a[0];v.x!==void 0&&!i.getColumnAt(v)&&i.setColumn(Math.floor(v.x/16),Math.floor(v.z/16),new e(void 0)),o(...a)}}return i};function T9(n){let t=new Set,e=n;do for(let i of Object.getOwnPropertyNames(e))typeof n[i]=="function"&&i!=="constructor"&&t.add(i);while(e=Object.getPrototypeOf(e));return[...t]}var Ge=class{constructor(t,e,i){this.documentRenderer=t;this.options=e;this.abortSignal=i;u(this,"_scene");u(this,"_camera");u(this,"worldRenderer");u(this,"WorldRendererClass",ce);this._scene=new Ne.Scene,this._scene.background=new Ne.Color(3294568),this._camera=new Ne.PerspectiveCamera(85,t.canvas.width/t.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}get scene(){return this._scene}get camera(){return this._camera}async init(){let t=we,e=new lt;if(e.currentConfig={version:t,noInventoryGui:!0},await e.updateAssetsData?.({}),this.abortSignal.aborted)return;let i=r6(t),s=m6("prismarine-block")(t),a=globalThis.mcData.blocksArray.filter(m=>{if(!m.name.includes("stained_glass"))return!1;let g=s.fromStateId(m.defaultState,0);if(g.shapes?.length!==1)return!1;let b=g.shapes[0];return b[0]===0&&b[1]===0&&b[2]===0&&b[3]===1&&b[4]===1&&b[5]===1}),v=-15,l=100,c=100;for(let m=-l;m<l;m++)for(let g=-c;g<c;g++){let b=a[Math.floor(Math.random()*a.length)];i.setBlockStateId(new n6(m,g,v),b.defaultState)}this._camera.updateProjectionMatrix(),this._camera.position.set(.5,c/2+.5,.5),this._camera.rotation.set(0,0,0);let d=new n6(...this._camera.position.toArray()),f=new Zt(i,2,d);this.abortSignal.aborted||(this.worldRenderer=new this.WorldRendererClass(this.documentRenderer.renderer,this.options,{version:t,worldView:f,inWorldRenderingConfig:Ze,playerStateReactive:A2().reactive,rendererState:Qt().reactive,nonReactiveState:Qt().nonReactive,resourcesManager:e}),this.worldRenderer instanceof ce&&(this._scene=this.worldRenderer.realScene,this._camera=this.worldRenderer.camera),f.init(d),await this.worldRenderer.waitForChunksToRender(),!this.abortSignal.aborted&&this.setupMouseParallax())}update(t,e){e&&$t(this.camera,this.documentRenderer.canvas)}dispose(){this.worldRenderer?.destroy(),this.worldRenderer=void 0,this._scene.clear()}setupMouseParallax(){let t=this._camera,e=t.position.x,i=t.position.y,r;document.body.addEventListener("pointermove",s=>{if(s.pointerType!=="mouse")return;let o=.2,a=s.clientX/window.innerWidth-.5,v=-(s.clientY/window.innerHeight-.5);r?.stop(),r=new O0(t.position).to({x:e+a*o,y:i+v*o},0),r.start(),t.updateProjectionMatrix()},{signal:this.abortSignal})}};x();R();M();k();import*as s6 from"three";var We=class{constructor(t,e,i={},r=!1){this.documentRenderer=t;this.options=e;u(this,"active");u(this,"abortController",new AbortController);u(this,"mode");u(this,"lastFrameTime",0);this.mode=Fr(i,r)}get futuristic(){return this.active instanceof te?this.active:void 0}get scene(){return this.active?.scene}get camera(){return this.active?.camera}async start(t={}){this.active=this.createImplementation(t),await this.active.init(),this.active.scene.background instanceof s6.Color&&this.documentRenderer.renderer.setClearColor(this.active.scene.background),this.lastFrameTime=performance.now(),this.documentRenderer.render=(e=!1)=>{let i=performance.now(),r=Math.min((i-this.lastFrameTime)/1e3,.05);this.lastFrameTime=i;let s=this.active;s&&(s.update(r,e),this.documentRenderer.renderer.render(s.scene,s.camera))}}createImplementation(t){switch(this.mode){case"futuristic":return new te(this.documentRenderer,{useMinecraftTextures:t.useMinecraftTextures,initialScene:t.futuristicScene,initialCamera:t.futuristicCamera,initialBlockGroup:t.futuristicBlockGroup,initialCameraSpeed:t.futuristicCameraSpeed,initialBlockSpeed:t.futuristicBlockSpeed,resourcesManager:t.resourcesManager},this.abortController.signal);case"worldBlocks":return new Ge(this.documentRenderer,this.options,this.abortController.signal);default:return new Ue(this.documentRenderer)}}dispose(){this.active?.dispose(),this.active=void 0,this.abortController.abort()}};D5.ColorManagement.enabled=!1;globalThis.THREE=D5;var o6=n=>({updateMap:n.entities.updateMap.bind(n.entities),updateCustomBlock:n.updateCustomBlock.bind(n),getBlockInfo:n.getBlockInfo.bind(n),playEntityAnimation:n.entities.playAnimation.bind(n.entities),damageEntity:n.entities.handleDamageEvent.bind(n.entities),updatePlayerSkin:n.entities.updatePlayerSkin.bind(n.entities),changeHandSwingingState:n.changeHandSwingingState.bind(n),getHighestBlocks:n.getHighestBlocks.bind(n),reloadWorld:n.reloadWorld.bind(n),updateEntityModel:n.entities.updateEntityModel.bind(n.entities),playEntityModelAnimation:n.entities.playEntityModelAnimation.bind(n.entities),addMedia:n.media.addMedia.bind(n.media),destroyMedia:n.media.destroyMedia.bind(n.media),setControlMode:n.media.setControlMode.bind(n.media),setVideoPlaying:n.media.setVideoPlaying.bind(n.media),setVideoSeeking:n.media.setVideoSeeking.bind(n.media),setVideoVolume:n.media.setVideoVolume.bind(n.media),setVideoSpeed:n.media.setVideoSpeed.bind(n.media),handleUserClick:n.media.handleUserClick.bind(n.media),addSectionAnimation(t,e){n.sectionsOffsetsAnimations[t]=e},removeSectionAnimation(t){delete n.sectionsOffsetsAnimations[t]},shakeFromDamage:n.cameraShake.shakeFromDamage.bind(n.cameraShake),onPageInteraction:n.media.onPageInteraction.bind(n.media),downloadMesherLog:n.downloadMesherLog.bind(n),explodeFirework:n.fireworksLegacy.explode.bind(n.fireworksLegacy),explodeFireworkFacingCamera:n.fireworksLegacy.explodeFacingCamera.bind(n.fireworksLegacy),addWaypoint:n.waypoints.addWaypoint.bind(n.waypoints),removeWaypoint:n.waypoints.removeWaypoint.bind(n.waypoints),startCinimaticScript:n.cinimaticScript.startScript.bind(n.cinimaticScript),stopCinimaticScript:n.cinimaticScript.stopScript.bind(n.cinimaticScript),launchFirework:n.fireworks.launchFirework.bind(n.fireworks),setSkyboxImage:n.skyboxRenderer.setSkyboxImage.bind(n.skyboxRenderer),setRain:t=>n.toggleModule("rain",t),spawnBlockBreakParticles(t,e,i,r,s,o){n.getModule("blockBreakParticles")?.spawnBlockBreakParticles(t,e,i,r,s,o)},spawnBlockCrackParticle(t,e,i,r,s,o,a){n.getModule("blockBreakParticles")?.spawnCrackParticle(t,e,i,r,s,o,a)},async loadGeometryExport(t){let{applyWorldGeometryExport:e}=await Promise.resolve().then(()=>(Mr(),Io));return e(n,t)},feedChunkPacket(t){let{kind:e,...i}=t,r={type:e,...i};for(let s of n.workers)s.postMessage(r)}}),C9=[],ei=(n,...t)=>{for(let e of Object.values(globalThis.loadedMods??{}))try{e.threeJsBackendModule?.[n]?.(...t)}catch(i){let r=`[mod three.js] Error calling ${n} on ${e.name}: ${i}`;throw new Error(r)}},a6=()=>{let n,t=null,e=null,i=null,r=null,s=(c,d)=>{R0?n=r1(c,C9,globalThis):n=c,t=new l5(n,d?.canvas),globalThis.renderer=t.renderer,globalThis.documentRenderer=t,globalThis.threeJsBackend=l,ei("default",l)},o=async c=>{if(!t)throw new Error("Document renderer not initialized");if(!i&&!e){let d={...n.config.menuBackground,...c};e=new We(t,{...n},d,!!D.env.SINGLE_FILE_BUILD_MODE),ei("menuBackgroundCreated",e),await e.start(d),ei("menuBackgroundReady",e)}},a=async c=>{let f=R0?r1(c,[lt,qt],globalThis):c;if(!t)throw new Error("Document renderer not initialized");t.nonReactiveState=f.nonReactiveState,globalThis.resourcesManager=f.resourcesManager,e&&(e.dispose(),e=null),i=new ce(t.renderer,n,f),await i.worldReadyPromise,r=new n1(f.nonReactiveState),globalThis.frameTimingCollector=r;let m=t.render;t.render=function(g){m.call(this,g),r?.markFrameStart(),f.inWorldRenderingConfig.paused||i?.render(g),r?.markFrameEnd(),r?.markFrameDisplay()},t.inWorldRenderingConfig=f.inWorldRenderingConfig,globalThis.world=i,ei("worldReady",i)},v=()=>{e&&(e.dispose(),e=null),t&&t.dispose(),i&&(i.destroy(),i=null)},l={id:"threejs",displayName:`three.js ${D5.REVISION}`,startMenuBackground:o,startWorld:a,disconnect:v,setRendering(c){t.setPaused(!c),i&&(i.renderingActive=c)},getMenuBackground:()=>e??void 0,getDebugOverlay:()=>({get entitiesString(){return i?.entities.getDebugString()},get left(){return{"Geo Memory":i?.chunkMeshManager.getEstimatedMemoryUsage().total??"-"}}}),updateCamera(c,d,f){r?.markCameraUpdate(!c),i?.setFirstPersonCamera(c,d,f)},get soundSystem(){return i?.soundSystem},get backendMethods(){if(i)return o6(i)}};return{main:{init:s,backend:l},workerProxy(){return F2({init(c,d){s(c,{canvas:d})},updateSizeExternal(c,d,f){t?.updateSizeExternal(c,d,f)},startMenuBackground:o,startWorld:a,disconnect:v,setRendering:l.setRendering,updateCamera(c,d,f){let m=c?new S9(c.x,c.y,c.z):null;r?.markCameraUpdate(!m),l.updateCamera(m,d,f)},async callBackendMethod(c,...d){if(!i)throw new Error("World renderer not initialized");let m=o6(i)[c];if(!m)throw new Error(`Backend method ${String(c)} is unavailable`);return m(...d)}})}}};var ii=n=>{let{main:t}=a6();return t.init(n),t.backend};ii.id="threejs";ii.displayName="three.js Blocking";ii.description="Simple, old and stable main thread graphics backend providing balanced performance on top of WebGL2.";x();R();M();k();import*as v6 from"three";function B9(n){let t="threeWorker.js",e;if(D.env.SINGLE_FILE_BUILD){let i=document.getElementById("three-worker-code").textContent,r=new Blob([i],{type:"text/javascript"});e=new Worker(window.URL.createObjectURL(r))}else e=new Worker(t);return e.onmessage=({data:i})=>{n(i)},e.on&&e.on("message",i=>{e.onmessage({data:i})}),e}var ri=async n=>{let t=B9(()=>{}),e=L2(t),i=Si();i.onSizeChanged((a,v)=>{e.updateSizeExternal(a,v,window.devicePixelRatio||1)});let r=i1(n,t);try{e.init(r,i.canvas)}catch(a){throw r5(r),a}let s=new Proxy({},{get(a,v){if(typeof v=="string")return async(...l)=>e.callBackendMethod(v,...l)}});return{id:"threejs",displayName:`three.js ${v6.REVISION}`,async startMenuBackground(){},async startWorld(a){let v={...s5,items:"itemsArray",entities:"entitiesArray"};Hi([t],a.version,v,a.resourcesManager.currentResources.mcData),a.inWorldRenderingConfig.__syncToWorker=!0,a.playerStateReactive&&(a.playerStateReactive.__syncToWorker=!0),a.rendererState&&(a.rendererState.__syncFromWorker=!0),a.nonReactiveState&&(a.nonReactiveState.__syncFromWorker=!0),a.nonReactiveState.__syncFromWorkerInterval=200;let l=i1(a,t);try{await e.startWorld(structuredClone(l))}catch(d){throw r5(l),d}e.updateSizeExternal(i.size.width,i.size.height,window.devicePixelRatio||1);let c=Ee("fps");setInterval(()=>{let{fps:d,avgRenderTime:f,worstRenderTime:m}=a.nonReactiveState;c.updateText(`FPS: ${d.toFixed(0)} (${f.toFixed(0)}ms/${m.toFixed(0)}ms)`),a.nonReactiveState.fps=0},1e3)},disconnect(){i.destroy(),e.disconnect(),t.terminate()},setRendering(a){e.setRendering(a)},updateCamera(a,v,l){e.updateCamera(a?{x:a.x,y:a.y,z:a.z}:null,v,l)},soundSystem:void 0,backendMethods:s}};ri.id="threejs-off-thread";ri.displayName="three.js Multi-thread";ri.description=["Edge-cutting technology that uses a dedicated thread for graphics.","Slightly higher power and RAM usage.","More stable FPS (mid-range devices), but possible inputlag if TPS is low.","On low-end devices it might result in device throttling and stuttering."].join(" ");export{T2 as AppViewer,Ue as ClassicMenuBackground,l5 as DocumentRenderer,a5 as FUTURISTIC_CAMERA_IDS,d1 as FUTURISTIC_CAMERA_LABELS,o5 as FUTURISTIC_SCENE_IDS,c1 as FUTURISTIC_SCENE_LABELS,te as FuturisticMenuBackground,ci as HIGH_TEXTURE_COUNT,Y5 as LONG_RENDER_TIME_MS,li as LOW_FPS_THRESHOLD,ge as LoadedResourcesTransferrable,c5 as MC_RENDERER_DEBUG_OVERLAY_CLASS,we as MENU_BACKGROUND_MC_VERSION,t5 as MENU_BACKGROUND_MOTION_DEFAULTS,dt as MENU_BACKGROUND_OPTION_DEFAULTS,Ri as MINECRAFT_BLOCK_GROUPS,v5 as MINECRAFT_BLOCK_GROUP_IDS,u1 as MINECRAFT_BLOCK_GROUP_LABELS,We as MenuBackgroundRenderer,qe as PerformanceMonitor,Z2 as RENDERER_DEFAULT_OPTIONS,X2 as RENDERER_OPTIONS_META,$2 as RENDERER_RENDER_GUI_SECTIONS,lt as ResourcesManager,Ge as WorldBlocksMenuBackground,Zt as WorldView,qt as WorldViewWorker,Si as addCanvasForWorker,ta as applyMenuBackgroundLiveOptions,Pu as applyRendererEnableLighting,sa as applyRendererOptions,Cu as applyRendererWorldViewOptions,pe as chunkPos,ri as createGraphicsBackendOffThread,ii as createGraphicsBackendSingleThread,Ul as createWorldRendererConfig,_2 as defaultGraphicsBackendConfig,vi as defaultPerformanceInstabilityFactors,Ze as defaultWorldRendererConfig,x2 as delayedIterator,di as formatPerformanceFactorsDebug,Qt as getDefaultRendererState,P2 as getInitialPlayerState,va as getInitialPlayerStateRenderer,aa as getPlayerStateUtils,R0 as isWebWorker,Su as menuBackgroundOptionsFromStorage,bt as menuBackgroundSpeedToMultiplier,T6 as sectionPos,Bu as subscribeRendererOptions};
|
|
21237
21237
|
/*! Bundled license information:
|
|
21238
21238
|
|
|
21239
21239
|
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|