minecraft-renderer 0.1.64 → 0.1.65
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/dist/minecraft-renderer.js +60 -60
- package/dist/minecraft-renderer.js.meta.json +1 -1
- package/dist/threeWorker.js +411 -411
- package/package.json +1 -1
- package/src/three/entities.ts +39 -160
- package/src/three/entity/animations.js +92 -185
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var qa=Object.create;var v5=Object.defineProperty;var Xa=Object.getOwnPropertyDescriptor;var $a=Object.getOwnPropertyNames;var e6=Object.getPrototypeOf,t6=Object.prototype.hasOwnProperty;var r6=(n,e,t)=>e in n?v5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i6=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var $e=(n,e)=>()=>(n&&(e=n(n=0)),e);var i0=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),$5=(n,e)=>{for(var t in e)v5(n,t,{get:e[t],enumerable:!0})},yn=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $a(e))!t6.call(n,i)&&i!==t&&v5(n,i,{get:()=>e[i],enumerable:!(r=Xa(e,i))||r.enumerable});return n};var l5=(n,e,t)=>(t=n!=null?qa(e6(n)):{},yn(e||!n||!n.__esModule?v5(t,"default",{value:n,enumerable:!0}):t,n)),n6=n=>yn(v5({},"__esModule",{value:!0}),n);var d=(n,e,t)=>(r6(n,typeof e!="symbol"?e+"":e,t),t);var E=$e(()=>{});var x=$e(()=>{});var D={};$5(D,{_debugEnd:()=>v2,_debugProcess:()=>a2,_events:()=>x2,_eventsCount:()=>R2,_exiting:()=>Vn,_fatalExceptions:()=>i2,_getActiveHandles:()=>Yn,_getActiveRequests:()=>jn,_kill:()=>Kn,_linkedBinding:()=>Un,_maxListeners:()=>E2,_preload_modules:()=>_2,_rawDebug:()=>zn,_startProfilerIdleNotifier:()=>l2,_stopProfilerIdleNotifier:()=>c2,_tickCallback:()=>o2,abort:()=>h2,addListener:()=>k2,allowedNodeEnvironmentFlags:()=>e2,arch:()=>xn,argv:()=>Tn,argv0:()=>y2,assert:()=>t2,binding:()=>Pn,browser:()=>Fn,chdir:()=>On,config:()=>Wn,cpuUsage:()=>r1,cwd:()=>Hn,debugPort:()=>b2,default:()=>O2,dlopen:()=>Nn,domain:()=>Gn,emit:()=>B2,emitWarning:()=>Bn,env:()=>kn,execArgv:()=>Mn,execPath:()=>g2,exit:()=>Xn,features:()=>r2,hasUncaughtExceptionCaptureCallback:()=>s2,hrtime:()=>t1,kill:()=>qn,listeners:()=>H2,memoryUsage:()=>Zn,moduleLoadList:()=>Ln,nextTick:()=>wn,off:()=>M2,on:()=>E0,once:()=>T2,openStdin:()=>$n,pid:()=>m2,platform:()=>Rn,ppid:()=>p2,prependListener:()=>P2,prependOnceListener:()=>I2,reallyExit:()=>Qn,release:()=>Dn,removeAllListeners:()=>C2,removeListener:()=>S2,resourceUsage:()=>Jn,setSourceMapsEnabled:()=>w2,setUncaughtExceptionCaptureCallback:()=>n2,stderr:()=>u2,stdin:()=>f2,stdout:()=>d2,title:()=>En,umask:()=>In,uptime:()=>A2,version:()=>Sn,versions:()=>Cn});function wr(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function s6(){!Tt||!Q0||(Tt=!1,Q0.length?A0=Q0.concat(A0):e1=-1,A0.length&&_n())}function _n(){if(!Tt){var n=setTimeout(s6,0);Tt=!0;for(var e=A0.length;e;){for(Q0=A0,A0=[];++e1<e;)Q0&&Q0[e1].run();e1=-1,e=A0.length}Q0=null,Tt=!1,clearTimeout(n)}}function wn(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];A0.push(new An(n,e)),A0.length===1&&!Tt&&setTimeout(_n,0)}function An(n,e){this.fun=n,this.array=e}function Ne(){}function Un(n){wr("_linkedBinding")}function Nn(n){wr("dlopen")}function jn(){return[]}function Yn(){return[]}function t2(n,e){if(!n)throw new Error(e||"assertion error")}function s2(){return!1}function A2(){return B0.now()/1e3}function t1(n){var e=Math.floor((Date.now()-B0.now())*.001),t=B0.now()*.001,r=Math.floor(t)+e,i=Math.floor(t%1*1e9);return n&&(r=r-n[0],i=i-n[1],i<0&&(r--,i+=_r)),[r,i]}function E0(){return O2}function H2(n){return[]}var A0,Tt,Q0,e1,En,xn,Rn,kn,Tn,Mn,Sn,Cn,Bn,Pn,In,Hn,On,Dn,Fn,zn,Ln,Gn,Vn,Wn,Qn,Kn,r1,Jn,Zn,qn,Xn,$n,e2,r2,i2,n2,o2,a2,v2,l2,c2,d2,u2,f2,h2,m2,p2,g2,b2,y2,_2,w2,B0,yr,_r,E2,x2,R2,k2,T2,M2,S2,C2,B2,P2,I2,O2,D2=$e(()=>{E();x();k();R();A0=[],Tt=!1,e1=-1;An.prototype.run=function(){this.fun.apply(null,this.array)};En="browser",xn="x64",Rn="browser",kn={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Tn=["/usr/bin/node"],Mn=[],Sn="v16.8.0",Cn={},Bn=function(n,e){},Pn=function(n){wr("binding")},In=function(n){return 0},Hn=function(){return"/"},On=function(n){},Dn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};Fn=!0,zn=Ne,Ln=[];Gn={},Vn=!1,Wn={};Qn=Ne,Kn=Ne,r1=function(){return{}},Jn=r1,Zn=r1,qn=Ne,Xn=Ne,$n=Ne,e2={};r2={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},i2=Ne,n2=Ne;o2=Ne,a2=Ne,v2=Ne,l2=Ne,c2=Ne,d2=void 0,u2=void 0,f2=void 0,h2=Ne,m2=2,p2=1,g2="/bin/usr/node",b2=9229,y2="node",_2=[],w2=Ne,B0={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};B0.now===void 0&&(yr=Date.now(),B0.timing&&B0.timing.navigationStart&&(yr=B0.timing.navigationStart),B0.now=()=>Date.now()-yr);_r=1e9;t1.bigint=function(n){var e=t1(n);return typeof BigInt>"u"?e[0]*_r+e[1]:BigInt(e[0]*_r)+BigInt(e[1])};E2=10,x2={},R2=0;k2=E0,T2=E0,M2=E0,S2=E0,C2=E0,B2=Ne,P2=E0,I2=E0;O2={version:Sn,versions:Cn,arch:xn,platform:Rn,browser:Fn,release:Dn,_rawDebug:zn,moduleLoadList:Ln,binding:Pn,_linkedBinding:Un,_events:x2,_eventsCount:R2,_maxListeners:E2,on:E0,addListener:k2,once:T2,off:M2,removeListener:S2,removeAllListeners:C2,emit:B2,prependListener:P2,prependOnceListener:I2,listeners:H2,domain:Gn,_exiting:Vn,config:Wn,dlopen:Nn,uptime:A2,_getActiveRequests:jn,_getActiveHandles:Yn,reallyExit:Qn,_kill:Kn,cpuUsage:r1,resourceUsage:Jn,memoryUsage:Zn,kill:qn,exit:Xn,openStdin:$n,allowedNodeEnvironmentFlags:e2,assert:t2,features:r2,_fatalExceptions:i2,setUncaughtExceptionCaptureCallback:n2,hasUncaughtExceptionCaptureCallback:s2,emitWarning:Bn,nextTick:wn,_tickCallback:o2,_debugProcess:a2,_debugEnd:v2,_startProfilerIdleNotifier:l2,_stopProfilerIdleNotifier:c2,stdout:d2,stdin:f2,stderr:u2,abort:h2,umask:In,chdir:On,cwd:Hn,env:kn,title:En,argv:Tn,execArgv:Mn,pid:m2,ppid:p2,execPath:g2,debugPort:b2,hrtime:t1,argv0:y2,_preload_modules:_2,setSourceMapsEnabled:w2}});var R=$e(()=>{D2()});function o6(){if(F2)return c5;F2=!0,c5.byteLength=v,c5.toByteArray=l,c5.fromByteArray=f;for(var n=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)n[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(p){var g=p.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=p.indexOf("=");y===-1&&(y=g);var A=y===g?0:4-y%4;return[y,A]}function v(p){var g=o(p),y=g[0],A=g[1];return(y+A)*3/4-A}function a(p,g,y){return(g+y)*3/4-y}function l(p){var g,y=o(p),A=y[0],b=y[1],_=new t(a(p,A,b)),S=0,C=b>0?A-4:A,M;for(M=0;M<C;M+=4)g=e[p.charCodeAt(M)]<<18|e[p.charCodeAt(M+1)]<<12|e[p.charCodeAt(M+2)]<<6|e[p.charCodeAt(M+3)],_[S++]=g>>16&255,_[S++]=g>>8&255,_[S++]=g&255;return b===2&&(g=e[p.charCodeAt(M)]<<2|e[p.charCodeAt(M+1)]>>4,_[S++]=g&255),b===1&&(g=e[p.charCodeAt(M)]<<10|e[p.charCodeAt(M+1)]<<4|e[p.charCodeAt(M+2)]>>2,_[S++]=g>>8&255,_[S++]=g&255),_}function c(p){return n[p>>18&63]+n[p>>12&63]+n[p>>6&63]+n[p&63]}function u(p,g,y){for(var A,b=[],_=g;_<y;_+=3)A=(p[_]<<16&16711680)+(p[_+1]<<8&65280)+(p[_+2]&255),b.push(c(A));return b.join("")}function f(p){for(var g,y=p.length,A=y%3,b=[],_=16383,S=0,C=y-A;S<C;S+=_)b.push(u(p,S,S+_>C?C:S+_));return A===1?(g=p[y-1],b.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(p[y-2]<<8)+p[y-1],b.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),b.join("")}return c5}function a6(){if(z2)return i1;z2=!0;return i1.read=function(n,e,t,r,i){var s,o,v=i*8-r-1,a=(1<<v)-1,l=a>>1,c=-7,u=t?i-1:0,f=t?-1:1,p=n[e+u];for(u+=f,s=p&(1<<-c)-1,p>>=-c,c+=v;c>0;s=s*256+n[e+u],u+=f,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+u],u+=f,c-=8);if(s===0)s=1-l;else{if(s===a)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(p?-1:1)*o*Math.pow(2,s-r)},i1.write=function(n,e,t,r,i,s){var o,v,a,l=s*8-i-1,c=(1<<l)-1,u=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,g=r?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(v=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+u>=1?e+=f/a:e+=f*Math.pow(2,1-u),e*a>=2&&(o++,a/=2),o+u>=c?(v=0,o=c):o+u>=1?(v=(e*a-1)*Math.pow(2,i),o=o+u):(v=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;n[t+p]=v&255,p+=g,v/=256,i-=8);for(o=o<<i|v,l+=i;l>0;n[t+p]=o&255,p+=g,o/=256,l-=8);n[t+p-g]|=y*128},i1}function U2(){if(L2)return K0;L2=!0;let n=o6(),e=a6(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;K0.Buffer=o,K0.SlowBuffer=b,K0.INSPECT_MAX_BYTES=50;let r=2147483647;K0.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u";function i(){try{let w=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(w,h),w.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(w){if(w>r)throw new RangeError('The value "'+w+'" is invalid for option "size"');let h=new Uint8Array(w);return Object.setPrototypeOf(h,o.prototype),h}function o(w,h,m){if(typeof w=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(w)}return v(w,h,m)}o.poolSize=8192;function v(w,h,m){if(typeof w=="string")return u(w,h);if(ArrayBuffer.isView(w))return p(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(Se(w,ArrayBuffer)||w&&Se(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(w,SharedArrayBuffer)||w&&Se(w.buffer,SharedArrayBuffer)))return g(w,h,m);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let T=w.valueOf&&w.valueOf();if(T!=null&&T!==w)return o.from(T,h,m);let I=y(w);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return o.from(w[Symbol.toPrimitive]("string"),h,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}o.from=function(w,h,m){return v(w,h,m)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function a(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function l(w,h,m){return a(w),w<=0?s(w):h!==void 0?typeof m=="string"?s(w).fill(h,m):s(w).fill(h):s(w)}o.alloc=function(w,h,m){return l(w,h,m)};function c(w){return a(w),s(w<0?0:A(w)|0)}o.allocUnsafe=function(w){return c(w)},o.allocUnsafeSlow=function(w){return c(w)};function u(w,h){if((typeof h!="string"||h==="")&&(h="utf8"),!o.isEncoding(h))throw new TypeError("Unknown encoding: "+h);let m=_(w,h)|0,T=s(m),I=T.write(w,h);return I!==m&&(T=T.slice(0,I)),T}function f(w){let h=w.length<0?0:A(w.length)|0,m=s(h);for(let T=0;T<h;T+=1)m[T]=w[T]&255;return m}function p(w){if(Se(w,Uint8Array)){let h=new Uint8Array(w);return g(h.buffer,h.byteOffset,h.byteLength)}return f(w)}function g(w,h,m){if(h<0||w.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<h+(m||0))throw new RangeError('"length" is outside of buffer bounds');let T;return h===void 0&&m===void 0?T=new Uint8Array(w):m===void 0?T=new Uint8Array(w,h):T=new Uint8Array(w,h,m),Object.setPrototypeOf(T,o.prototype),T}function y(w){if(o.isBuffer(w)){let h=A(w.length)|0,m=s(h);return m.length===0||w.copy(m,0,0,h),m}if(w.length!==void 0)return typeof w.length!="number"||Rt(w.length)?s(0):f(w);if(w.type==="Buffer"&&Array.isArray(w.data))return f(w.data)}function A(w){if(w>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return w|0}function b(w){return+w!=w&&(w=0),o.alloc(+w)}o.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==o.prototype},o.compare=function(h,m){if(Se(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),Se(m,Uint8Array)&&(m=o.from(m,m.offset,m.byteLength)),!o.isBuffer(h)||!o.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===m)return 0;let T=h.length,I=m.length;for(let F=0,V=Math.min(T,I);F<V;++F)if(h[F]!==m[F]){T=h[F],I=m[F];break}return T<I?-1:I<T?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,m){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return o.alloc(0);let T;if(m===void 0)for(m=0,T=0;T<h.length;++T)m+=h[T].length;let I=o.allocUnsafe(m),F=0;for(T=0;T<h.length;++T){let V=h[T];if(Se(V,Uint8Array))F+V.length>I.length?(o.isBuffer(V)||(V=o.from(V)),V.copy(I,F)):Uint8Array.prototype.set.call(I,V,F);else if(o.isBuffer(V))V.copy(I,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=V.length}return I};function _(w,h){if(o.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||Se(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);let m=w.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&m===0)return 0;let I=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return xt(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return br(w).length;default:if(I)return T?-1:xt(w).length;h=(""+h).toLowerCase(),I=!0}}o.byteLength=_;function S(w,h,m){let T=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,h>>>=0,m<=h))return"";for(w||(w="utf8");;)switch(w){case"hex":return ge(this,h,m);case"utf8":case"utf-8":return Z(this,h,m);case"ascii":return ae(this,h,m);case"latin1":case"binary":return ve(this,h,m);case"base64":return J(this,h,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee(this,h,m);default:if(T)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),T=!0}}o.prototype._isBuffer=!0;function C(w,h,m){let T=w[h];w[h]=w[m],w[m]=T}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 m=0;m<h;m+=2)C(this,m,m+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 m=0;m<h;m+=4)C(this,m,m+3),C(this,m+1,m+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 m=0;m<h;m+=8)C(this,m,m+7),C(this,m+1,m+6),C(this,m+2,m+5),C(this,m+3,m+4);return this},o.prototype.toString=function(){let h=this.length;return h===0?"":arguments.length===0?Z(this,0,h):S.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="",m=K0.INSPECT_MAX_BYTES;return h=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(h+=" ... "),"<Buffer "+h+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(h,m,T,I,F){if(Se(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(m===void 0&&(m=0),T===void 0&&(T=h?h.length:0),I===void 0&&(I=0),F===void 0&&(F=this.length),m<0||T>h.length||I<0||F>this.length)throw new RangeError("out of range index");if(I>=F&&m>=T)return 0;if(I>=F)return-1;if(m>=T)return 1;if(m>>>=0,T>>>=0,I>>>=0,F>>>=0,this===h)return 0;let V=F-I,ie=T-m,ye=Math.min(V,ie),me=this.slice(I,F),pe=h.slice(m,T);for(let fe=0;fe<ye;++fe)if(me[fe]!==pe[fe]){V=me[fe],ie=pe[fe];break}return V<ie?-1:ie<V?1:0};function M(w,h,m,T,I){if(w.length===0)return-1;if(typeof m=="string"?(T=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Rt(m)&&(m=I?0:w.length-1),m<0&&(m=w.length+m),m>=w.length){if(I)return-1;m=w.length-1}else if(m<0)if(I)m=0;else return-1;if(typeof h=="string"&&(h=o.from(h,T)),o.isBuffer(h))return h.length===0?-1:P(w,h,m,T,I);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(w,h,m):Uint8Array.prototype.lastIndexOf.call(w,h,m):P(w,[h],m,T,I);throw new TypeError("val must be string, number or Buffer")}function P(w,h,m,T,I){let F=1,V=w.length,ie=h.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(w.length<2||h.length<2)return-1;F=2,V/=2,ie/=2,m/=2}function ye(pe,fe){return F===1?pe[fe]:pe.readUInt16BE(fe*F)}let me;if(I){let pe=-1;for(me=m;me<V;me++)if(ye(w,me)===ye(h,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===ie)return pe*F}else pe!==-1&&(me-=me-pe),pe=-1}else for(m+ie>V&&(m=V-ie),me=m;me>=0;me--){let pe=!0;for(let fe=0;fe<ie;fe++)if(ye(w,me+fe)!==ye(h,fe)){pe=!1;break}if(pe)return me}return-1}o.prototype.includes=function(h,m,T){return this.indexOf(h,m,T)!==-1},o.prototype.indexOf=function(h,m,T){return M(this,h,m,T,!0)},o.prototype.lastIndexOf=function(h,m,T){return M(this,h,m,T,!1)};function B(w,h,m,T){m=Number(m)||0;let I=w.length-m;T?(T=Number(T),T>I&&(T=I)):T=I;let F=h.length;T>F/2&&(T=F/2);let V;for(V=0;V<T;++V){let ie=parseInt(h.substr(V*2,2),16);if(Rt(ie))return V;w[m+V]=ie}return V}function H(w,h,m,T){return Ze(xt(h,w.length-m),w,m,T)}function G(w,h,m,T){return Ze(q5(h),w,m,T)}function O(w,h,m,T){return Ze(br(h),w,m,T)}function j(w,h,m,T){return Ze(X5(h,w.length-m),w,m,T)}o.prototype.write=function(h,m,T,I){if(m===void 0)I="utf8",T=this.length,m=0;else if(T===void 0&&typeof m=="string")I=m,T=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(T)?(T=T>>>0,I===void 0&&(I="utf8")):(I=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let F=this.length-m;if((T===void 0||T>F)&&(T=F),h.length>0&&(T<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let V=!1;for(;;)switch(I){case"hex":return B(this,h,m,T);case"utf8":case"utf-8":return H(this,h,m,T);case"ascii":case"latin1":case"binary":return G(this,h,m,T);case"base64":return O(this,h,m,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,h,m,T);default:if(V)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),V=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(w,h,m){return h===0&&m===w.length?n.fromByteArray(w):n.fromByteArray(w.slice(h,m))}function Z(w,h,m){m=Math.min(w.length,m);let T=[],I=h;for(;I<m;){let F=w[I],V=null,ie=F>239?4:F>223?3:F>191?2:1;if(I+ie<=m){let ye,me,pe,fe;switch(ie){case 1:F<128&&(V=F);break;case 2:ye=w[I+1],(ye&192)===128&&(fe=(F&31)<<6|ye&63,fe>127&&(V=fe));break;case 3:ye=w[I+1],me=w[I+2],(ye&192)===128&&(me&192)===128&&(fe=(F&15)<<12|(ye&63)<<6|me&63,fe>2047&&(fe<55296||fe>57343)&&(V=fe));break;case 4:ye=w[I+1],me=w[I+2],pe=w[I+3],(ye&192)===128&&(me&192)===128&&(pe&192)===128&&(fe=(F&15)<<18|(ye&63)<<12|(me&63)<<6|pe&63,fe>65535&&fe<1114112&&(V=fe))}}V===null?(V=65533,ie=1):V>65535&&(V-=65536,T.push(V>>>10&1023|55296),V=56320|V&1023),T.push(V),I+=ie}return de(T)}let X=4096;function de(w){let h=w.length;if(h<=X)return String.fromCharCode.apply(String,w);let m="",T=0;for(;T<h;)m+=String.fromCharCode.apply(String,w.slice(T,T+=X));return m}function ae(w,h,m){let T="";m=Math.min(w.length,m);for(let I=h;I<m;++I)T+=String.fromCharCode(w[I]&127);return T}function ve(w,h,m){let T="";m=Math.min(w.length,m);for(let I=h;I<m;++I)T+=String.fromCharCode(w[I]);return T}function ge(w,h,m){let T=w.length;(!h||h<0)&&(h=0),(!m||m<0||m>T)&&(m=T);let I="";for(let F=h;F<m;++F)I+=a5[w[F]];return I}function Ee(w,h,m){let T=w.slice(h,m),I="";for(let F=0;F<T.length-1;F+=2)I+=String.fromCharCode(T[F]+T[F+1]*256);return I}o.prototype.slice=function(h,m){let T=this.length;h=~~h,m=m===void 0?T:~~m,h<0?(h+=T,h<0&&(h=0)):h>T&&(h=T),m<0?(m+=T,m<0&&(m=0)):m>T&&(m=T),m<h&&(m=h);let I=this.subarray(h,m);return Object.setPrototypeOf(I,o.prototype),I};function ne(w,h,m){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+h>m)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(h,m,T){h=h>>>0,m=m>>>0,T||ne(h,m,this.length);let I=this[h],F=1,V=0;for(;++V<m&&(F*=256);)I+=this[h+V]*F;return I},o.prototype.readUintBE=o.prototype.readUIntBE=function(h,m,T){h=h>>>0,m=m>>>0,T||ne(h,m,this.length);let I=this[h+--m],F=1;for(;m>0&&(F*=256);)I+=this[h+--m]*F;return I},o.prototype.readUint8=o.prototype.readUInt8=function(h,m){return h=h>>>0,m||ne(h,1,this.length),this[h]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(h,m){return h=h>>>0,m||ne(h,2,this.length),this[h]|this[h+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(h,m){return h=h>>>0,m||ne(h,2,this.length),this[h]<<8|this[h+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(h,m){return h=h>>>0,m||ne(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,m){return h=h>>>0,m||ne(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},o.prototype.readBigUInt64LE=o0(function(h){h=h>>>0,C0(h,"offset");let m=this[h],T=this[h+7];(m===void 0||T===void 0)&&j0(h,this.length-8);let I=m+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,F=this[++h]+this[++h]*2**8+this[++h]*2**16+T*2**24;return BigInt(I)+(BigInt(F)<<BigInt(32))}),o.prototype.readBigUInt64BE=o0(function(h){h=h>>>0,C0(h,"offset");let m=this[h],T=this[h+7];(m===void 0||T===void 0)&&j0(h,this.length-8);let I=m*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],F=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+T;return(BigInt(I)<<BigInt(32))+BigInt(F)}),o.prototype.readIntLE=function(h,m,T){h=h>>>0,m=m>>>0,T||ne(h,m,this.length);let I=this[h],F=1,V=0;for(;++V<m&&(F*=256);)I+=this[h+V]*F;return F*=128,I>=F&&(I-=Math.pow(2,8*m)),I},o.prototype.readIntBE=function(h,m,T){h=h>>>0,m=m>>>0,T||ne(h,m,this.length);let I=m,F=1,V=this[h+--I];for(;I>0&&(F*=256);)V+=this[h+--I]*F;return F*=128,V>=F&&(V-=Math.pow(2,8*m)),V},o.prototype.readInt8=function(h,m){return h=h>>>0,m||ne(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},o.prototype.readInt16LE=function(h,m){h=h>>>0,m||ne(h,2,this.length);let T=this[h]|this[h+1]<<8;return T&32768?T|4294901760:T},o.prototype.readInt16BE=function(h,m){h=h>>>0,m||ne(h,2,this.length);let T=this[h+1]|this[h]<<8;return T&32768?T|4294901760:T},o.prototype.readInt32LE=function(h,m){return h=h>>>0,m||ne(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},o.prototype.readInt32BE=function(h,m){return h=h>>>0,m||ne(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},o.prototype.readBigInt64LE=o0(function(h){h=h>>>0,C0(h,"offset");let m=this[h],T=this[h+7];(m===void 0||T===void 0)&&j0(h,this.length-8);let I=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(T<<24);return(BigInt(I)<<BigInt(32))+BigInt(m+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),o.prototype.readBigInt64BE=o0(function(h){h=h>>>0,C0(h,"offset");let m=this[h],T=this[h+7];(m===void 0||T===void 0)&&j0(h,this.length-8);let I=(m<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(I)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+T)}),o.prototype.readFloatLE=function(h,m){return h=h>>>0,m||ne(h,4,this.length),e.read(this,h,!0,23,4)},o.prototype.readFloatBE=function(h,m){return h=h>>>0,m||ne(h,4,this.length),e.read(this,h,!1,23,4)},o.prototype.readDoubleLE=function(h,m){return h=h>>>0,m||ne(h,8,this.length),e.read(this,h,!0,52,8)},o.prototype.readDoubleBE=function(h,m){return h=h>>>0,m||ne(h,8,this.length),e.read(this,h,!1,52,8)};function Y(w,h,m,T,I,F){if(!o.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>I||h<F)throw new RangeError('"value" argument is out of bounds');if(m+T>w.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(h,m,T,I){if(h=+h,m=m>>>0,T=T>>>0,!I){let ie=Math.pow(2,8*T)-1;Y(this,h,m,T,ie,0)}let F=1,V=0;for(this[m]=h&255;++V<T&&(F*=256);)this[m+V]=h/F&255;return m+T},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(h,m,T,I){if(h=+h,m=m>>>0,T=T>>>0,!I){let ie=Math.pow(2,8*T)-1;Y(this,h,m,T,ie,0)}let F=T-1,V=1;for(this[m+F]=h&255;--F>=0&&(V*=256);)this[m+F]=h/V&255;return m+T},o.prototype.writeUint8=o.prototype.writeUInt8=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,1,255,0),this[m]=h&255,m+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,2,65535,0),this[m]=h&255,this[m+1]=h>>>8,m+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,2,65535,0),this[m]=h>>>8,this[m+1]=h&255,m+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,4,4294967295,0),this[m+3]=h>>>24,this[m+2]=h>>>16,this[m+1]=h>>>8,this[m]=h&255,m+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,4,4294967295,0),this[m]=h>>>24,this[m+1]=h>>>16,this[m+2]=h>>>8,this[m+3]=h&255,m+4};function oe(w,h,m,T,I){N0(h,T,I,w,m,7);let F=Number(h&BigInt(4294967295));w[m++]=F,F=F>>8,w[m++]=F,F=F>>8,w[m++]=F,F=F>>8,w[m++]=F;let V=Number(h>>BigInt(32)&BigInt(4294967295));return w[m++]=V,V=V>>8,w[m++]=V,V=V>>8,w[m++]=V,V=V>>8,w[m++]=V,m}function be(w,h,m,T,I){N0(h,T,I,w,m,7);let F=Number(h&BigInt(4294967295));w[m+7]=F,F=F>>8,w[m+6]=F,F=F>>8,w[m+5]=F,F=F>>8,w[m+4]=F;let V=Number(h>>BigInt(32)&BigInt(4294967295));return w[m+3]=V,V=V>>8,w[m+2]=V,V=V>>8,w[m+1]=V,V=V>>8,w[m]=V,m+8}o.prototype.writeBigUInt64LE=o0(function(h,m=0){return oe(this,h,m,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=o0(function(h,m=0){return be(this,h,m,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(h,m,T,I){if(h=+h,m=m>>>0,!I){let ye=Math.pow(2,8*T-1);Y(this,h,m,T,ye-1,-ye)}let F=0,V=1,ie=0;for(this[m]=h&255;++F<T&&(V*=256);)h<0&&ie===0&&this[m+F-1]!==0&&(ie=1),this[m+F]=(h/V>>0)-ie&255;return m+T},o.prototype.writeIntBE=function(h,m,T,I){if(h=+h,m=m>>>0,!I){let ye=Math.pow(2,8*T-1);Y(this,h,m,T,ye-1,-ye)}let F=T-1,V=1,ie=0;for(this[m+F]=h&255;--F>=0&&(V*=256);)h<0&&ie===0&&this[m+F+1]!==0&&(ie=1),this[m+F]=(h/V>>0)-ie&255;return m+T},o.prototype.writeInt8=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,1,127,-128),h<0&&(h=255+h+1),this[m]=h&255,m+1},o.prototype.writeInt16LE=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,2,32767,-32768),this[m]=h&255,this[m+1]=h>>>8,m+2},o.prototype.writeInt16BE=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,2,32767,-32768),this[m]=h>>>8,this[m+1]=h&255,m+2},o.prototype.writeInt32LE=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,4,2147483647,-2147483648),this[m]=h&255,this[m+1]=h>>>8,this[m+2]=h>>>16,this[m+3]=h>>>24,m+4},o.prototype.writeInt32BE=function(h,m,T){return h=+h,m=m>>>0,T||Y(this,h,m,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[m]=h>>>24,this[m+1]=h>>>16,this[m+2]=h>>>8,this[m+3]=h&255,m+4},o.prototype.writeBigInt64LE=o0(function(h,m=0){return oe(this,h,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=o0(function(h,m=0){return be(this,h,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ge(w,h,m,T,I,F){if(m+T>w.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Oe(w,h,m,T,I){return h=+h,m=m>>>0,I||Ge(w,h,m,4),e.write(w,h,m,T,23,4),m+4}o.prototype.writeFloatLE=function(h,m,T){return Oe(this,h,m,!0,T)},o.prototype.writeFloatBE=function(h,m,T){return Oe(this,h,m,!1,T)};function Xe(w,h,m,T,I){return h=+h,m=m>>>0,I||Ge(w,h,m,8),e.write(w,h,m,T,52,8),m+8}o.prototype.writeDoubleLE=function(h,m,T){return Xe(this,h,m,!0,T)},o.prototype.writeDoubleBE=function(h,m,T){return Xe(this,h,m,!1,T)},o.prototype.copy=function(h,m,T,I){if(!o.isBuffer(h))throw new TypeError("argument should be a Buffer");if(T||(T=0),!I&&I!==0&&(I=this.length),m>=h.length&&(m=h.length),m||(m=0),I>0&&I<T&&(I=T),I===T||h.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),h.length-m<I-T&&(I=h.length-m+T);let F=I-T;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,T,I):Uint8Array.prototype.set.call(h,this.subarray(T,I),m),F},o.prototype.fill=function(h,m,T,I){if(typeof h=="string"){if(typeof m=="string"?(I=m,m=0,T=this.length):typeof T=="string"&&(I=T,T=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!o.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(h.length===1){let V=h.charCodeAt(0);(I==="utf8"&&V<128||I==="latin1")&&(h=V)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(m<0||this.length<m||this.length<T)throw new RangeError("Out of range index");if(T<=m)return this;m=m>>>0,T=T===void 0?this.length:T>>>0,h||(h=0);let F;if(typeof h=="number")for(F=m;F<T;++F)this[F]=h;else{let V=o.isBuffer(h)?h:o.from(h,I),ie=V.length;if(ie===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(F=0;F<T-m;++F)this[F+m]=V[F%ie]}return this};let he={};function h0(w,h,m){he[w]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}h0("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),h0("ERR_INVALID_ARG_TYPE",function(w,h){return`The "${w}" argument must be of type number. Received type ${typeof h}`},TypeError),h0("ERR_OUT_OF_RANGE",function(w,h,m){let T=`The value of "${w}" is out of range.`,I=m;return Number.isInteger(m)&&Math.abs(m)>2**32?I=s5(String(m)):typeof m=="bigint"&&(I=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(I=s5(I)),I+="n"),T+=` It must be ${h}. Received ${I}`,T},RangeError);function s5(w){let h="",m=w.length,T=w[0]==="-"?1:0;for(;m>=T+4;m-=3)h=`_${w.slice(m-3,m)}${h}`;return`${w.slice(0,m)}${h}`}function o5(w,h,m){C0(h,"offset"),(w[h]===void 0||w[h+m]===void 0)&&j0(h,w.length-(m+1))}function N0(w,h,m,T,I,F){if(w>m||w<h){let V=typeof h=="bigint"?"n":"",ie;throw h===0||h===BigInt(0)?ie=`>= 0${V} and < 2${V} ** ${(F+1)*8}${V}`:ie=`>= -(2${V} ** ${(F+1)*8-1}${V}) and < 2 ** ${(F+1)*8-1}${V}`,new he.ERR_OUT_OF_RANGE("value",ie,w)}o5(T,I,F)}function C0(w,h){if(typeof w!="number")throw new he.ERR_INVALID_ARG_TYPE(h,"number",w)}function j0(w,h,m){throw Math.floor(w)!==w?(C0(w,m),new he.ERR_OUT_OF_RANGE("offset","an integer",w)):h<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${h}`,w)}let Z5=/[^+/0-9A-Za-z-_]/g;function Y0(w){if(w=w.split("=")[0],w=w.trim().replace(Z5,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function xt(w,h){h=h||1/0;let m,T=w.length,I=null,F=[];for(let V=0;V<T;++V){if(m=w.charCodeAt(V),m>55295&&m<57344){if(!I){if(m>56319){(h-=3)>-1&&F.push(239,191,189);continue}else if(V+1===T){(h-=3)>-1&&F.push(239,191,189);continue}I=m;continue}if(m<56320){(h-=3)>-1&&F.push(239,191,189),I=m;continue}m=(I-55296<<10|m-56320)+65536}else I&&(h-=3)>-1&&F.push(239,191,189);if(I=null,m<128){if((h-=1)<0)break;F.push(m)}else if(m<2048){if((h-=2)<0)break;F.push(m>>6|192,m&63|128)}else if(m<65536){if((h-=3)<0)break;F.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((h-=4)<0)break;F.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return F}function q5(w){let h=[];for(let m=0;m<w.length;++m)h.push(w.charCodeAt(m)&255);return h}function X5(w,h){let m,T,I,F=[];for(let V=0;V<w.length&&!((h-=2)<0);++V)m=w.charCodeAt(V),T=m>>8,I=m%256,F.push(I),F.push(T);return F}function br(w){return n.toByteArray(Y0(w))}function Ze(w,h,m,T){let I;for(I=0;I<T&&!(I+m>=h.length||I>=w.length);++I)h[I+m]=w[I];return I}function Se(w,h){return w instanceof h||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===h.name}function Rt(w){return w!==w}let a5=function(){let w="0123456789abcdef",h=new Array(256);for(let m=0;m<16;++m){let T=m*16;for(let I=0;I<16;++I)h[T+I]=w[m]+w[I]}return h}();function o0(w){return typeof BigInt>"u"?kt:w}function kt(){throw new Error("BigInt not supported")}return K0}var c5,F2,i1,z2,K0,L2,G2=$e(()=>{E();x();k();R();c5={},F2=!1;i1={},z2=!1;K0={},L2=!1});var J0,z,P9,I9,V2=$e(()=>{E();x();k();R();G2();J0=U2();J0.Buffer;J0.SlowBuffer;J0.INSPECT_MAX_BYTES;J0.kMaxLength;z=J0.Buffer,P9=J0.INSPECT_MAX_BYTES,I9=J0.kMaxLength});var k=$e(()=>{V2()});var J2=i0((Mr,Sr)=>{E();x();k();R();(function(n,e){typeof Mr=="object"&&typeof Sr<"u"?Sr.exports=e():typeof define=="function"&&define.amd?define(e):n.Stats=e()})(Mr,function(){var n=function(){function e(u){return i.appendChild(u.dom),u}function t(u){for(var f=0;f<i.children.length;f++)i.children[f].style.display=f===u?"block":"none";r=u}var r=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(u){u.preventDefault(),t(++r%i.children.length)},!1);var s=(performance||Date).now(),o=s,v=0,a=e(new n.Panel("FPS","#0ff","#002")),l=e(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=e(new n.Panel("MB","#f08","#201"));return t(0),{REVISION:16,dom:i,addPanel:e,showPanel:t,begin:function(){s=(performance||Date).now()},end:function(){v++;var u=(performance||Date).now();if(l.update(u-s,200),u>o+1e3&&(a.update(1e3*v/(u-o),100),o=u,v=0,c)){var f=performance.memory;c.update(f.usedJSHeapSize/1048576,f.jsHeapSizeLimit/1048576)}return u},update:function(){s=this.end()},domElement:i,setMode:t}};return n.Panel=function(e,t,r){var i=1/0,s=0,o=Math.round,v=o(window.devicePixelRatio||1),a=80*v,l=48*v,c=3*v,u=2*v,f=3*v,p=15*v,g=74*v,y=30*v,A=document.createElement("canvas");A.width=a,A.height=l,A.style.cssText="width:80px;height:48px";var b=A.getContext("2d");return b.font="bold "+9*v+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=r,b.fillRect(0,0,a,l),b.fillStyle=t,b.fillText(e,c,u),b.fillRect(f,p,g,y),b.fillStyle=r,b.globalAlpha=.9,b.fillRect(f,p,g,y),{dom:A,update:function(_,S){i=Math.min(i,_),s=Math.max(s,_),b.fillStyle=r,b.globalAlpha=1,b.fillRect(0,0,a,p),b.fillStyle=t,b.fillText(o(_)+" "+e+" ("+o(i)+"-"+o(s)+")",c,u),b.drawImage(A,f+v,p,g-v,y,f,p,g-v,y),b.fillRect(f+g-v,p,v,y),b.fillStyle=r,b.globalAlpha=.9,b.fillRect(f+g-v,p,v,o((1-_/S)*y))}}},n})});var js=i0((Ns,T1)=>{E();x();k();R();(function(n,e){typeof T1=="object"&&T1.exports?T1.exports=e():n.nearley=e()})(Ns,function(){function n(a,l,c){return this.id=++n.highestId,this.name=a,this.symbols=l,this.postprocess=c,this}n.highestId=0,n.prototype.toString=function(a){var l=typeof a>"u"?this.symbols.map(v).join(" "):this.symbols.slice(0,a).map(v).join(" ")+" \u25CF "+this.symbols.slice(a).map(v).join(" ");return this.name+" \u2192 "+l};function e(a,l,c,u){this.rule=a,this.dot=l,this.reference=c,this.data=[],this.wantedBy=u,this.isComplete=this.dot===a.symbols.length}e.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},e.prototype.nextState=function(a){var l=new e(this.rule,this.dot+1,this.reference,this.wantedBy);return l.left=this,l.right=a,l.isComplete&&(l.data=l.build(),l.right=void 0),l},e.prototype.build=function(){var a=[],l=this;do a.push(l.right.data),l=l.left;while(l.left);return a.reverse(),a},e.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function t(a,l){this.grammar=a,this.index=l,this.states=[],this.wants={},this.scannable=[],this.completed={}}t.prototype.process=function(a){for(var l=this.states,c=this.wants,u=this.completed,f=0;f<l.length;f++){var p=l[f];if(p.isComplete){if(p.finish(),p.data!==s.fail){for(var g=p.wantedBy,y=g.length;y--;){var A=g[y];this.complete(A,p)}if(p.reference===this.index){var b=p.rule.name;(this.completed[b]=this.completed[b]||[]).push(p)}}}else{var b=p.rule.symbols[p.dot];if(typeof b!="string"){this.scannable.push(p);continue}if(c[b]){if(c[b].push(p),u.hasOwnProperty(b))for(var _=u[b],y=0;y<_.length;y++){var S=_[y];this.complete(p,S)}}else c[b]=[p],this.predict(b)}}},t.prototype.predict=function(a){for(var l=this.grammar.byName[a]||[],c=0;c<l.length;c++){var u=l[c],f=this.wants[a],p=new e(u,0,this.index,f);this.states.push(p)}},t.prototype.complete=function(a,l){var c=a.nextState(l);this.states.push(c)};function r(a,l){this.rules=a,this.start=l||this.rules[0].name;var c=this.byName={};this.rules.forEach(function(u){c.hasOwnProperty(u.name)||(c[u.name]=[]),c[u.name].push(u)})}r.fromCompiled=function(u,l){var c=u.Lexer;u.ParserStart&&(l=u.ParserStart,u=u.ParserRules);var u=u.map(function(p){return new n(p.name,p.symbols,p.postprocess)}),f=new r(u,l);return f.lexer=c,f};function i(){this.reset("")}i.prototype.reset=function(a,l){this.buffer=a,this.index=0,this.line=l?l.line:1,this.lastLineBreak=l?-l.col:0},i.prototype.next=function(){if(this.index<this.buffer.length){var a=this.buffer[this.index++];return a===`
|
|
2
|
-
`&&(this.line+=1,this.lastLineBreak=this.index),{value:
|
|
3
|
-
`).slice(Math.max(0,this.line-5),this.line),
|
|
4
|
-
`,this.index);
|
|
1
|
+
var ja=Object.create;var s5=Object.defineProperty;var Ya=Object.getOwnPropertyDescriptor;var Qa=Object.getOwnPropertyNames;var Ka=Object.getPrototypeOf,Ja=Object.prototype.hasOwnProperty;var qa=(n,e,t)=>e in n?s5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Za=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var Xe=(n,e)=>()=>(n&&(e=n(n=0)),e);var t0=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),q5=(n,e)=>{for(var t in e)s5(n,t,{get:e[t],enumerable:!0})},hn=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Qa(e))!Ja.call(n,i)&&i!==t&&s5(n,i,{get:()=>e[i],enumerable:!(r=Ya(e,i))||r.enumerable});return n};var o5=(n,e,t)=>(t=n!=null?ja(Ka(n)):{},hn(e||!n||!n.__esModule?s5(t,"default",{value:n,enumerable:!0}):t,n)),Xa=n=>hn(s5({},"__esModule",{value:!0}),n);var d=(n,e,t)=>(qa(n,typeof e!="symbol"?e+"":e,t),t);var E=Xe(()=>{});var x=Xe(()=>{});var D={};q5(D,{_debugEnd:()=>i2,_debugProcess:()=>r2,_events:()=>y2,_eventsCount:()=>_2,_exiting:()=>Fn,_fatalExceptions:()=>Xn,_getActiveHandles:()=>Gn,_getActiveRequests:()=>Un,_kill:()=>Nn,_linkedBinding:()=>On,_maxListeners:()=>b2,_preload_modules:()=>m2,_rawDebug:()=>In,_startProfilerIdleNotifier:()=>n2,_stopProfilerIdleNotifier:()=>s2,_tickCallback:()=>t2,abort:()=>l2,addListener:()=>w2,allowedNodeEnvironmentFlags:()=>Jn,arch:()=>yn,argv:()=>An,argv0:()=>h2,assert:()=>qn,binding:()=>Tn,browser:()=>Pn,chdir:()=>Cn,config:()=>zn,cpuUsage:()=>$5,cwd:()=>Sn,debugPort:()=>f2,default:()=>C2,dlopen:()=>Ln,domain:()=>Dn,emit:()=>k2,emitWarning:()=>kn,env:()=>wn,execArgv:()=>En,execPath:()=>u2,exit:()=>Qn,features:()=>Zn,hasUncaughtExceptionCaptureCallback:()=>e2,hrtime:()=>X5,kill:()=>Yn,listeners:()=>S2,memoryUsage:()=>jn,moduleLoadList:()=>Hn,nextTick:()=>pn,off:()=>E2,on:()=>A0,once:()=>A2,openStdin:()=>Kn,pid:()=>c2,platform:()=>_n,ppid:()=>d2,prependListener:()=>T2,prependOnceListener:()=>M2,reallyExit:()=>Vn,release:()=>Bn,removeAllListeners:()=>R2,removeListener:()=>x2,resourceUsage:()=>Wn,setSourceMapsEnabled:()=>p2,setUncaughtExceptionCaptureCallback:()=>$n,stderr:()=>a2,stdin:()=>v2,stdout:()=>o2,title:()=>bn,umask:()=>Mn,uptime:()=>g2,version:()=>xn,versions:()=>Rn});function br(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function $a(){!kt||!Y0||(kt=!1,Y0.length?w0=Y0.concat(w0):Z5=-1,w0.length&&mn())}function mn(){if(!kt){var n=setTimeout($a,0);kt=!0;for(var e=w0.length;e;){for(Y0=w0,w0=[];++Z5<e;)Y0&&Y0[Z5].run();Z5=-1,e=w0.length}Y0=null,kt=!1,clearTimeout(n)}}function pn(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];w0.push(new gn(n,e)),w0.length===1&&!kt&&setTimeout(mn,0)}function gn(n,e){this.fun=n,this.array=e}function Ne(){}function On(n){br("_linkedBinding")}function Ln(n){br("dlopen")}function Un(){return[]}function Gn(){return[]}function qn(n,e){if(!n)throw new Error(e||"assertion error")}function e2(){return!1}function g2(){return C0.now()/1e3}function X5(n){var e=Math.floor((Date.now()-C0.now())*.001),t=C0.now()*.001,r=Math.floor(t)+e,i=Math.floor(t%1*1e9);return n&&(r=r-n[0],i=i-n[1],i<0&&(r--,i+=gr)),[r,i]}function A0(){return C2}function S2(n){return[]}var w0,kt,Y0,Z5,bn,yn,_n,wn,An,En,xn,Rn,kn,Tn,Mn,Sn,Cn,Bn,Pn,In,Hn,Dn,Fn,zn,Vn,Nn,$5,Wn,jn,Yn,Qn,Kn,Jn,Zn,Xn,$n,t2,r2,i2,n2,s2,o2,a2,v2,l2,c2,d2,u2,f2,h2,m2,p2,C0,pr,gr,b2,y2,_2,w2,A2,E2,x2,R2,k2,T2,M2,C2,B2=Xe(()=>{E();x();k();R();w0=[],kt=!1,Z5=-1;gn.prototype.run=function(){this.fun.apply(null,this.array)};bn="browser",yn="x64",_n="browser",wn={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},An=["/usr/bin/node"],En=[],xn="v16.8.0",Rn={},kn=function(n,e){},Tn=function(n){br("binding")},Mn=function(n){return 0},Sn=function(){return"/"},Cn=function(n){},Bn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};Pn=!0,In=Ne,Hn=[];Dn={},Fn=!1,zn={};Vn=Ne,Nn=Ne,$5=function(){return{}},Wn=$5,jn=$5,Yn=Ne,Qn=Ne,Kn=Ne,Jn={};Zn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Xn=Ne,$n=Ne;t2=Ne,r2=Ne,i2=Ne,n2=Ne,s2=Ne,o2=void 0,a2=void 0,v2=void 0,l2=Ne,c2=2,d2=1,u2="/bin/usr/node",f2=9229,h2="node",m2=[],p2=Ne,C0={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};C0.now===void 0&&(pr=Date.now(),C0.timing&&C0.timing.navigationStart&&(pr=C0.timing.navigationStart),C0.now=()=>Date.now()-pr);gr=1e9;X5.bigint=function(n){var e=X5(n);return typeof BigInt>"u"?e[0]*gr+e[1]:BigInt(e[0]*gr)+BigInt(e[1])};b2=10,y2={},_2=0;w2=A0,A2=A0,E2=A0,x2=A0,R2=A0,k2=Ne,T2=A0,M2=A0;C2={version:xn,versions:Rn,arch:yn,platform:_n,browser:Pn,release:Bn,_rawDebug:In,moduleLoadList:Hn,binding:Tn,_linkedBinding:On,_events:y2,_eventsCount:_2,_maxListeners:b2,on:A0,addListener:w2,once:A2,off:E2,removeListener:x2,removeAllListeners:R2,emit:k2,prependListener:T2,prependOnceListener:M2,listeners:S2,domain:Dn,_exiting:Fn,config:zn,dlopen:Ln,uptime:g2,_getActiveRequests:Un,_getActiveHandles:Gn,reallyExit:Vn,_kill:Nn,cpuUsage:$5,resourceUsage:Wn,memoryUsage:jn,kill:Yn,exit:Qn,openStdin:Kn,allowedNodeEnvironmentFlags:Jn,assert:qn,features:Zn,_fatalExceptions:Xn,setUncaughtExceptionCaptureCallback:$n,hasUncaughtExceptionCaptureCallback:e2,emitWarning:kn,nextTick:pn,_tickCallback:t2,_debugProcess:r2,_debugEnd:i2,_startProfilerIdleNotifier:n2,_stopProfilerIdleNotifier:s2,stdout:o2,stdin:v2,stderr:a2,abort:l2,umask:Mn,chdir:Cn,cwd:Sn,env:wn,title:bn,argv:An,execArgv:En,pid:c2,ppid:d2,execPath:u2,debugPort:f2,hrtime:X5,argv0:h2,_preload_modules:m2,setSourceMapsEnabled:p2}});var R=Xe(()=>{B2()});function e6(){if(P2)return a5;P2=!0,a5.byteLength=a,a5.toByteArray=l,a5.fromByteArray=h;for(var n=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)n[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(p){var g=p.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=p.indexOf("=");y===-1&&(y=g);var A=y===g?0:4-y%4;return[y,A]}function a(p){var g=o(p),y=g[0],A=g[1];return(y+A)*3/4-A}function v(p,g,y){return(g+y)*3/4-y}function l(p){var g,y=o(p),A=y[0],b=y[1],w=new t(v(p,A,b)),S=0,C=b>0?A-4:A,M;for(M=0;M<C;M+=4)g=e[p.charCodeAt(M)]<<18|e[p.charCodeAt(M+1)]<<12|e[p.charCodeAt(M+2)]<<6|e[p.charCodeAt(M+3)],w[S++]=g>>16&255,w[S++]=g>>8&255,w[S++]=g&255;return b===2&&(g=e[p.charCodeAt(M)]<<2|e[p.charCodeAt(M+1)]>>4,w[S++]=g&255),b===1&&(g=e[p.charCodeAt(M)]<<10|e[p.charCodeAt(M+1)]<<4|e[p.charCodeAt(M+2)]>>2,w[S++]=g>>8&255,w[S++]=g&255),w}function c(p){return n[p>>18&63]+n[p>>12&63]+n[p>>6&63]+n[p&63]}function u(p,g,y){for(var A,b=[],w=g;w<y;w+=3)A=(p[w]<<16&16711680)+(p[w+1]<<8&65280)+(p[w+2]&255),b.push(c(A));return b.join("")}function h(p){for(var g,y=p.length,A=y%3,b=[],w=16383,S=0,C=y-A;S<C;S+=w)b.push(u(p,S,S+w>C?C:S+w));return A===1?(g=p[y-1],b.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(p[y-2]<<8)+p[y-1],b.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),b.join("")}return a5}function t6(){if(I2)return e1;I2=!0;return e1.read=function(n,e,t,r,i){var s,o,a=i*8-r-1,v=(1<<a)-1,l=v>>1,c=-7,u=t?i-1:0,h=t?-1:1,p=n[e+u];for(u+=h,s=p&(1<<-c)-1,p>>=-c,c+=a;c>0;s=s*256+n[e+u],u+=h,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+u],u+=h,c-=8);if(s===0)s=1-l;else{if(s===v)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(p?-1:1)*o*Math.pow(2,s-r)},e1.write=function(n,e,t,r,i,s){var o,a,v,l=s*8-i-1,c=(1<<l)-1,u=c>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,g=r?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(v=Math.pow(2,-o))<1&&(o--,v*=2),o+u>=1?e+=h/v:e+=h*Math.pow(2,1-u),e*v>=2&&(o++,v/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(e*v-1)*Math.pow(2,i),o=o+u):(a=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;n[t+p]=a&255,p+=g,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;n[t+p]=o&255,p+=g,o/=256,l-=8);n[t+p-g]|=y*128},e1}function O2(){if(H2)return Q0;H2=!0;let n=e6(),e=t6(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Q0.Buffer=o,Q0.SlowBuffer=b,Q0.INSPECT_MAX_BYTES=50;let r=2147483647;Q0.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u";function i(){try{let _=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(_,f),_.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(_){if(_>r)throw new RangeError('The value "'+_+'" is invalid for option "size"');let f=new Uint8Array(_);return Object.setPrototypeOf(f,o.prototype),f}function o(_,f,m){if(typeof _=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(_)}return a(_,f,m)}o.poolSize=8192;function a(_,f,m){if(typeof _=="string")return u(_,f);if(ArrayBuffer.isView(_))return p(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _);if(Me(_,ArrayBuffer)||_&&Me(_.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Me(_,SharedArrayBuffer)||_&&Me(_.buffer,SharedArrayBuffer)))return g(_,f,m);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let T=_.valueOf&&_.valueOf();if(T!=null&&T!==_)return o.from(T,f,m);let P=y(_);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return o.from(_[Symbol.toPrimitive]("string"),f,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _)}o.from=function(_,f,m){return a(_,f,m)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function v(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function l(_,f,m){return v(_),_<=0?s(_):f!==void 0?typeof m=="string"?s(_).fill(f,m):s(_).fill(f):s(_)}o.alloc=function(_,f,m){return l(_,f,m)};function c(_){return v(_),s(_<0?0:A(_)|0)}o.allocUnsafe=function(_){return c(_)},o.allocUnsafeSlow=function(_){return c(_)};function u(_,f){if((typeof f!="string"||f==="")&&(f="utf8"),!o.isEncoding(f))throw new TypeError("Unknown encoding: "+f);let m=w(_,f)|0,T=s(m),P=T.write(_,f);return P!==m&&(T=T.slice(0,P)),T}function h(_){let f=_.length<0?0:A(_.length)|0,m=s(f);for(let T=0;T<f;T+=1)m[T]=_[T]&255;return m}function p(_){if(Me(_,Uint8Array)){let f=new Uint8Array(_);return g(f.buffer,f.byteOffset,f.byteLength)}return h(_)}function g(_,f,m){if(f<0||_.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(_.byteLength<f+(m||0))throw new RangeError('"length" is outside of buffer bounds');let T;return f===void 0&&m===void 0?T=new Uint8Array(_):m===void 0?T=new Uint8Array(_,f):T=new Uint8Array(_,f,m),Object.setPrototypeOf(T,o.prototype),T}function y(_){if(o.isBuffer(_)){let f=A(_.length)|0,m=s(f);return m.length===0||_.copy(m,0,0,f),m}if(_.length!==void 0)return typeof _.length!="number"||xt(_.length)?s(0):h(_);if(_.type==="Buffer"&&Array.isArray(_.data))return h(_.data)}function A(_){if(_>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return _|0}function b(_){return+_!=_&&(_=0),o.alloc(+_)}o.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==o.prototype},o.compare=function(f,m){if(Me(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),Me(m,Uint8Array)&&(m=o.from(m,m.offset,m.byteLength)),!o.isBuffer(f)||!o.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===m)return 0;let T=f.length,P=m.length;for(let F=0,V=Math.min(T,P);F<V;++F)if(f[F]!==m[F]){T=f[F],P=m[F];break}return T<P?-1:P<T?1:0},o.isEncoding=function(f){switch(String(f).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(f,m){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return o.alloc(0);let T;if(m===void 0)for(m=0,T=0;T<f.length;++T)m+=f[T].length;let P=o.allocUnsafe(m),F=0;for(T=0;T<f.length;++T){let V=f[T];if(Me(V,Uint8Array))F+V.length>P.length?(o.isBuffer(V)||(V=o.from(V)),V.copy(P,F)):Uint8Array.prototype.set.call(P,V,F);else if(o.isBuffer(V))V.copy(P,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=V.length}return P};function w(_,f){if(o.isBuffer(_))return _.length;if(ArrayBuffer.isView(_)||Me(_,ArrayBuffer))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof _);let m=_.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&m===0)return 0;let P=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Et(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return mr(_).length;default:if(P)return T?-1:Et(_).length;f=(""+f).toLowerCase(),P=!0}}o.byteLength=w;function S(_,f,m){let T=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,f>>>=0,m<=f))return"";for(_||(_="utf8");;)switch(_){case"hex":return Ee(this,f,m);case"utf8":case"utf-8":return q(this,f,m);case"ascii":return le(this,f,m);case"latin1":case"binary":return ce(this,f,m);case"base64":return J(this,f,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ie(this,f,m);default:if(T)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),T=!0}}o.prototype._isBuffer=!0;function C(_,f,m){let T=_[f];_[f]=_[m],_[m]=T}o.prototype.swap16=function(){let f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<f;m+=2)C(this,m,m+1);return this},o.prototype.swap32=function(){let f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<f;m+=4)C(this,m,m+3),C(this,m+1,m+2);return this},o.prototype.swap64=function(){let f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<f;m+=8)C(this,m,m+7),C(this,m+1,m+6),C(this,m+2,m+5),C(this,m+3,m+4);return this},o.prototype.toString=function(){let f=this.length;return f===0?"":arguments.length===0?q(this,0,f):S.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(f){if(!o.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:o.compare(this,f)===0},o.prototype.inspect=function(){let f="",m=Q0.INSPECT_MAX_BYTES;return f=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(f+=" ... "),"<Buffer "+f+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(f,m,T,P,F){if(Me(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),!o.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(m===void 0&&(m=0),T===void 0&&(T=f?f.length:0),P===void 0&&(P=0),F===void 0&&(F=this.length),m<0||T>f.length||P<0||F>this.length)throw new RangeError("out of range index");if(P>=F&&m>=T)return 0;if(P>=F)return-1;if(m>=T)return 1;if(m>>>=0,T>>>=0,P>>>=0,F>>>=0,this===f)return 0;let V=F-P,ie=T-m,pe=Math.min(V,ie),he=this.slice(P,F),me=f.slice(m,T);for(let fe=0;fe<pe;++fe)if(he[fe]!==me[fe]){V=he[fe],ie=me[fe];break}return V<ie?-1:ie<V?1:0};function M(_,f,m,T,P){if(_.length===0)return-1;if(typeof m=="string"?(T=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,xt(m)&&(m=P?0:_.length-1),m<0&&(m=_.length+m),m>=_.length){if(P)return-1;m=_.length-1}else if(m<0)if(P)m=0;else return-1;if(typeof f=="string"&&(f=o.from(f,T)),o.isBuffer(f))return f.length===0?-1:I(_,f,m,T,P);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(_,f,m):Uint8Array.prototype.lastIndexOf.call(_,f,m):I(_,[f],m,T,P);throw new TypeError("val must be string, number or Buffer")}function I(_,f,m,T,P){let F=1,V=_.length,ie=f.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(_.length<2||f.length<2)return-1;F=2,V/=2,ie/=2,m/=2}function pe(me,fe){return F===1?me[fe]:me.readUInt16BE(fe*F)}let he;if(P){let me=-1;for(he=m;he<V;he++)if(pe(_,he)===pe(f,me===-1?0:he-me)){if(me===-1&&(me=he),he-me+1===ie)return me*F}else me!==-1&&(he-=he-me),me=-1}else for(m+ie>V&&(m=V-ie),he=m;he>=0;he--){let me=!0;for(let fe=0;fe<ie;fe++)if(pe(_,he+fe)!==pe(f,fe)){me=!1;break}if(me)return he}return-1}o.prototype.includes=function(f,m,T){return this.indexOf(f,m,T)!==-1},o.prototype.indexOf=function(f,m,T){return M(this,f,m,T,!0)},o.prototype.lastIndexOf=function(f,m,T){return M(this,f,m,T,!1)};function B(_,f,m,T){m=Number(m)||0;let P=_.length-m;T?(T=Number(T),T>P&&(T=P)):T=P;let F=f.length;T>F/2&&(T=F/2);let V;for(V=0;V<T;++V){let ie=parseInt(f.substr(V*2,2),16);if(xt(ie))return V;_[m+V]=ie}return V}function H(_,f,m,T){return qe(Et(f,_.length-m),_,m,T)}function G(_,f,m,T){return qe(K5(f),_,m,T)}function O(_,f,m,T){return qe(mr(f),_,m,T)}function j(_,f,m,T){return qe(J5(f,_.length-m),_,m,T)}o.prototype.write=function(f,m,T,P){if(m===void 0)P="utf8",T=this.length,m=0;else if(T===void 0&&typeof m=="string")P=m,T=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(T)?(T=T>>>0,P===void 0&&(P="utf8")):(P=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let F=this.length-m;if((T===void 0||T>F)&&(T=F),f.length>0&&(T<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let V=!1;for(;;)switch(P){case"hex":return B(this,f,m,T);case"utf8":case"utf-8":return H(this,f,m,T);case"ascii":case"latin1":case"binary":return G(this,f,m,T);case"base64":return O(this,f,m,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,f,m,T);default:if(V)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),V=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(_,f,m){return f===0&&m===_.length?n.fromByteArray(_):n.fromByteArray(_.slice(f,m))}function q(_,f,m){m=Math.min(_.length,m);let T=[],P=f;for(;P<m;){let F=_[P],V=null,ie=F>239?4:F>223?3:F>191?2:1;if(P+ie<=m){let pe,he,me,fe;switch(ie){case 1:F<128&&(V=F);break;case 2:pe=_[P+1],(pe&192)===128&&(fe=(F&31)<<6|pe&63,fe>127&&(V=fe));break;case 3:pe=_[P+1],he=_[P+2],(pe&192)===128&&(he&192)===128&&(fe=(F&15)<<12|(pe&63)<<6|he&63,fe>2047&&(fe<55296||fe>57343)&&(V=fe));break;case 4:pe=_[P+1],he=_[P+2],me=_[P+3],(pe&192)===128&&(he&192)===128&&(me&192)===128&&(fe=(F&15)<<18|(pe&63)<<12|(he&63)<<6|me&63,fe>65535&&fe<1114112&&(V=fe))}}V===null?(V=65533,ie=1):V>65535&&(V-=65536,T.push(V>>>10&1023|55296),V=56320|V&1023),T.push(V),P+=ie}return ue(T)}let $=4096;function ue(_){let f=_.length;if(f<=$)return String.fromCharCode.apply(String,_);let m="",T=0;for(;T<f;)m+=String.fromCharCode.apply(String,_.slice(T,T+=$));return m}function le(_,f,m){let T="";m=Math.min(_.length,m);for(let P=f;P<m;++P)T+=String.fromCharCode(_[P]&127);return T}function ce(_,f,m){let T="";m=Math.min(_.length,m);for(let P=f;P<m;++P)T+=String.fromCharCode(_[P]);return T}function Ee(_,f,m){let T=_.length;(!f||f<0)&&(f=0),(!m||m<0||m>T)&&(m=T);let P="";for(let F=f;F<m;++F)P+=n5[_[F]];return P}function Ie(_,f,m){let T=_.slice(f,m),P="";for(let F=0;F<T.length-1;F+=2)P+=String.fromCharCode(T[F]+T[F+1]*256);return P}o.prototype.slice=function(f,m){let T=this.length;f=~~f,m=m===void 0?T:~~m,f<0?(f+=T,f<0&&(f=0)):f>T&&(f=T),m<0?(m+=T,m<0&&(m=0)):m>T&&(m=T),m<f&&(m=f);let P=this.subarray(f,m);return Object.setPrototypeOf(P,o.prototype),P};function se(_,f,m){if(_%1!==0||_<0)throw new RangeError("offset is not uint");if(_+f>m)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(f,m,T){f=f>>>0,m=m>>>0,T||se(f,m,this.length);let P=this[f],F=1,V=0;for(;++V<m&&(F*=256);)P+=this[f+V]*F;return P},o.prototype.readUintBE=o.prototype.readUIntBE=function(f,m,T){f=f>>>0,m=m>>>0,T||se(f,m,this.length);let P=this[f+--m],F=1;for(;m>0&&(F*=256);)P+=this[f+--m]*F;return P},o.prototype.readUint8=o.prototype.readUInt8=function(f,m){return f=f>>>0,m||se(f,1,this.length),this[f]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(f,m){return f=f>>>0,m||se(f,2,this.length),this[f]|this[f+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(f,m){return f=f>>>0,m||se(f,2,this.length),this[f]<<8|this[f+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(f,m){return f=f>>>0,m||se(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(f,m){return f=f>>>0,m||se(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},o.prototype.readBigUInt64LE=s0(function(f){f=f>>>0,S0(f,"offset");let m=this[f],T=this[f+7];(m===void 0||T===void 0)&&W0(f,this.length-8);let P=m+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,F=this[++f]+this[++f]*2**8+this[++f]*2**16+T*2**24;return BigInt(P)+(BigInt(F)<<BigInt(32))}),o.prototype.readBigUInt64BE=s0(function(f){f=f>>>0,S0(f,"offset");let m=this[f],T=this[f+7];(m===void 0||T===void 0)&&W0(f,this.length-8);let P=m*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],F=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+T;return(BigInt(P)<<BigInt(32))+BigInt(F)}),o.prototype.readIntLE=function(f,m,T){f=f>>>0,m=m>>>0,T||se(f,m,this.length);let P=this[f],F=1,V=0;for(;++V<m&&(F*=256);)P+=this[f+V]*F;return F*=128,P>=F&&(P-=Math.pow(2,8*m)),P},o.prototype.readIntBE=function(f,m,T){f=f>>>0,m=m>>>0,T||se(f,m,this.length);let P=m,F=1,V=this[f+--P];for(;P>0&&(F*=256);)V+=this[f+--P]*F;return F*=128,V>=F&&(V-=Math.pow(2,8*m)),V},o.prototype.readInt8=function(f,m){return f=f>>>0,m||se(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},o.prototype.readInt16LE=function(f,m){f=f>>>0,m||se(f,2,this.length);let T=this[f]|this[f+1]<<8;return T&32768?T|4294901760:T},o.prototype.readInt16BE=function(f,m){f=f>>>0,m||se(f,2,this.length);let T=this[f+1]|this[f]<<8;return T&32768?T|4294901760:T},o.prototype.readInt32LE=function(f,m){return f=f>>>0,m||se(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},o.prototype.readInt32BE=function(f,m){return f=f>>>0,m||se(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},o.prototype.readBigInt64LE=s0(function(f){f=f>>>0,S0(f,"offset");let m=this[f],T=this[f+7];(m===void 0||T===void 0)&&W0(f,this.length-8);let P=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(T<<24);return(BigInt(P)<<BigInt(32))+BigInt(m+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),o.prototype.readBigInt64BE=s0(function(f){f=f>>>0,S0(f,"offset");let m=this[f],T=this[f+7];(m===void 0||T===void 0)&&W0(f,this.length-8);let P=(m<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(P)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+T)}),o.prototype.readFloatLE=function(f,m){return f=f>>>0,m||se(f,4,this.length),e.read(this,f,!0,23,4)},o.prototype.readFloatBE=function(f,m){return f=f>>>0,m||se(f,4,this.length),e.read(this,f,!1,23,4)},o.prototype.readDoubleLE=function(f,m){return f=f>>>0,m||se(f,8,this.length),e.read(this,f,!0,52,8)},o.prototype.readDoubleBE=function(f,m){return f=f>>>0,m||se(f,8,this.length),e.read(this,f,!1,52,8)};function Y(_,f,m,T,P,F){if(!o.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>P||f<F)throw new RangeError('"value" argument is out of bounds');if(m+T>_.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(f,m,T,P){if(f=+f,m=m>>>0,T=T>>>0,!P){let ie=Math.pow(2,8*T)-1;Y(this,f,m,T,ie,0)}let F=1,V=0;for(this[m]=f&255;++V<T&&(F*=256);)this[m+V]=f/F&255;return m+T},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(f,m,T,P){if(f=+f,m=m>>>0,T=T>>>0,!P){let ie=Math.pow(2,8*T)-1;Y(this,f,m,T,ie,0)}let F=T-1,V=1;for(this[m+F]=f&255;--F>=0&&(V*=256);)this[m+F]=f/V&255;return m+T},o.prototype.writeUint8=o.prototype.writeUInt8=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,1,255,0),this[m]=f&255,m+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,2,65535,0),this[m]=f&255,this[m+1]=f>>>8,m+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,2,65535,0),this[m]=f>>>8,this[m+1]=f&255,m+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,4,4294967295,0),this[m+3]=f>>>24,this[m+2]=f>>>16,this[m+1]=f>>>8,this[m]=f&255,m+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,4,4294967295,0),this[m]=f>>>24,this[m+1]=f>>>16,this[m+2]=f>>>8,this[m+3]=f&255,m+4};function oe(_,f,m,T,P){N0(f,T,P,_,m,7);let F=Number(f&BigInt(4294967295));_[m++]=F,F=F>>8,_[m++]=F,F=F>>8,_[m++]=F,F=F>>8,_[m++]=F;let V=Number(f>>BigInt(32)&BigInt(4294967295));return _[m++]=V,V=V>>8,_[m++]=V,V=V>>8,_[m++]=V,V=V>>8,_[m++]=V,m}function xe(_,f,m,T,P){N0(f,T,P,_,m,7);let F=Number(f&BigInt(4294967295));_[m+7]=F,F=F>>8,_[m+6]=F,F=F>>8,_[m+5]=F,F=F>>8,_[m+4]=F;let V=Number(f>>BigInt(32)&BigInt(4294967295));return _[m+3]=V,V=V>>8,_[m+2]=V,V=V>>8,_[m+1]=V,V=V>>8,_[m]=V,m+8}o.prototype.writeBigUInt64LE=s0(function(f,m=0){return oe(this,f,m,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=s0(function(f,m=0){return xe(this,f,m,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(f,m,T,P){if(f=+f,m=m>>>0,!P){let pe=Math.pow(2,8*T-1);Y(this,f,m,T,pe-1,-pe)}let F=0,V=1,ie=0;for(this[m]=f&255;++F<T&&(V*=256);)f<0&&ie===0&&this[m+F-1]!==0&&(ie=1),this[m+F]=(f/V>>0)-ie&255;return m+T},o.prototype.writeIntBE=function(f,m,T,P){if(f=+f,m=m>>>0,!P){let pe=Math.pow(2,8*T-1);Y(this,f,m,T,pe-1,-pe)}let F=T-1,V=1,ie=0;for(this[m+F]=f&255;--F>=0&&(V*=256);)f<0&&ie===0&&this[m+F+1]!==0&&(ie=1),this[m+F]=(f/V>>0)-ie&255;return m+T},o.prototype.writeInt8=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,1,127,-128),f<0&&(f=255+f+1),this[m]=f&255,m+1},o.prototype.writeInt16LE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,2,32767,-32768),this[m]=f&255,this[m+1]=f>>>8,m+2},o.prototype.writeInt16BE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,2,32767,-32768),this[m]=f>>>8,this[m+1]=f&255,m+2},o.prototype.writeInt32LE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,4,2147483647,-2147483648),this[m]=f&255,this[m+1]=f>>>8,this[m+2]=f>>>16,this[m+3]=f>>>24,m+4},o.prototype.writeInt32BE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[m]=f>>>24,this[m+1]=f>>>16,this[m+2]=f>>>8,this[m+3]=f&255,m+4},o.prototype.writeBigInt64LE=s0(function(f,m=0){return oe(this,f,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=s0(function(f,m=0){return xe(this,f,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Je(_,f,m,T,P,F){if(m+T>_.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Ve(_,f,m,T,P){return f=+f,m=m>>>0,P||Je(_,f,m,4),e.write(_,f,m,T,23,4),m+4}o.prototype.writeFloatLE=function(f,m,T){return Ve(this,f,m,!0,T)},o.prototype.writeFloatBE=function(f,m,T){return Ve(this,f,m,!1,T)};function n0(_,f,m,T,P){return f=+f,m=m>>>0,P||Je(_,f,m,8),e.write(_,f,m,T,52,8),m+8}o.prototype.writeDoubleLE=function(f,m,T){return n0(this,f,m,!0,T)},o.prototype.writeDoubleBE=function(f,m,T){return n0(this,f,m,!1,T)},o.prototype.copy=function(f,m,T,P){if(!o.isBuffer(f))throw new TypeError("argument should be a Buffer");if(T||(T=0),!P&&P!==0&&(P=this.length),m>=f.length&&(m=f.length),m||(m=0),P>0&&P<T&&(P=T),P===T||f.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=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),f.length-m<P-T&&(P=f.length-m+T);let F=P-T;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,T,P):Uint8Array.prototype.set.call(f,this.subarray(T,P),m),F},o.prototype.fill=function(f,m,T,P){if(typeof f=="string"){if(typeof m=="string"?(P=m,m=0,T=this.length):typeof T=="string"&&(P=T,T=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(f.length===1){let V=f.charCodeAt(0);(P==="utf8"&&V<128||P==="latin1")&&(f=V)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(m<0||this.length<m||this.length<T)throw new RangeError("Out of range index");if(T<=m)return this;m=m>>>0,T=T===void 0?this.length:T>>>0,f||(f=0);let F;if(typeof f=="number")for(F=m;F<T;++F)this[F]=f;else{let V=o.isBuffer(f)?f:o.from(f,P),ie=V.length;if(ie===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(F=0;F<T-m;++F)this[F+m]=V[F%ie]}return this};let _e={};function f0(_,f,m){_e[_]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${_}]`,this.stack,delete this.name}get code(){return _}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${_}]: ${this.message}`}}}f0("ERR_BUFFER_OUT_OF_BOUNDS",function(_){return _?`${_} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),f0("ERR_INVALID_ARG_TYPE",function(_,f){return`The "${_}" argument must be of type number. Received type ${typeof f}`},TypeError),f0("ERR_OUT_OF_RANGE",function(_,f,m){let T=`The value of "${_}" is out of range.`,P=m;return Number.isInteger(m)&&Math.abs(m)>2**32?P=r5(String(m)):typeof m=="bigint"&&(P=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(P=r5(P)),P+="n"),T+=` It must be ${f}. Received ${P}`,T},RangeError);function r5(_){let f="",m=_.length,T=_[0]==="-"?1:0;for(;m>=T+4;m-=3)f=`_${_.slice(m-3,m)}${f}`;return`${_.slice(0,m)}${f}`}function i5(_,f,m){S0(f,"offset"),(_[f]===void 0||_[f+m]===void 0)&&W0(f,_.length-(m+1))}function N0(_,f,m,T,P,F){if(_>m||_<f){let V=typeof f=="bigint"?"n":"",ie;throw f===0||f===BigInt(0)?ie=`>= 0${V} and < 2${V} ** ${(F+1)*8}${V}`:ie=`>= -(2${V} ** ${(F+1)*8-1}${V}) and < 2 ** ${(F+1)*8-1}${V}`,new _e.ERR_OUT_OF_RANGE("value",ie,_)}i5(T,P,F)}function S0(_,f){if(typeof _!="number")throw new _e.ERR_INVALID_ARG_TYPE(f,"number",_)}function W0(_,f,m){throw Math.floor(_)!==_?(S0(_,m),new _e.ERR_OUT_OF_RANGE("offset","an integer",_)):f<0?new _e.ERR_BUFFER_OUT_OF_BOUNDS:new _e.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,_)}let Q5=/[^+/0-9A-Za-z-_]/g;function j0(_){if(_=_.split("=")[0],_=_.trim().replace(Q5,""),_.length<2)return"";for(;_.length%4!==0;)_=_+"=";return _}function Et(_,f){f=f||1/0;let m,T=_.length,P=null,F=[];for(let V=0;V<T;++V){if(m=_.charCodeAt(V),m>55295&&m<57344){if(!P){if(m>56319){(f-=3)>-1&&F.push(239,191,189);continue}else if(V+1===T){(f-=3)>-1&&F.push(239,191,189);continue}P=m;continue}if(m<56320){(f-=3)>-1&&F.push(239,191,189),P=m;continue}m=(P-55296<<10|m-56320)+65536}else P&&(f-=3)>-1&&F.push(239,191,189);if(P=null,m<128){if((f-=1)<0)break;F.push(m)}else if(m<2048){if((f-=2)<0)break;F.push(m>>6|192,m&63|128)}else if(m<65536){if((f-=3)<0)break;F.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((f-=4)<0)break;F.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return F}function K5(_){let f=[];for(let m=0;m<_.length;++m)f.push(_.charCodeAt(m)&255);return f}function J5(_,f){let m,T,P,F=[];for(let V=0;V<_.length&&!((f-=2)<0);++V)m=_.charCodeAt(V),T=m>>8,P=m%256,F.push(P),F.push(T);return F}function mr(_){return n.toByteArray(j0(_))}function qe(_,f,m,T){let P;for(P=0;P<T&&!(P+m>=f.length||P>=_.length);++P)f[P+m]=_[P];return P}function Me(_,f){return _ instanceof f||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===f.name}function xt(_){return _!==_}let n5=function(){let _="0123456789abcdef",f=new Array(256);for(let m=0;m<16;++m){let T=m*16;for(let P=0;P<16;++P)f[T+P]=_[m]+_[P]}return f}();function s0(_){return typeof BigInt>"u"?Rt:_}function Rt(){throw new Error("BigInt not supported")}return Q0}var a5,P2,e1,I2,Q0,H2,D2=Xe(()=>{E();x();k();R();a5={},P2=!1;e1={},I2=!1;Q0={},H2=!1});var K0,z,T9,M9,F2=Xe(()=>{E();x();k();R();D2();K0=O2();K0.Buffer;K0.SlowBuffer;K0.INSPECT_MAX_BYTES;K0.kMaxLength;z=K0.Buffer,T9=K0.INSPECT_MAX_BYTES,M9=K0.kMaxLength});var k=Xe(()=>{F2()});var W2=t0((Rr,kr)=>{E();x();k();R();(function(n,e){typeof Rr=="object"&&typeof kr<"u"?kr.exports=e():typeof define=="function"&&define.amd?define(e):n.Stats=e()})(Rr,function(){var n=function(){function e(u){return i.appendChild(u.dom),u}function t(u){for(var h=0;h<i.children.length;h++)i.children[h].style.display=h===u?"block":"none";r=u}var r=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(u){u.preventDefault(),t(++r%i.children.length)},!1);var s=(performance||Date).now(),o=s,a=0,v=e(new n.Panel("FPS","#0ff","#002")),l=e(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=e(new n.Panel("MB","#f08","#201"));return t(0),{REVISION:16,dom:i,addPanel:e,showPanel:t,begin:function(){s=(performance||Date).now()},end:function(){a++;var u=(performance||Date).now();if(l.update(u-s,200),u>o+1e3&&(v.update(1e3*a/(u-o),100),o=u,a=0,c)){var h=performance.memory;c.update(h.usedJSHeapSize/1048576,h.jsHeapSizeLimit/1048576)}return u},update:function(){s=this.end()},domElement:i,setMode:t}};return n.Panel=function(e,t,r){var i=1/0,s=0,o=Math.round,a=o(window.devicePixelRatio||1),v=80*a,l=48*a,c=3*a,u=2*a,h=3*a,p=15*a,g=74*a,y=30*a,A=document.createElement("canvas");A.width=v,A.height=l,A.style.cssText="width:80px;height:48px";var b=A.getContext("2d");return b.font="bold "+9*a+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=r,b.fillRect(0,0,v,l),b.fillStyle=t,b.fillText(e,c,u),b.fillRect(h,p,g,y),b.fillStyle=r,b.globalAlpha=.9,b.fillRect(h,p,g,y),{dom:A,update:function(w,S){i=Math.min(i,w),s=Math.max(s,w),b.fillStyle=r,b.globalAlpha=1,b.fillRect(0,0,v,p),b.fillStyle=t,b.fillText(o(w)+" "+e+" ("+o(i)+"-"+o(s)+")",c,u),b.drawImage(A,h+a,p,g-a,y,h,p,g-a,y),b.fillRect(h+g-a,p,a,y),b.fillStyle=r,b.globalAlpha=.9,b.fillRect(h+g-a,p,a,o((1-w/S)*y))}}},n})});var Us=t0((Ls,x1)=>{E();x();k();R();(function(n,e){typeof x1=="object"&&x1.exports?x1.exports=e():n.nearley=e()})(Ls,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 e(v,l,c,u){this.rule=v,this.dot=l,this.reference=c,this.data=[],this.wantedBy=u,this.isComplete=this.dot===v.symbols.length}e.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},e.prototype.nextState=function(v){var l=new e(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},e.prototype.build=function(){var v=[],l=this;do v.push(l.right.data),l=l.left;while(l.left);return v.reverse(),v},e.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function t(v,l){this.grammar=v,this.index=l,this.states=[],this.wants={},this.scannable=[],this.completed={}}t.prototype.process=function(v){for(var l=this.states,c=this.wants,u=this.completed,h=0;h<l.length;h++){var p=l[h];if(p.isComplete){if(p.finish(),p.data!==s.fail){for(var g=p.wantedBy,y=g.length;y--;){var A=g[y];this.complete(A,p)}if(p.reference===this.index){var b=p.rule.name;(this.completed[b]=this.completed[b]||[]).push(p)}}}else{var b=p.rule.symbols[p.dot];if(typeof b!="string"){this.scannable.push(p);continue}if(c[b]){if(c[b].push(p),u.hasOwnProperty(b))for(var w=u[b],y=0;y<w.length;y++){var S=w[y];this.complete(p,S)}}else c[b]=[p],this.predict(b)}}},t.prototype.predict=function(v){for(var l=this.grammar.byName[v]||[],c=0;c<l.length;c++){var u=l[c],h=this.wants[v],p=new e(u,0,this.index,h);this.states.push(p)}},t.prototype.complete=function(v,l){var c=v.nextState(l);this.states.push(c)};function r(v,l){this.rules=v,this.start=l||this.rules[0].name;var c=this.byName={};this.rules.forEach(function(u){c.hasOwnProperty(u.name)||(c[u.name]=[]),c[u.name].push(u)})}r.fromCompiled=function(u,l){var c=u.Lexer;u.ParserStart&&(l=u.ParserStart,u=u.ParserRules);var u=u.map(function(p){return new n(p.name,p.symbols,p.postprocess)}),h=new r(u,l);return h.lexer=c,h};function i(){this.reset("")}i.prototype.reset=function(v,l){this.buffer=v,this.index=0,this.line=l?l.line:1,this.lastLineBreak=l?-l.col:0},i.prototype.next=function(){if(this.index<this.buffer.length){var v=this.buffer[this.index++];return v===`
|
|
2
|
+
`&&(this.line+=1,this.lastLineBreak=this.index),{value:v}}},i.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},i.prototype.formatError=function(v,l){var c=this.buffer;if(typeof c=="string"){var u=c.split(`
|
|
3
|
+
`).slice(Math.max(0,this.line-5),this.line),h=c.indexOf(`
|
|
4
|
+
`,this.index);h===-1&&(h=c.length);var p=this.index-this.lastLineBreak,g=String(this.line).length;return l+=" at line "+this.line+" col "+p+`:
|
|
5
5
|
|
|
6
6
|
`,l+=u.map(function(A,b){return y(this.line-u.length+b+1,g)+" "+A},this).join(`
|
|
7
7
|
`),l+=`
|
|
8
8
|
`+y("",g+p)+`^
|
|
9
|
-
`,l}else return l+" at index "+(this.index-1);function y(A,b){var
|
|
10
|
-
`),this.displayStateStack(
|
|
11
|
-
`);var g=p.map(function(y){return this.buildFirstStateStack(y,[])||[y]},this);g.forEach(function(y){var A=y[0],b=A.rule.symbols[A.dot],
|
|
12
|
-
`)},s.prototype.displayStateStack=function(
|
|
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:a=>e(a[0].join(""))}],ParserStart:"MAIN"};typeof M1<"u"&&typeof M1.exports<"u"?M1.exports=v:window.grammar=v})()});var Ai=i0((yb,Xs)=>{E();x();k();R();var Qs=js(),C7=Ys();function Zs(n){function e(t,r){return r==="compound"?Object.keys(t).reduce(function(i,s){return i[s]=Zs(t[s]),i},{}):r==="list"?Array.isArray(t.value)?t.value.map(function(i){return e(i,t.type)}):[]:t}return e(n.value,n.type)}function S1({value:n,type:e}){if(e==="compound"){let r=[],i=Object.entries(n);for(let s=0;s<i.length;s++){let o=i[s][0],v=S1(i[s][1]);o==="string"&&(v=Ks(v)),r.push(`${o}:${v}`)}return`{${r.join(",")}}`}else{if(e==="list")return Array.isArray(n.value)?`[${Js(n)}]`:"[]";if(e==="byteArray"||e==="intArray"||e==="longArray"){let r=P7(e),i=Js(n);return`[${r}${i}]`}}let t=n+I7(n,e);return e==="string"&&(t=Ks(t)),t}function Ks(n){return n=n.replace(/"/g,'\\"'),(/'|{|}|\[|\]|:|;|,|\(|\)|§|=/g.test(n)||n==="")&&(n=`"${n}"`),n}function Js({value:n,type:e}){let t=B7(n),r=[];for(let i=0;i<n.length;i++){let s=n[i];s!==void 0&&(s=S1({value:s,type:e}),t?r.push(`${i}:${s}`):r.push(s))}return r.join(",")}function B7(n){for(let e=0;e<n.length;e++)if(n[e]===void 0)return!0;return!1}var P7=n=>n.charAt(0).toUpperCase()+";";function I7(n,e){return e==="double"?n>>0===n?"d":"":{int:"",byte:"b",short:"s",float:"f",long:"l",string:""}[e]}function H7(n){return S1(qs(n))}function qs(n){try{let e=new Qs.Parser(Qs.Grammar.fromCompiled(C7));return e.feed(n),e.results[0]}catch(e){throw e.message=`Error parsing text '${n}'`,e}}Xs.exports={parse:qs,simplify:Zs,stringify:S1,normalize:H7}});var io={};$5(io,{camelCase:()=>L7,capitalCase:()=>xi,constantCase:()=>V7,dotCase:()=>W7,kebabCase:()=>N7,noCase:()=>P5,pascalCase:()=>U7,pascalSnakeCase:()=>G7,pathCase:()=>j7,sentenceCase:()=>Y7,snakeCase:()=>Ri,split:()=>Ei,splitSeparateNumbers:()=>to,trainCase:()=>Q7});function Ei(n){let e=n.trim();e=e.replace(O7,$s).replace(D7,$s),e=e.replace(z7,"\0");let t=0,r=e.length;for(;e.charAt(t)==="\0";)t++;if(t===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(t,r).split(/\0/g)}function to(n){let e=Ei(n);for(let t=0;t<e.length;t++){let r=e[t],i=F7.exec(r);if(i){let s=i.index+(i[1]??i[2]).length;e.splice(t,1,r.slice(0,s),r.slice(s))}}return e}function P5(n,e){let[t,r,i]=Lt(n,e);return t+r.map(I5(e?.locale)).join(e?.delimiter??" ")+i}function L7(n,e){let[t,r,i]=Lt(n,e),s=I5(e?.locale),o=H5(e?.locale),v=e?.mergeAmbiguousCharacters?C1(s,o):ro(s,o);return t+r.map((a,l)=>l===0?s(a):v(a,l)).join(e?.delimiter??"")+i}function U7(n,e){let[t,r,i]=Lt(n,e),s=I5(e?.locale),o=H5(e?.locale),v=e?.mergeAmbiguousCharacters?C1(s,o):ro(s,o);return t+r.map(v).join(e?.delimiter??"")+i}function G7(n,e){return xi(n,{delimiter:"_",...e})}function xi(n,e){let[t,r,i]=Lt(n,e),s=I5(e?.locale),o=H5(e?.locale);return t+r.map(C1(s,o)).join(e?.delimiter??" ")+i}function V7(n,e){let[t,r,i]=Lt(n,e);return t+r.map(H5(e?.locale)).join(e?.delimiter??"_")+i}function W7(n,e){return P5(n,{delimiter:".",...e})}function N7(n,e){return P5(n,{delimiter:"-",...e})}function j7(n,e){return P5(n,{delimiter:"/",...e})}function Y7(n,e){let[t,r,i]=Lt(n,e),s=I5(e?.locale),o=H5(e?.locale),v=C1(s,o);return t+r.map((a,l)=>l===0?v(a):s(a)).join(e?.delimiter??" ")+i}function Ri(n,e){return P5(n,{delimiter:"_",...e})}function Q7(n,e){return xi(n,{delimiter:"-",...e})}function I5(n){return n===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(n)}function H5(n){return n===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(n)}function C1(n,e){return t=>`${e(t[0])}${n(t.slice(1))}`}function ro(n,e){return(t,r)=>{let i=t[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+n(t.slice(1))}}function Lt(n,e={}){let t=e.split??(e.separateNumbers?to:Ei),r=e.prefixCharacters??eo,i=e.suffixCharacters??eo,s=0,o=n.length;for(;s<n.length;){let v=n.charAt(s);if(!r.includes(v))break;s++}for(;o>s;){let v=o-1,a=n.charAt(v);if(!i.includes(a))break;o=v}return[n.slice(0,s),t(n.slice(s,o)),n.slice(o)]}var O7,D7,F7,z7,$s,eo,ki=$e(()=>{E();x();k();R();O7=/([\p{Ll}\d])(\p{Lu})/gu,D7=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,F7=/(\d)\p{Ll}|(\p{L})\d/u,z7=/[^\p{L}\d]+/giu,$s="$1\0$2",eo=""});var no=i0((Mb,K7)=>{K7.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 oo=i0((Sb,so)=>{E();x();k();R();var Ut=1e3,Gt=Ut*60,Vt=Gt*60,ut=Vt*24,J7=ut*7,Z7=ut*365.25;so.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return q7(n);if(t==="number"&&isFinite(n))return e.long?$7(n):X7(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function q7(n){if(n=String(n),!(n.length>100)){var e=/^(-?(?:\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(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*Z7;case"weeks":case"week":case"w":return t*J7;case"days":case"day":case"d":return t*ut;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Vt;case"minutes":case"minute":case"mins":case"min":case"m":return t*Gt;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ut;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function X7(n){var e=Math.abs(n);return e>=ut?Math.round(n/ut)+"d":e>=Vt?Math.round(n/Vt)+"h":e>=Gt?Math.round(n/Gt)+"m":e>=Ut?Math.round(n/Ut)+"s":n+"ms"}function $7(n){var e=Math.abs(n);return e>=ut?B1(n,e,ut,"day"):e>=Vt?B1(n,e,Vt,"hour"):e>=Gt?B1(n,e,Gt,"minute"):e>=Ut?B1(n,e,Ut,"second"):n+" ms"}function B1(n,e,t,r){var i=e>=t*1.5;return Math.round(n/t)+" "+r+(i?"s":"")}});var vo=i0((Hb,ao)=>{E();x();k();R();function e8(n){t.debug=t,t.default=t,t.coerce=a,t.disable=o,t.enable=i,t.enabled=v,t.humanize=oo(),t.destroy=l,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let u=0;for(let f=0;f<c.length;f++)u=(u<<5)-u+c.charCodeAt(f),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(c){let u,f=null,p,g;function y(...A){if(!y.enabled)return;let b=y,_=Number(new Date),S=_-(u||_);b.diff=S,b.prev=u,b.curr=_,u=_,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let C=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(P,B)=>{if(P==="%%")return"%";C++;let H=t.formatters[B];if(typeof H=="function"){let G=A[C];P=H.call(b,G),A.splice(C,1),C--}return P}),t.formatArgs.call(b,A),(b.log||t.log).apply(b,A)}return y.namespace=c,y.useColors=t.useColors(),y.color=t.selectColor(c),y.extend=r,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(p!==t.namespaces&&(p=t.namespaces,g=t.enabled(c)),g),set:A=>{f=A}}),typeof t.init=="function"&&t.init(y),y}function r(c,u){let f=t(this.namespace+(typeof u>"u"?":":u)+c);return f.log=this.log,f}function i(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let u=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of u)f[0]==="-"?t.skips.push(f.slice(1)):t.names.push(f)}function s(c,u){let f=0,p=0,g=-1,y=0;for(;f<c.length;)if(p<u.length&&(u[p]===c[f]||u[p]==="*"))u[p]==="*"?(g=p,y=f,p++):(f++,p++);else if(g!==-1)p=g+1,y++,f=y;else return!1;for(;p<u.length&&u[p]==="*";)p++;return p===u.length}function o(){let c=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),c}function v(c){for(let u of t.skips)if(s(c,u))return!1;for(let u of t.names)if(s(c,u))return!0;return!1}function a(c){return c instanceof Error?c.stack||c.message:c}function l(){}return t.enable(t.load()),t}ao.exports=e8});var lo=i0((t0,P1)=>{E();x();k();R();t0.formatArgs=r8;t0.save=i8;t0.load=n8;t0.useColors=t8;t0.storage=s8();t0.destroy=(()=>{let n=!1;return()=>{n||(n=!0)}})();t0.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 t8(){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 r8(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 e="color: "+this.color;n.splice(1,0,e,"color: inherit");let t=0,r=0;n[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(r=t))}),n.splice(r,0,e)}t0.log=console.debug||console.log||(()=>{});function i8(n){try{n?t0.storage.setItem("debug",n):t0.storage.removeItem("debug")}catch{}}function n8(){let n;try{n=t0.storage.getItem("debug")||t0.storage.getItem("DEBUG")}catch{}return!n&&typeof D<"u"&&"env"in D&&(n=D.env.DEBUG),n}function s8(){try{return localStorage}catch{}}P1.exports=vo()(t0);var{formatters:o8}=P1.exports;o8.j=function(n){try{return JSON.stringify(n)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var co=i0(Wt=>{"use strict";E();x();k();R();var a8=Wt&&Wt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.debug=void 0;var v8=a8(lo());Wt.debug=(0,v8.default)("mineflayer-mouse")});var mo=i0(ft=>{"use strict";E();x();k();R();var l8=ft&&ft.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ft,"__esModule",{value:!0});ft.isEntityAttackable=void 0;ft.isArmorStandAttackable=ho;var uo=(ki(),n6(io)),O5=l8(no()),c8=co(),fo=Object.fromEntries([...O5.default.attackable,...O5.default.notAttackable].map(n=>[n,!0])),d8=O5.default.attackable,u8=(n,e)=>{if(!e.name)throw new Error("Entity has no name");let t=n.entitiesByName[e.name],i=O5.default.entityRenames[e.name]||O5.default.entityRenames[(0,uo.snakeCase)(e.name)]||e.name;if(!fo[i]&&(i=(0,uo.snakeCase)(i),!fo[i]))return(0,c8.debug)(`Cannot find entity ${i} in entityData.json`),!1;let s=f8[i];return s?s(e,t):d8.includes(i)};ft.isEntityAttackable=u8;var f8={armor_stand:ho};function ho(n,e){let t=Number(n.metadata?.[e.metadataKeys?.indexOf("client_flags")??14]??0),r=(t&16)!==0,i=(t&8)!==0,s=(t&4)!==0,o=(t&1)!==0;return!r}});var J3=i0((px,wv)=>{wv.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 Z3=i0(V1=>{"use strict";E();x();k();R();Object.defineProperty(V1,"__esModule",{value:!0});V1.versionToNumber=void 0;var Av=n=>{let[e,t="0",r="0"]=n.split(".");return+`${e.padStart(2,"0")}${parseInt(t).toString().padStart(2,"0")}${parseInt(r).toString().padStart(2,"0")}`};V1.versionToNumber=Av});var X3=i0(Jt=>{"use strict";E();x();k();R();var Ev=Jt&&Jt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.getRenamedData=void 0;var q3=Ev(J3()),L0=Z3(),xv=(n,e,t,r)=>{let i=(0,L0.versionToNumber)(t),s=(0,L0.versionToNumber)(r),o=i<s?1:-1,v=o>0?1:0,a=e,l=Object.keys(q3.default).sort((f,p)=>o*((0,L0.versionToNumber)(f)-(0,L0.versionToNumber)(p))),c=o>0?s:i,u=o>0?i:s;for(let f of l.filter(p=>(0,L0.versionToNumber)(p)<=c&&(0,L0.versionToNumber)(p)>=u)){if(o>0&&(0,L0.versionToNumber)(f)>=c||o<0&&(0,L0.versionToNumber)(f)<=u)break;let p=q3.default[f][n];if(p)for(let g of p){let y=g[v],A=g[1-v];if(Array.isArray(a))a.includes(A)&&(a=a.map(b=>b===A?y:b));else if(a===A){a=y;break}}}return a};Jt.getRenamedData=xv});import*as s0 from"three";function $1(){return new s0.ShaderMaterial({vertexShader:Pv,fragmentShader:Iv,uniforms:s0.UniformsUtils.merge([s0.UniformsLib.fog,{u_atlas:{value:null},u_tintPalette:{value:null},u_debugMode:{value:0},u_cameraOrigin:{value:new s0.Vector3},u_cameraOriginFrac:{value:new s0.Vector3}}]),transparent:!1,depthWrite:!0,depthTest:!0,blending:s0.NoBlending,glslVersion:s0.GLSL3,fog:!0})}var Pv,Iv,er,d0,va,bt=$e(()=>{"use strict";E();x();k();R();Pv=`
|
|
9
|
+
`,l}else return l+" at index "+(this.index-1);function y(A,b){var w=String(A);return Array(b-w.length+1).join(" ")+w}};function s(v,l,c){if(v instanceof r)var u=v,c=l;else var u=r.fromCompiled(v,l);this.grammar=u,this.options={keepHistory:!1,lexer:u.lexer||new i};for(var h in c||{})this.options[h]=c[h];this.lexer=this.options.lexer,this.lexerState=void 0;var p=new t(u,0),g=this.table=[p];p.wants[u.start]=[],p.predict(u.start),p.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(I){var g=new t(this.grammar,this.current+1);this.table.push(g);var u=new Error(this.reportLexerError(I));throw u.offset=this.current,u.token=I.token,u}var h=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var p=this.current+1,g=new t(this.grammar,p);this.table.push(g);for(var y=c.text!==void 0?c.text:c.value,A=l.constructor===i?c.value:c,b=h.scannable,w=b.length;w--;){var S=b[w],C=S.rule.symbols[S.dot];if(C.test?C.test(A):C.type?C.type===c.type:C.literal===y){var M=S.nextState({data:A,token:c,isToken:!0,reference:p-1});g.states.push(M)}}if(g.process(),g.states.length===0){var u=new Error(this.reportError(c));throw u.offset=this.current,u.token=c,u}this.options.keepHistory&&(h.lexerState=l.save()),this.current++}return h&&(this.lexerState=l.save()),this.results=this.finish(),this},s.prototype.reportLexerError=function(v){var l,c,u=v.token;return u?(l="input "+JSON.stringify(u.text[0])+" (lexer error)",c=this.lexer.formatError(u,"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 u=this.table.length-2,h=this.table[u],p=h.states.filter(function(y){var A=y.rule.symbols[y.dot];return A&&typeof A!="string"});if(p.length===0)c.push("Unexpected "+l+`. I did not expect any more input. Here is the state of my parse table:
|
|
10
|
+
`),this.displayStateStack(h.states,c);else{c.push("Unexpected "+l+`. Instead, I was expecting to see one of the following:
|
|
11
|
+
`);var g=p.map(function(y){return this.buildFirstStateStack(y,[])||[y]},this);g.forEach(function(y){var A=y[0],b=A.rule.symbols[A.dot],w=this.getSymbolDisplay(b);c.push("A "+w+" based on:"),this.displayStateStack(y,c)},this)}return c.push(""),c.join(`
|
|
12
|
+
`)},s.prototype.displayStateStack=function(v,l){for(var c,u=0,h=0;h<v.length;h++){var p=v[h],g=p.rule.toString(p.dot);g===c?u++:(u>0&&l.push(" ^ "+u+" more lines identical to this"),u=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],u=[v].concat(l),h=this.buildFirstStateStack(c,u);return h===null?null:[v].concat(h)},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(u){u.rule.name===l&&u.dot===u.rule.symbols.length&&u.reference===0&&u.data!==s.fail&&v.push(u)}),v.map(function(u){return u.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:r,Rule:n}})});var Gs=t0((lb,R1)=>{E();x();k();R();(function(){function n(v){return v[0]}function e(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"},u=v.charAt(v.length-1).toLowerCase();if(l.indexOf(u)!==-1){let y=parseFloat(v.substring(0,v.length-1));return isNaN(y)?{value:v,type:"string"}:{value:y,type:c[u]}}let h=parseFloat(v),p=v.includes("."),g=h>>0===h;return!isNaN(v)&&(p||g)?{value:h,type:p?"double":"int"}:{value:v,type:"string"}}function t(v,l){v[0]!==void 0&&(l[v[0]]=v[1])}function r(v){let l={};t(v[2],l);for(let c in v[3])t(v[3][c][3],l);return{type:"compound",value:l}}function i(v){let l=[v[6]];for(let u in v[7])l.push(v[7][u][3]);return{type:{B:"byteArray",I:"intArray",L:"longArray"}[v[2]],value:{type:l[0].type,value:l.map(u=>u.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=[];t(v[2],l);for(let c in v[3])t(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:r},{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:i},{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=>e(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=>e(v[0].join(""))}],ParserStart:"MAIN"};typeof R1<"u"&&typeof R1.exports<"u"?R1.exports=a:window.grammar=a})()});var yi=t0((hb,Qs)=>{E();x();k();R();var Vs=Us(),x7=Gs();function js(n){function e(t,r){return r==="compound"?Object.keys(t).reduce(function(i,s){return i[s]=js(t[s]),i},{}):r==="list"?Array.isArray(t.value)?t.value.map(function(i){return e(i,t.type)}):[]:t}return e(n.value,n.type)}function k1({value:n,type:e}){if(e==="compound"){let r=[],i=Object.entries(n);for(let s=0;s<i.length;s++){let o=i[s][0],a=k1(i[s][1]);o==="string"&&(a=Ns(a)),r.push(`${o}:${a}`)}return`{${r.join(",")}}`}else{if(e==="list")return Array.isArray(n.value)?`[${Ws(n)}]`:"[]";if(e==="byteArray"||e==="intArray"||e==="longArray"){let r=k7(e),i=Ws(n);return`[${r}${i}]`}}let t=n+T7(n,e);return e==="string"&&(t=Ns(t)),t}function Ns(n){return n=n.replace(/"/g,'\\"'),(/'|{|}|\[|\]|:|;|,|\(|\)|§|=/g.test(n)||n==="")&&(n=`"${n}"`),n}function Ws({value:n,type:e}){let t=R7(n),r=[];for(let i=0;i<n.length;i++){let s=n[i];s!==void 0&&(s=k1({value:s,type:e}),t?r.push(`${i}:${s}`):r.push(s))}return r.join(",")}function R7(n){for(let e=0;e<n.length;e++)if(n[e]===void 0)return!0;return!1}var k7=n=>n.charAt(0).toUpperCase()+";";function T7(n,e){return e==="double"?n>>0===n?"d":"":{int:"",byte:"b",short:"s",float:"f",long:"l",string:""}[e]}function M7(n){return k1(Ys(n))}function Ys(n){try{let e=new Vs.Parser(Vs.Grammar.fromCompiled(x7));return e.feed(n),e.results[0]}catch(e){throw e.message=`Error parsing text '${n}'`,e}}Qs.exports={parse:Ys,simplify:js,stringify:k1,normalize:M7}});var Xs={};q5(Xs,{camelCase:()=>I7,capitalCase:()=>wi,constantCase:()=>D7,dotCase:()=>F7,kebabCase:()=>z7,noCase:()=>S5,pascalCase:()=>H7,pascalSnakeCase:()=>O7,pathCase:()=>L7,sentenceCase:()=>U7,snakeCase:()=>Ai,split:()=>_i,splitSeparateNumbers:()=>qs,trainCase:()=>G7});function _i(n){let e=n.trim();e=e.replace(S7,Ks).replace(C7,Ks),e=e.replace(P7,"\0");let t=0,r=e.length;for(;e.charAt(t)==="\0";)t++;if(t===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(t,r).split(/\0/g)}function qs(n){let e=_i(n);for(let t=0;t<e.length;t++){let r=e[t],i=B7.exec(r);if(i){let s=i.index+(i[1]??i[2]).length;e.splice(t,1,r.slice(0,s),r.slice(s))}}return e}function S5(n,e){let[t,r,i]=zt(n,e);return t+r.map(C5(e?.locale)).join(e?.delimiter??" ")+i}function I7(n,e){let[t,r,i]=zt(n,e),s=C5(e?.locale),o=B5(e?.locale),a=e?.mergeAmbiguousCharacters?T1(s,o):Zs(s,o);return t+r.map((v,l)=>l===0?s(v):a(v,l)).join(e?.delimiter??"")+i}function H7(n,e){let[t,r,i]=zt(n,e),s=C5(e?.locale),o=B5(e?.locale),a=e?.mergeAmbiguousCharacters?T1(s,o):Zs(s,o);return t+r.map(a).join(e?.delimiter??"")+i}function O7(n,e){return wi(n,{delimiter:"_",...e})}function wi(n,e){let[t,r,i]=zt(n,e),s=C5(e?.locale),o=B5(e?.locale);return t+r.map(T1(s,o)).join(e?.delimiter??" ")+i}function D7(n,e){let[t,r,i]=zt(n,e);return t+r.map(B5(e?.locale)).join(e?.delimiter??"_")+i}function F7(n,e){return S5(n,{delimiter:".",...e})}function z7(n,e){return S5(n,{delimiter:"-",...e})}function L7(n,e){return S5(n,{delimiter:"/",...e})}function U7(n,e){let[t,r,i]=zt(n,e),s=C5(e?.locale),o=B5(e?.locale),a=T1(s,o);return t+r.map((v,l)=>l===0?a(v):s(v)).join(e?.delimiter??" ")+i}function Ai(n,e){return S5(n,{delimiter:"_",...e})}function G7(n,e){return wi(n,{delimiter:"-",...e})}function C5(n){return n===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(n)}function B5(n){return n===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(n)}function T1(n,e){return t=>`${e(t[0])}${n(t.slice(1))}`}function Zs(n,e){return(t,r)=>{let i=t[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+n(t.slice(1))}}function zt(n,e={}){let t=e.split??(e.separateNumbers?qs:_i),r=e.prefixCharacters??Js,i=e.suffixCharacters??Js,s=0,o=n.length;for(;s<n.length;){let a=n.charAt(s);if(!r.includes(a))break;s++}for(;o>s;){let a=o-1,v=n.charAt(a);if(!i.includes(v))break;o=a}return[n.slice(0,s),t(n.slice(s,o)),n.slice(o)]}var S7,C7,B7,P7,Ks,Js,Ei=Xe(()=>{E();x();k();R();S7=/([\p{Ll}\d])(\p{Lu})/gu,C7=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,B7=/(\d)\p{Ll}|(\p{L})\d/u,P7=/[^\p{L}\d]+/giu,Ks="$1\0$2",Js=""});var $s=t0((Eb,V7)=>{V7.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 to=t0((xb,eo)=>{E();x();k();R();var Lt=1e3,Ut=Lt*60,Gt=Ut*60,dt=Gt*24,N7=dt*7,W7=dt*365.25;eo.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return j7(n);if(t==="number"&&isFinite(n))return e.long?Q7(n):Y7(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function j7(n){if(n=String(n),!(n.length>100)){var e=/^(-?(?:\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(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*W7;case"weeks":case"week":case"w":return t*N7;case"days":case"day":case"d":return t*dt;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Gt;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ut;case"seconds":case"second":case"secs":case"sec":case"s":return t*Lt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Y7(n){var e=Math.abs(n);return e>=dt?Math.round(n/dt)+"d":e>=Gt?Math.round(n/Gt)+"h":e>=Ut?Math.round(n/Ut)+"m":e>=Lt?Math.round(n/Lt)+"s":n+"ms"}function Q7(n){var e=Math.abs(n);return e>=dt?M1(n,e,dt,"day"):e>=Gt?M1(n,e,Gt,"hour"):e>=Ut?M1(n,e,Ut,"minute"):e>=Lt?M1(n,e,Lt,"second"):n+" ms"}function M1(n,e,t,r){var i=e>=t*1.5;return Math.round(n/t)+" "+r+(i?"s":"")}});var io=t0((Sb,ro)=>{E();x();k();R();function K7(n){t.debug=t,t.default=t,t.coerce=v,t.disable=o,t.enable=i,t.enabled=a,t.humanize=to(),t.destroy=l,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let u=0;for(let h=0;h<c.length;h++)u=(u<<5)-u+c.charCodeAt(h),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(c){let u,h=null,p,g;function y(...A){if(!y.enabled)return;let b=y,w=Number(new Date),S=w-(u||w);b.diff=S,b.prev=u,b.curr=w,u=w,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let C=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(I,B)=>{if(I==="%%")return"%";C++;let H=t.formatters[B];if(typeof H=="function"){let G=A[C];I=H.call(b,G),A.splice(C,1),C--}return I}),t.formatArgs.call(b,A),(b.log||t.log).apply(b,A)}return y.namespace=c,y.useColors=t.useColors(),y.color=t.selectColor(c),y.extend=r,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==t.namespaces&&(p=t.namespaces,g=t.enabled(c)),g),set:A=>{h=A}}),typeof t.init=="function"&&t.init(y),y}function r(c,u){let h=t(this.namespace+(typeof u>"u"?":":u)+c);return h.log=this.log,h}function i(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let u=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of u)h[0]==="-"?t.skips.push(h.slice(1)):t.names.push(h)}function s(c,u){let h=0,p=0,g=-1,y=0;for(;h<c.length;)if(p<u.length&&(u[p]===c[h]||u[p]==="*"))u[p]==="*"?(g=p,y=h,p++):(h++,p++);else if(g!==-1)p=g+1,y++,h=y;else return!1;for(;p<u.length&&u[p]==="*";)p++;return p===u.length}function o(){let c=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),c}function a(c){for(let u of t.skips)if(s(c,u))return!1;for(let u of t.names)if(s(c,u))return!0;return!1}function v(c){return c instanceof Error?c.stack||c.message:c}function l(){}return t.enable(t.load()),t}ro.exports=K7});var no=t0((e0,S1)=>{E();x();k();R();e0.formatArgs=q7;e0.save=Z7;e0.load=X7;e0.useColors=J7;e0.storage=$7();e0.destroy=(()=>{let n=!1;return()=>{n||(n=!0)}})();e0.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 J7(){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 q7(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+S1.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;n.splice(1,0,e,"color: inherit");let t=0,r=0;n[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(r=t))}),n.splice(r,0,e)}e0.log=console.debug||console.log||(()=>{});function Z7(n){try{n?e0.storage.setItem("debug",n):e0.storage.removeItem("debug")}catch{}}function X7(){let n;try{n=e0.storage.getItem("debug")||e0.storage.getItem("DEBUG")}catch{}return!n&&typeof D<"u"&&"env"in D&&(n=D.env.DEBUG),n}function $7(){try{return localStorage}catch{}}S1.exports=io()(e0);var{formatters:e8}=S1.exports;e8.j=function(n){try{return JSON.stringify(n)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var so=t0(Vt=>{"use strict";E();x();k();R();var t8=Vt&&Vt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.debug=void 0;var r8=t8(no());Vt.debug=(0,r8.default)("mineflayer-mouse")});var lo=t0(ut=>{"use strict";E();x();k();R();var i8=ut&&ut.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ut,"__esModule",{value:!0});ut.isEntityAttackable=void 0;ut.isArmorStandAttackable=vo;var oo=(Ei(),Xa(Xs)),P5=i8($s()),n8=so(),ao=Object.fromEntries([...P5.default.attackable,...P5.default.notAttackable].map(n=>[n,!0])),s8=P5.default.attackable,o8=(n,e)=>{if(!e.name)throw new Error("Entity has no name");let t=n.entitiesByName[e.name],i=P5.default.entityRenames[e.name]||P5.default.entityRenames[(0,oo.snakeCase)(e.name)]||e.name;if(!ao[i]&&(i=(0,oo.snakeCase)(i),!ao[i]))return(0,n8.debug)(`Cannot find entity ${i} in entityData.json`),!1;let s=a8[i];return s?s(e,t):s8.includes(i)};ut.isEntityAttackable=o8;var a8={armor_stand:vo};function vo(n,e){let t=Number(n.metadata?.[e.metadataKeys?.indexOf("client_flags")??14]??0),r=(t&16)!==0,i=(t&8)!==0,s=(t&4)!==0,o=(t&1)!==0;return!r}});var N3=t0((dx,pv)=>{pv.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 W3=t0(L1=>{"use strict";E();x();k();R();Object.defineProperty(L1,"__esModule",{value:!0});L1.versionToNumber=void 0;var gv=n=>{let[e,t="0",r="0"]=n.split(".");return+`${e.padStart(2,"0")}${parseInt(t).toString().padStart(2,"0")}${parseInt(r).toString().padStart(2,"0")}`};L1.versionToNumber=gv});var Y3=t0(Yt=>{"use strict";E();x();k();R();var bv=Yt&&Yt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.getRenamedData=void 0;var j3=bv(N3()),z0=W3(),yv=(n,e,t,r)=>{let i=(0,z0.versionToNumber)(t),s=(0,z0.versionToNumber)(r),o=i<s?1:-1,a=o>0?1:0,v=e,l=Object.keys(j3.default).sort((h,p)=>o*((0,z0.versionToNumber)(h)-(0,z0.versionToNumber)(p))),c=o>0?s:i,u=o>0?i:s;for(let h of l.filter(p=>(0,z0.versionToNumber)(p)<=c&&(0,z0.versionToNumber)(p)>=u)){if(o>0&&(0,z0.versionToNumber)(h)>=c||o<0&&(0,z0.versionToNumber)(h)<=u)break;let p=j3.default[h][n];if(p)for(let g of p){let y=g[a],A=g[1-a];if(Array.isArray(v))v.includes(A)&&(v=v.map(b=>b===A?y:b));else if(v===A){v=y;break}}}return v};Yt.getRenamedData=yv});import*as i0 from"three";function q1(){return new i0.ShaderMaterial({vertexShader:Tv,fragmentShader:Mv,uniforms:i0.UniformsUtils.merge([i0.UniformsLib.fog,{u_atlas:{value:null},u_tintPalette:{value:null},u_debugMode:{value:0},u_cameraOrigin:{value:new i0.Vector3},u_cameraOriginFrac:{value:new i0.Vector3}}]),transparent:!1,depthWrite:!0,depthTest:!0,blending:i0.NoBlending,glslVersion:i0.GLSL3,fog:!0})}var Tv,Mv,Z1,c0,ra,gt=Xe(()=>{"use strict";E();x();k();R();Tv=`
|
|
14
14
|
precision highp float;
|
|
15
15
|
precision highp int;
|
|
16
16
|
|
|
@@ -175,7 +175,7 @@ void main() {
|
|
|
175
175
|
vFogDepth = -mvPosition.z;
|
|
176
176
|
#endif
|
|
177
177
|
}
|
|
178
|
-
`,
|
|
178
|
+
`,Mv=`
|
|
179
179
|
precision highp float;
|
|
180
180
|
precision highp int;
|
|
181
181
|
|
|
@@ -282,10 +282,10 @@ void main() {
|
|
|
282
282
|
applyFog();
|
|
283
283
|
writeLogDepth();
|
|
284
284
|
}
|
|
285
|
-
`;er=6,d0={LX_BITS:4,LY_BITS:4,LZ_BITS:4,FACE_BITS:3,TINT_BITS:8,AO_BITS_PER_CORNER:2,NUM_CORNERS:4,LX_SHIFT:0,LY_SHIFT:4,LZ_SHIFT:8,FACE_SHIFT:12,TINT_SHIFT:15,AO_SHIFT:23,TRANSPARENT_SHIFT:31},va={TEX_INDEX_BITS:12,DIAGONAL_FLAG_SHIFT:12,SECTION_Y_SHIFT:13,SECTION_Y_BITS:5,EMPTY_SHIFT:18,SPARE_BITS:13}});var tr,la=$e(()=>{"use strict";E();x();k();R();tr=class{constructor(e){d(this,"atlasWidth");d(this,"atlasHeight");d(this,"tileSize");d(this,"tilesPerRow");d(this,"maxTiles");d(this,"valid");this.atlasWidth=e.width,this.atlasHeight=e.height,this.tileSize=e.tileSize,this.tilesPerRow=Math.floor(this.atlasWidth/this.tileSize),this.maxTiles=this.tilesPerRow*Math.floor(this.atlasHeight/this.tileSize),this.valid=this.atlasWidth===1024&&this.atlasHeight===1024&&this.tileSize===16&&this.maxTiles<=4096}isValid(){return this.valid}getTilesPerRow(){return this.tilesPerRow}tileIndexFromPixelCoords(e,t){if(!this.valid)return-1;let r=Math.floor(e/this.tileSize),i=Math.floor(t/this.tileSize);if(r<0||r>=this.tilesPerRow||i<0)return-1;let s=i*this.tilesPerRow+r;return s>=this.maxTiles?-1:s}tileIndexFromTextureEntry(e){return!this.valid||e.su!==this.tileSize||e.sv!==this.tileSize?-1:this.tileIndexFromPixelCoords(e.u,e.v)}tileIndexFromTextureName(e,t){if(!this.valid)return-1;let r=t.textures[e];if(!r&&e.includes(":")&&(r=t.textures[e.split(":")[1]]),!r&&e.includes("/")&&(r=t.textures[e.split("/")[1]]),r||(r=t.textures[`block/${e}`]),!r){let i=e.replace(/^block\//,"");r=t.textures[i]}return r?this.tileIndexFromTextureEntry(r):-1}}});import*as u0 from"three";var rr,ca=$e(()=>{"use strict";E();x();k();R();rr=class n{constructor(){d(this,"entries",[{r:1,g:1,b:1}]);d(this,"colorToIndex",new Map);d(this,"categoryBiomeToIndex",new Map);d(this,"texture",null);d(this,"ready",!1)}packColor(e,t,r){let i=Math.round(e*255),s=Math.round(t*255),o=Math.round(r*255);return i<<16|s<<8|o}add(e,t,r,i,s){let o=this.packColor(e,t,r),v=`${i}:${s}`,a=this.categoryBiomeToIndex.get(v);if(a!==void 0)return a;let l=this.colorToIndex.get(o);if(l!==void 0)return this.categoryBiomeToIndex.set(v,l),l;let c=this.entries.length;return this.entries.push({r:e,g:t,b:r}),this.colorToIndex.set(o,c),this.categoryBiomeToIndex.set(v,c),c}getTintIndex(e,t,r,i){return e===void 0?0:e===0?t==="redstone_wire"?this.categoryBiomeToIndex.get(`redstone:${r.power}`)??this.categoryBiomeToIndex.get("redstone:0")??0:t==="birch_leaves"||t==="spruce_leaves"||t==="lily_pad"?this.categoryBiomeToIndex.get(`constant:${t}`)??this.categoryBiomeToIndex.get("constant:default")??0:t.includes("leaves")||t==="vine"?this.categoryBiomeToIndex.get(`foliage:${i}`)??this.categoryBiomeToIndex.get("foliage:plains")??0:this.categoryBiomeToIndex.get(`grass:${i}`)??this.categoryBiomeToIndex.get("grass:plains")??0:0}getEntry(e){return this.entries[e]??this.entries[0]}get size(){return this.entries.length}buildTextureData(){let e=new Float32Array(1024);for(let t=0;t<this.entries.length&&t<256;t++){let r=this.entries[t];e[t*4]=r.r,e[t*4+1]=r.g,e[t*4+2]=r.b,e[t*4+3]=1}return e}createTexture(){this.texture&&(this.texture.dispose(),this.texture=null,this.ready=!1);let e=this.buildTextureData(),t=new u0.DataTexture(e,256,1,u0.RGBAFormat,u0.FloatType);return t.minFilter=u0.NearestFilter,t.magFilter=u0.NearestFilter,t.wrapS=u0.ClampToEdgeWrapping,t.wrapT=u0.ClampToEdgeWrapping,t.needsUpdate=!0,this.texture=t,this.ready=!0,t}getTexture(){return this.texture}isReady(){return this.ready}static fromTintsData(e){let t=new n;function r(i){let s=(i>>16&255)/255,o=(i>>8&255)/255,v=(i&255)/255;return[s,o,v]}if(e.grass){let i=r(e.grass.default);for(let{keys:s,color:o}of e.grass.data??[]){let v=r(o);for(let a of s)t.add(v[0],v[1],v[2],"grass",a)}t.add(i[0],i[1],i[2],"grass","plains")}if(e.foliage){let i=r(e.foliage.default);for(let{keys:s,color:o}of e.foliage.data??[]){let v=r(o);for(let a of s)t.add(v[0],v[1],v[2],"foliage",a)}t.add(i[0],i[1],i[2],"foliage","plains")}if(e.redstone){let i=r(e.redstone.default);for(let{keys:s,color:o}of e.redstone.data??[]){let v=r(o);for(let a of s)t.add(v[0],v[1],v[2],"redstone",a)}t.add(i[0],i[1],i[2],"redstone","0")}if(e.constant){let i=r(e.constant.default);for(let{keys:s,color:o}of e.constant.data??[]){let v=r(o);for(let a of s)t.add(v[0],v[1],v[2],"constant",a)}t.add(i[0],i[1],i[2],"constant","default")}return t}}});import da from"mc-assets/dist/blocksAtlases.json";function Hv(){let n=globalThis.loadedData?.tints;return n||(ua||(ua=!0),null)}function nr(){let n=Hv();if(!n)return null;if(ir||(ir=rr.fromTintsData(n),ir.createTexture()),!Ki){let e=da.latest??da;Ki=new tr({width:e.width,height:e.height,tileSize:e.tileSize??16,suSv:e.suSv??16,textures:e.textures??{}})}return{tintPalette:ir,textureIndexMapping:Ki}}function fa(){return 1<<va.EMPTY_SHIFT>>>0}var Xt,ir,Ki,ua,$t=$e(()=>{"use strict";E();x();k();R();bt();la();ca();Xt=4,ir=null,Ki=null,ua=!1});import*as Be from"three";function Ov(n,e){let t=new Be.InstancedBufferGeometry,r=new Float32Array(er*3);t.setAttribute("position",new Be.BufferAttribute(r,3));let i=new Uint32Array(e),s=new Uint32Array(e),o=new Uint32Array(e),v=new Uint32Array(e),a=Xt;for(let l=0;l<e;l++)i[l]=n[l*a],s[l]=n[l*a+1],o[l]=n[l*a+2],v[l]=n[l*a+3];return t.setAttribute("a_w0",new Be.InstancedBufferAttribute(i,1)),t.setAttribute("a_w1",new Be.InstancedBufferAttribute(s,1)),t.setAttribute("a_w2",new Be.InstancedBufferAttribute(o,1)),t.setAttribute("a_w3",new Be.InstancedBufferAttribute(v,1)),t.instanceCount=e,t.boundingBox=new Be.Box3(new Be.Vector3(-8,-8,-8),new Be.Vector3(8,8,8)),t.boundingSphere=new Be.Sphere(new Be.Vector3(0,0,0),Math.sqrt(3*8**2)),t}function Dv(n){n.raycast=(e,t)=>{let{geometry:r}=n;if(!r.boundingBox||(ha.copy(r.boundingBox).applyMatrix4(n.matrixWorld),!e.ray.intersectBox(ha,Ji)))return;let i=e.ray.origin.distanceTo(Ji);t.push({distance:i,point:Ji.clone(),object:n})}}function sr(n,e){let t=Ov(n.words,n.count),r=new Be.Mesh(t,e);return r.name="shaderMesh",r.matrixAutoUpdate=!1,r.frustumCulled=!1,Dv(r),r}function Zi(n){n.geometry.dispose()}var ha,Ji,qi=$e(()=>{"use strict";E();x();k();R();bt();$t();ha=new Be.Box3,Ji=new Be.Vector3});var _a={};$5(_a,{applyWorldGeometryExport:()=>Lv,createMeshesFromExport:()=>ba,downloadWorldGeometry:()=>Xi,exportWorldGeometry:()=>pa,loadTextureFromDataUrl:()=>ya,loadWorldGeometryFromUrl:()=>Fv});import*as Pe from"three";function pa(n,e,t,r=!1){let i=[];for(let[o,v]of Object.entries(n.sectionObjects)){let a=v.children.find(A=>A.name==="mesh");if(!a?.geometry)continue;let{geometry:l}=a,c=l.getAttribute("position"),u=l.getAttribute("normal"),f=l.getAttribute("color"),p=l.getAttribute("uv"),g=l.index;if(!c||!g)continue;let y=n.sceneOrigin.getWorldPosition(a);i.push({key:o,position:{x:y?.x??n.sceneOrigin.toWorldX(a.position.x),y:y?.y??n.sceneOrigin.toWorldY(a.position.y),z:y?.z??n.sceneOrigin.toWorldZ(a.position.z)},geometry:{positions:[...c.array],normals:u?[...u.array]:[],colors:f?[...f.array]:[],uvs:p?[...p.array]:[],indices:[...g.array]}})}let s={version:n.version??"unknown",exportedAt:new Date().toISOString(),camera:{position:e,rotation:t},sections:i};if(r&&n.material.map){let o=document.createElement("canvas"),v=n.material.map,{image:a}=v;a&&(o.width=a.width,o.height=a.height,o.getContext("2d").drawImage(a,0,0),s.textureAtlasDataUrl=o.toDataURL("image/png"))}return s}function Xi(n,e,t,r="world-geometry.json",i=!1){let s=pa(n,e,t,i),o=JSON.stringify(s),v=new Blob([o],{type:"application/json"}),a=URL.createObjectURL(v),l=document.createElement("a");l.href=a,l.download=r,l.click(),URL.revokeObjectURL(a)}async function Fv(n){let e=await fetch(n);if(!e.ok)throw new Error(`Failed to fetch world geometry: ${e.statusText}`);return e.json()}function ga(n){let e=n.map??n.map;if(!e)return null;let t=$1();t.uniforms.u_atlas.value=e;let r=nr();if(!r)return null;let{tintPalette:i}=r;return i.isReady()||i.createTexture(),t.uniforms.u_tintPalette.value=i.getTexture(),t}function ba(n,e,t){let r=[],i=t??ga(e);for(let s of n.sections){let o=new Pe.Group;if(o.name="chunk",s.geometry.positions.length>0&&s.geometry.indices.length>0){let l=new Pe.BufferGeometry;l.setAttribute("position",new Pe.Float32BufferAttribute(s.geometry.positions,3)),s.geometry.normals.length&&l.setAttribute("normal",new Pe.Float32BufferAttribute(s.geometry.normals,3)),s.geometry.colors.length&&l.setAttribute("color",new Pe.Float32BufferAttribute(s.geometry.colors,3)),s.geometry.uvs.length&&l.setAttribute("uv",new Pe.Float32BufferAttribute(s.geometry.uvs,2));let u=Math.max(...s.geometry.indices)>65535?Uint32Array:Uint16Array;l.setIndex(new Pe.BufferAttribute(new u(s.geometry.indices),1));let f=new Pe.Mesh(l,e);f.position.set(s.position.x,s.position.y,s.position.z),f.name="mesh",o.add(f)}let a=s.shaderCubes;if(a&&a.count>0&&i){let l=sr(a,i);l.position.set(s.position.x,s.position.y,s.position.z),o.add(l)}o.children.length>0&&r.push(o)}return r}async function ya(n){return new Promise((e,t)=>{let r=new Image;r.onload=()=>{let i=new Pe.Texture(r);i.magFilter=Pe.NearestFilter,i.minFilter=Pe.NearestFilter,i.needsUpdate=!0,i.flipY=!1,e(i)},r.onerror=t,r.src=n})}async function Lv(n,e){let{scene:t,renderUpdateEmitter:r,material:i}=n,s=t.getObjectByName(ma);s&&(t.remove(s),zv(s));let o=!!e.textureAtlasDataUrl,v;if(o&&e.textureAtlasDataUrl){let u=await ya(e.textureAtlasDataUrl);v=new Pe.MeshLambertMaterial({map:u,vertexColors:!0,transparent:!0,alphaTest:.1}),v.name="geometry-export-material"}else v=i;let a=e.sections.some(u=>(u.shaderCubes?.count??0)>0)?ga(v):null,l=ba(e,v,a),c=new Pe.Group;c.name=ma,o&&(c.userData.geometryExportMaterial=v);for(let u of l)c.add(u);return t.add(c),r.emit("update"),l.length}var ma,zv,$i=$e(()=>{"use strict";E();x();k();R();$t();bt();qi();ma="geometry-export-root";zv=n=>{n.traverse(t=>{t.isMesh&&t.geometry?.dispose()});let e=n.userData?.geometryExportMaterial;e&&(e.map?.dispose?.(),e.dispose?.())}});E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();import{proxy as W2}from"valtio";E();x();k();R();E();x();k();R();var Ar=()=>({longRenderTime:!1,constantLongRenderTime:!1,tooManyEntities:!1,tooManyTextures:!1,unknownReason:!1});E();x();k();R();var n1=30;var Er=45,xr=100;E();x();k();R();var d5=class{constructor(e){this.factors=e;d(this,"renderTimeHistory",[])}onFrame(e){this.pushRenderTime(e.totalMs),this.recompute(e)}pushRenderTime(e){this.renderTimeHistory.push(e),this.renderTimeHistory.length>24&&this.renderTimeHistory.shift()}recompute(e){let t=e.fps>0&&e.fps<=45,r=Math.max(0,e.totalMs-e.entitiesMs),i=e.totalMs>=30,s=this.renderTimeHistory.length,o=this.renderTimeHistory.filter(f=>f>=30).length,v=s>=8&&o/s>=.65,a=e.loadedTextureCount>=100,l=t&&e.entitiesMs>=8&&r<=20,u=t&&!(i||v||l||a);this.factors.longRenderTime=i,this.factors.constantLongRenderTime=v,this.factors.tooManyEntities=l,this.factors.tooManyTextures=a,this.factors.unknownReason=u}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}};E();x();k();R();var f6=[{key:"longRenderTime",code:"LR"},{key:"constantLongRenderTime",code:"CLR"},{key:"tooManyEntities",code:"ENT"},{key:"tooManyTextures",code:"TEX"},{key:"unknownReason",code:"UNK"}];function Rr(n){let e=f6.filter(({key:t})=>n[t]).map(({code:t})=>t);return e.length>0?e.join("+"):""}var u5={paused:!1,showChunkBorders:!1,enableDebugOverlay:!1,debugWasmPerf:!1,debugModelVariant:void 0,futuristicReveal:!1,wasmMesher:!0,shaderCubeBlocks:!1,shaderCubeDebugMode: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:{}},N2={fpsLimit:void 0,sceneBackground:"lightblue",timeoutRendering:!1},xl=(n={})=>W2({...u5,...n}),Z0=()=>({reactive:W2({world:{chunksLoaded:{},heightmaps:{},allChunksLoaded:!1,mesherWork:!1,instabilityFactors:Ar(),intersectMedia:null},renderer:"...",preventEscapeMenu:!1}),nonReactive:{fps:0,worstRenderTime:0,avgRenderTime:0,world:{chunksLoadedCount:0,chunksTotalNumber:0,chunksFullInfo:"-"},renderer:{timeline:{live:[],frozen:[],lastSecond:[]}}}});E();x();k();R();import{proxy as h6}from"valtio";var kr=()=>h6({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,fovMultiplier:1,cameraSpectatingEntity:void 0,team:void 0}),j2=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"}}),Y2=()=>({reactive:kr()});E();x();k();R();import{Vec3 as T6}from"vec3";import{proxy as vs}from"valtio";E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();var s1={},Q2=!1;function m6(){if(Q2)return s1;Q2=!0;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(M,P,B){return Function.prototype.apply.call(M,P,B)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:t=function(M){return Object.getOwnPropertyNames(M)};function r(C){}var i=Number.isNaN||function(M){return M!==M};function s(){s.init.call(this)}s1=s,s1.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function v(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");o=C}}),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(M){if(typeof M!="number"||M<0||i(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function a(C){return C._maxListeners===void 0?s.defaultMaxListeners:C._maxListeners}s.prototype.getMaxListeners=function(){return a(this)},s.prototype.emit=function(M){for(var P=[],B=1;B<arguments.length;B++)P.push(arguments[B]);var H=M==="error",G=this._events;if(G!==void 0)H=H&&G.error===void 0;else if(!H)return!1;if(H){var O;if(P.length>0&&(O=P[0]),O instanceof Error)throw O;var j=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw j.context=O,j}var J=G[M];if(J===void 0)return!1;if(typeof J=="function")e(J,this,P);else for(var Z=J.length,X=g(J,Z),B=0;B<Z;++B)e(X[B],this,P);return!0};function l(C,M,P,B){var H,G,O;if(v(P),G=C._events,G===void 0?(G=C._events=Object.create(null),C._eventsCount=0):(G.newListener!==void 0&&(C.emit("newListener",M,P.listener?P.listener:P),G=C._events),O=G[M]),O===void 0)O=G[M]=P,++C._eventsCount;else if(typeof O=="function"?O=G[M]=B?[P,O]:[O,P]:B?O.unshift(P):O.push(P),H=a(C),H>0&&O.length>H&&!O.warned){O.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=C,j.type=M,j.count=O.length}return C}s.prototype.addListener=function(M,P){return l(this,M,P,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(M,P){return l(this,M,P,!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 u(C,M,P){var B={fired:!1,wrapFn:void 0,target:C,type:M,listener:P},H=c.bind(B);return H.listener=P,B.wrapFn=H,H}s.prototype.once=function(M,P){return v(P),this.on(M,u(this,M,P)),this},s.prototype.prependOnceListener=function(M,P){return v(P),this.prependListener(M,u(this,M,P)),this},s.prototype.removeListener=function(M,P){var B,H,G,O,j;if(v(P),H=this._events,H===void 0)return this;if(B=H[M],B===void 0)return this;if(B===P||B.listener===P)--this._eventsCount===0?this._events=Object.create(null):(delete H[M],H.removeListener&&this.emit("removeListener",M,B.listener||P));else if(typeof B!="function"){for(G=-1,O=B.length-1;O>=0;O--)if(B[O]===P||B[O].listener===P){j=B[O].listener,G=O;break}if(G<0)return this;G===0?B.shift():y(B,G),B.length===1&&(H[M]=B[0]),H.removeListener!==void 0&&this.emit("removeListener",M,j||P)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(M){var P,B,H;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[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[M]),this;if(arguments.length===0){var G=Object.keys(B),O;for(H=0;H<G.length;++H)O=G[H],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(P=B[M],typeof P=="function")this.removeListener(M,P);else if(P!==void 0)for(H=P.length-1;H>=0;H--)this.removeListener(M,P[H]);return this};function f(C,M,P){var B=C._events;if(B===void 0)return[];var H=B[M];return H===void 0?[]:typeof H=="function"?P?[H.listener||H]:[H]:P?A(H):g(H,H.length)}s.prototype.listeners=function(M){return f(this,M,!0)},s.prototype.rawListeners=function(M){return f(this,M,!1)},s.listenerCount=function(C,M){return typeof C.listenerCount=="function"?C.listenerCount(M):p.call(C,M)},s.prototype.listenerCount=p;function p(C){var M=this._events;if(M!==void 0){var P=M[C];if(typeof P=="function")return 1;if(P!==void 0)return P.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function g(C,M){for(var P=new Array(M),B=0;B<M;++B)P[B]=C[B];return P}function y(C,M){for(;M+1<C.length;M++)C[M]=C[M+1];C.pop()}function A(C){for(var M=new Array(C.length),P=0;P<M.length;++P)M[P]=C[P].listener||C[P];return M}function b(C,M){return new Promise(function(P,B){function H(O){C.removeListener(M,G),B(O)}function G(){typeof C.removeListener=="function"&&C.removeListener("error",H),P([].slice.call(arguments))}S(C,M,G,{once:!0}),M!=="error"&&_(C,H,{once:!0})})}function _(C,M,P){typeof C.on=="function"&&S(C,"error",M,P)}function S(C,M,P,B){if(typeof C.on=="function")B.once?C.once(M,P):C.on(M,P);else if(typeof C.addEventListener=="function")C.addEventListener(M,function H(G){B.once&&C.removeEventListener(M,H),P(G)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return s1}var o1=m6();o1.once;o1.once=function(n,e){return new Promise((t,r)=>{function i(...o){s!==void 0&&n.removeListener("error",s),t(o)}let s;e!=="error"&&(s=o=>{n.removeListener(name,i),r(o)},n.once("error",s)),n.once(e,i)})};o1.on=function(n,e){let t=[],r=[],i=null,s=!1,o={async next(){let l=t.shift();if(l)return createIterResult(l,!1);if(i){let c=Promise.reject(i);return i=null,c}return s?createIterResult(void 0,!0):new Promise((c,u)=>r.push({resolve:c,reject:u}))},async return(){n.removeListener(e,v),n.removeListener("error",a),s=!0;for(let l of r)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){i=l,n.removeListener(e,v),n.removeListener("error",a)},[Symbol.asyncIterator](){return this}};return n.on(e,v),n.on("error",a),o;function v(...l){let c=r.shift();c?c.resolve(createIterResult(l,!1)):t.push(l)}function a(l){s=!0;let c=r.shift();c?c.reject(l):i=l,o.return()}};var{EventEmitter:q0,defaultMaxListeners:Ul,init:Gl,listenerCount:Vl,on:Wl,once:Nl}=o1;import{Vec3 as X0}from"vec3";E();x();k();R();function f5(n){let e=n*2+1;if(e<=0)return[];let t=[],r=0,i=0,s=0,o=-1;for(let v=0;v<e*e;v++){if(Math.abs(r)<=e/2&&Math.abs(i)<=e/2&&t.push([r,i]),r===i||r<0&&r===-i||r>0&&r===1-i){let a=s;s=-o,o=a}r+=s,i+=o}return t}E();x();k();R();function Tr(n,e=0){if(e>16)return;if(n==null)return n;let t=typeof n;if(t==="function"||t==="symbol")return;if(t==="bigint")return n.toString();if(t!=="object"||n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n)){let s=n;return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}if(n instanceof Date)return n.toISOString();if(Array.isArray(n))return n.map(s=>Tr(s,e+1)).filter(s=>s!==void 0);let r=n;if(typeof r.x=="number"&&typeof r.y=="number"&&typeof r.z=="number"&&!("w"in r))return{x:r.x,y:r.y,z:r.z};let i={};for(let s of Object.keys(r)){if(s==="_client"||s==="_events"||s==="_eventsCount")continue;let o=Tr(r[s],e+1);o!==void 0&&(i[s]=o)}return i}function a1(n){return n.map(e=>Tr(e))}var St=n=>[Math.floor(n.x/16),Math.floor(n.z/16)],p6=n=>[Math.floor(n.x/16),Math.floor(n.y/16),Math.floor(n.z/16)],K2=async(n,e,t,r=1)=>{for(let i=0;i<n.length;i+=r)e&&await new Promise(s=>setTimeout(s,e)),await t(n[i],i)},Mt=new WeakMap,h5=class h5 extends q0{static restoreTransferred(e,t){let r=new h5;if(!t)return r;let i=Mt.get(t);if(i)i.activeWorldView=r;else{let s=({data:o})=>{let a=Mt.get(t)?.activeWorldView;!a||o?.class!==h5.restorerName||o.type==="event"&&a.emit(o.eventName,...o.args)};t.addEventListener("message",s),i={activeWorldView:r,handler:s},Mt.set(t,i)}return r}static clearWorkerBridgeForTest(e){let t=Mt.get(e);t&&(e.removeEventListener("message",t.handler),Mt.delete(e))}static getWorkerBridgeListenerCountForTest(e){return Mt.has(e)?1:0}};d(h5,"restorerName","WorldViewWorker");var $0=h5,et=class extends q0{constructor(t,r,i=new X0(0,0,0)){super();this.world=t;this.viewDistance=r;d(this,"spiralNumber",0);d(this,"gotPanicLastTime",!1);d(this,"panicChunksReload",()=>{});d(this,"loadedChunks",{});d(this,"inLoading",!1);d(this,"chunkReceiveTimes",[]);d(this,"lastChunkReceiveTime",0);d(this,"lastChunkReceiveTimeAvg",0);d(this,"panicTimeout");d(this,"lastPos");d(this,"eventListeners",{});d(this,"debugChunksInfo",{});d(this,"waitingSpiralChunksLoad",{});d(this,"addWaitTime",1);d(this,"keepChunksDistance",0);d(this,"isPlayground",!1);d(this,"allowPositionUpdate",!0);d(this,"lastBiomeId",null);d(this,"lastPosCheck",null);this.lastPos=new X0(0,0,0).update(i)}prepareForTransfer(t){if(t){let r=this.emit.bind(this);this.emit=(i,...s)=>{r(i,...s),t.postMessage({class:$0.restorerName,type:"event",eventName:i,args:a1(s)})}}return{__restorer:$0.restorerName}}setBlockStateId(t,r){let i=this.world.setBlockStateId(t,r);if(i&&typeof i.then=="function")throw new Error("setBlockStateId returned promise (not supported)");this.emit("blockUpdate",{pos:t,stateId:r})}updateViewDistance(t){this.viewDistance=t,this.emit("renderDistance",t)}async init(t,r){this.updateViewDistance(this.viewDistance),this.emit("chunkPosUpdate",{pos:t}),r?.time?.timeOfDay!==void 0&&this.emit("time",r.time.timeOfDay),r?.entity&&this.emit("playerEntity",r.entity),this.emitterGotConnected(r);let[i,s]=St(t),o=f5(this.viewDistance).map(([v,a])=>new X0((i+v)*16,0,(s+a)*16));this.lastPos.update(t),await this._loadChunks(o,t)}chunkProgress(){if(this.panicTimeout&&clearTimeout(this.panicTimeout),this.chunkReceiveTimes.length>=5){let t=this.chunkReceiveTimes.reduce((i,s)=>i+s,0)/this.chunkReceiveTimes.length;this.lastChunkReceiveTimeAvg=t;let r=t*2+1e3;this.panicTimeout&&clearTimeout(this.panicTimeout),this.panicTimeout=setTimeout(()=>{!this.gotPanicLastTime&&this.inLoading&&(this.gotPanicLastTime=!0,this.panicChunksReload())},r)}}async _loadChunks(t,r){this.spiralNumber++;let{spiralNumber:i}=this;for(let o of Object.keys(this.waitingSpiralChunksLoad))this.waitingSpiralChunksLoad[o](!1),delete this.waitingSpiralChunksLoad[o];let s=!0;this.inLoading=!0,await K2(t,this.addWaitTime,async o=>{!s||this.loadedChunks[`${o.x},${o.z}`]||(this.world.getColumnAt(o)||(s=await new Promise(v=>{this.waitingSpiralChunksLoad[`${o.x},${o.z}`]=v})),s&&(await this.loadChunk(o,void 0,`spiral ${i} from ${r.x},${r.z}`),this.chunkProgress()))}),i===this.spiralNumber&&(this.panicTimeout&&clearTimeout(this.panicTimeout),this.inLoading=!1,this.gotPanicLastTime=!1,this.chunkReceiveTimes=[],this.lastChunkReceiveTime=0)}async loadChunk(t,r=!1,i="spiral"){var l,c;let[s,o]=St(this.lastPos),v=Math.abs(s-Math.floor(t.x/16)),a=Math.abs(o-Math.floor(t.z/16));if(v<=this.viewDistance&&a<=this.viewDistance){let u=await this.world.getColumnAt(t.y!==void 0?t:new X0(t.x,0,t.z));if(u){let f=u.toJson(),p={minY:u.minY??0,worldHeight:u.worldHeight??256};this.emit("loadChunk",{x:t.x,z:t.z,chunk:f,blockEntities:u.blockEntities,worldConfig:p,isLightUpdate:r}),this.loadedChunks[`${t.x},${t.z}`]=!0,(l=this.debugChunksInfo)[c=`${t.x},${t.z}`]??(l[c]={loads:[]}),this.debugChunksInfo[`${t.x},${t.z}`].loads.push({dataLength:f.length,reason:i,time:Date.now()})}else this.isPlayground&&this.emit("markAsLoaded",{x:t.x,z:t.z})}}unloadAllChunks(){for(let t of Object.keys(this.loadedChunks)){let[r,i]=t.split(",").map(Number);this.unloadChunk({x:r,z:i})}}unloadChunk(t){this.emit("unloadChunk",{x:t.x,z:t.z}),delete this.loadedChunks[`${t.x},${t.z}`],delete this.debugChunksInfo[`${t.x},${t.z}`]}emitterGotConnected(t){typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope||!t||this.emit("blockEntities",new Proxy({},{get(i,s,o){if(typeof s!="string")return;let[v,a,l]=s.split(",").map(Number);return t.world.getBlock(new X0(v,a,l))?.entity}}))}updateBiome(t){try{if(!this.world.getBiome)return;let r=this.world.getBiome(t);r!==this.lastBiomeId&&(this.lastBiomeId=r,this.emit("biomeReset"))}catch{}}async updatePosition(t,r=!1){if(!this.allowPositionUpdate)return;let i=t.floored();if(!r&&this.lastPosCheck&&this.lastPosCheck.equals(i))return;this.lastPosCheck=i,this.updateBiome(t);let[s,o]=St(this.lastPos),[v,a]=St(t);if(s!==v||o!==a||r){this.emit("chunkPosUpdate",{pos:t});let l=[],c=r?this.viewDistance:this.viewDistance+this.keepChunksDistance;for(let f of Object.keys(this.loadedChunks)){let[p,g]=f.split(",").map(Number),y=new X0(p,0,g),[A,b]=St(y),_=Math.abs(v-A),S=Math.abs(a-b);(_>c||S>c)&&l.push(y)}for(let f of l)this.unloadChunk(f);let u=f5(this.viewDistance).map(([f,p])=>{let g=new X0((v+f)*16,0,(a+p)*16);if(!this.loadedChunks[`${g.x},${g.z}`])return g}).filter(f=>!!f);this.lastPos.update(t),this._loadChunks(u,t)}else this.emit("chunkPosUpdate",{pos:t}),this.lastPos.update(t)}};E();x();k();R();E();x();k();R();import ns from"minecraft-data";import g6 from"mc-assets/dist/blocksAtlases.json";import b6 from"mc-assets/dist/itemsAtlases.json";import Or from"mc-assets/dist/itemDefinitions.json";import y6 from"mc-assets/dist/blocksAtlasLatest.png";import _6 from"mc-assets/dist/blocksAtlasLegacy.png";import w6 from"mc-assets/dist/itemsAtlasLatest.png";import A6 from"mc-assets/dist/itemsAtlasLegacy.png";import E6 from"mc-assets/dist/textureReplacements/christmas";import{AtlasParser as tt}from"mc-assets/dist/atlasParser";import ts from"mc-assets/dist/worldBlockProvider";E();x();k();R();var Pr=l5(J2(),1);import*as c1 from"three";E();x();k();R();E();x();k();R();var v1=class{constructor(e,t,r){this.name=e,this.fg=t,this.bg=r,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(e,t,r,i,s=0){let o=1/0,v=0;this.context&&(o=Math.min(o,e),v=Math.max(r,e),i=Math.max(i,t),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(e.toFixed(s)+" "+this.name+" ("+o.toFixed(s)+"-"+parseFloat(v.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-t/i)*this.GRAPH_HEIGHT))}};var Z2=class l1{constructor({logsPerSecond:e=20,samplesLog:t=100,samplesGraph:r=10,precision:i=2,minimal:s=!1,horizontal:o=!0,mode:v=0}={}){this.mode=v,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 l1.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new l1.Panel("CPU","#0f0","#020"),1),this.gpuPanel=null,this.samplesLog=t,this.samplesGraph=r,this.precision=i,this.logsPerSecond=e,this.minimal?(this.container.addEventListener("click",a=>{a.preventDefault(),this.showPanel(++this.mode%this.container.children.length)},!1),this.mode=v,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(e,t){e.canvas.style.position="absolute",this.minimal?e.canvas.style.display="none":(e.canvas.style.display="block",this.horizontal?(e.canvas.style.top="0px",e.canvas.style.left=t*e.WIDTH/e.PR+"px"):(e.canvas.style.left="0px",e.canvas.style.top=t*e.HEIGHT/e.PR+"px"))}addPanel(e,t){return e.canvas&&(this.container.appendChild(e.canvas),this.resizePanel(e,t)),e}showPanel(e){for(let t=0;t<this.container.children.length;t++){let r=this.container.children[t];r.style.display=t===e?"block":"none"}this.mode=e}init(e){if(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext("webgl2"),!this.gl)return}else return;this.ext=this.gl.getExtension("EXT_disjoint_timer_query_webgl2"),this.ext&&(this.gpuPanel=this.addPanel(new l1.Panel("GPU","#ff0","#220"),2))}}begin(){if(this.beginProfiling("cpu-started"),!(!this.gl||!this.ext)){if(this.query){let e=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT_AVAILABLE);if(this.disjoint=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT),e&&!this.disjoint){this.ns=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT);let t=this.ns*1e-6;(e||this.disjoint)&&(this.gl.deleteQuery(this.query),this.query=null),e&&this.addToAverage(t,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 e=(performance||Date).now();if(e>=this.prevCpuTime+1e3/this.logsPerSecond&&(this.updatePanel(this.msPanel,this.averageCpu),this.updatePanel(this.gpuPanel,this.averageGpu),this.prevCpuTime=e),e>=this.prevTime+1e3){let t=this.frames*1e3/(e-this.prevTime);this.fpsPanel.update(t,t,100,100,0),this.prevTime=e,this.frames=0}return e}addToAverage(e,t){t.logs.push(e),t.logs.length>this.samplesLog&&t.logs.shift(),t.graph.push(e),t.graph.length>this.samplesGraph&&t.graph.shift()}beginProfiling(e){window.performance&&window.performance.mark(e)}endProfiling(e,t,r,i){if(window.performance&&t){window.performance.mark(t);let s=performance.measure(r,e,t);this.addToAverage(s.duration,i)}}updatePanel(e,t){if(t.logs.length>0){let r=0,i=.01;for(let v=0;v<t.logs.length;v++)r+=t.logs[v],t.logs[v]>i&&(i=t.logs[v]);let s=0,o=.01;for(let v=0;v<t.graph.length;v++)s+=t.graph[v],t.graph[v]>o&&(o=t.graph[v]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),s/Math.min(t.graph.length,this.samplesGraph),i,o,this.precision)}}};Z2.Panel=v1;var q2=Z2;E();x();k();R();var He=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 e=1.70158;return n===1?1:n*n*((e+1)*n-e)},Out:function(n){var e=1.70158;return n===0?0:--n*n*((e+1)*n+e)+1},InOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)}}),Bounce:Object.freeze({In:function(n){return 1-He.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?He.Bounce.In(n*2)*.5:He.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(e){return Math.pow(e,n)},Out:function(e){return 1-Math.pow(1-e,n)},InOut:function(e){return e<.5?Math.pow(e*2,n)/2:(1-Math.pow(2-e*2,n))/2+.5}}}}),m5=function(){return performance.now()},Bt=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},n.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},n.prototype.update=function(e,t){e===void 0&&(e=m5()),t===void 0&&(t=!1);var r=Object.keys(this._tweens);if(r.length===0)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var s=this._tweens[r[i]],o=!t;s&&s.update(e,o)===!1&&!t&&delete this._tweens[r[i]]}r=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),Ct={Linear:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=Ct.Utils.Linear;return e<0?s(n[0],n[1],r):e>1?s(n[t],n[t-1],t-r):s(n[i],n[i+1>t?t:i+1],r-i)},Bezier:function(n,e){for(var t=0,r=n.length-1,i=Math.pow,s=Ct.Utils.Bernstein,o=0;o<=r;o++)t+=i(1-e,r-o)*i(e,o)*n[o]*s(r,o);return t},CatmullRom:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=Ct.Utils.CatmullRom;return n[0]===n[t]?(e<0&&(i=Math.floor(r=t*(1+e))),s(n[(i-1+t)%t],n[i],n[(i+1)%t],n[(i+2)%t],r-i)):e<0?n[0]-(s(n[0],n[0],n[1],n[1],-r)-n[0]):e>1?n[t]-(s(n[t],n[t],n[t-1],n[t-1],r-t)-n[t]):s(n[i?i-1:0],n[i],n[t<i+1?t:i+1],n[t<i+2?t:i+2],r-i)},Utils:{Linear:function(n,e,t){return(e-n)*t+n},Bernstein:function(n,e){var t=Ct.Utils.Factorial;return t(n)/t(e)/t(n-e)},Factorial:function(){var n=[1];return function(e){var t=1;if(n[e])return n[e];for(var r=e;r>1;r--)t*=r;return n[e]=t,t}}(),CatmullRom:function(n,e,t,r,i){var s=(t-n)*.5,o=(r-e)*.5,v=i*i,a=i*v;return(2*e-2*t+s+o)*a+(-3*e+3*t-2*s-o)*v+s*i+e}}},X2=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),Cr=new Bt,De=function(){function n(e,t){t===void 0&&(t=Cr),this._object=e,this._group=t,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=He.Linear.None,this._interpolationFunction=Ct.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=X2.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(e,t){if(t===void 0&&(t=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=e,this._propertiesAreSetUp=!1,this._duration=t,this},n.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e,this},n.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},n.prototype.start=function(e,t){if(e===void 0&&(e=m5()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var s in this._valuesEnd)i[s]=this._valuesEnd[s];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},n.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},n.prototype._setupProperties=function(e,t,r,i,s){for(var o in r){var v=e[o],a=Array.isArray(v),l=a?"array":typeof v,c=!a&&Array.isArray(r[o]);if(!(l==="undefined"||l==="function")){if(c){var u=r[o];if(u.length===0)continue;for(var f=[v],p=0,g=u.length;p<g;p+=1){var y=this._handleRelativeValue(v,u[p]);if(isNaN(y)){c=!1;break}f.push(y)}c&&(r[o]=f)}if((l==="object"||a)&&v&&!c){t[o]=a?[]:{};var A=v;for(var b in A)t[o][b]=A[b];i[o]=a?[]:{};var u=r[o];if(!this._isDynamic){var _={};for(var b in u)_[b]=u[b];r[o]=u=_}this._setupProperties(A,t[o],u,i[o],s)}else(typeof t[o]>"u"||s)&&(t[o]=v),a||(t[o]*=1),c?i[o]=r[o].slice().reverse():i[o]=t[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(e){return e===void 0&&(e=m5()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},n.prototype.resume=function(e){return e===void 0&&(e=m5()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},n.prototype.group=function(e){return e===void 0&&(e=Cr),this._group=e,this},n.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},n.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},n.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},n.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},n.prototype.easing=function(e){return e===void 0&&(e=He.Linear.None),this._easingFunction=e,this},n.prototype.interpolation=function(e){return e===void 0&&(e=Ct.Linear),this._interpolationFunction=e,this},n.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},n.prototype.onStart=function(e){return this._onStartCallback=e,this},n.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},n.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},n.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},n.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},n.prototype.onStop=function(e){return this._onStopCallback=e,this},n.prototype.update=function(e,t){if(e===void 0&&(e=m5()),t===void 0&&(t=!0),this._isPaused)return!0;var r,i,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>s)return!1;t&&this.start(e,!0)}if(this._goToEnd=!1,e<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),i=(e-this._startTime)/this._duration,i=this._duration===0||i>1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,a=this._chainedTweens.length;v<a;v++)this._chainedTweens[v].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(e,t,r,i){for(var s in r)if(t[s]!==void 0){var o=t[s]||0,v=r[s],a=Array.isArray(e[s]),l=Array.isArray(v),c=!a&&l;c?e[s]=this._interpolationFunction(v,i):typeof v=="object"&&v?this._updateProperties(e[s],o,v,i):(v=this._handleRelativeValue(o,v),typeof v=="number"&&(e[s]=o+(v-o)*i))}},n.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},n.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},n}();var zc=X2.nextId,b0=Cr,Lc=b0.getAll.bind(b0),Uc=b0.removeAll.bind(b0),Gc=b0.add.bind(b0),Vc=b0.remove.bind(b0),$2=b0.update.bind(b0);E();x();k();R();function Br(n){if(n==="high-performance")return"high-performance";if(n==="low-power")return"low-power"}var le=typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope,Ir=class{constructor(e,t=0){this.canvas=e;d(this,"stats");d(this,"stats2");d(this,"statsGl");d(this,"total",0);d(this,"denseMode");this.stats=new Pr.default,this.stats2=new Pr.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(t)}addStat(e,t=80){e.style.position="absolute",this.denseMode&&(e.style.height="12px"),e.style.overflow="hidden",e.style.left="",e.style.top="0",e.style.right=`${this.total}px`,e.style.width="80px",e.style.zIndex="1",e.style.opacity="0.8";let r=document.getElementById("corner-indicator-stats"),i=r??document.body;r&&(e.style.position="relative"),i.appendChild(e),this.total+=t}initStats(){let e=this.stats2.dom.children.length===3;this.addStat(this.stats.dom),e&&this.addStat(this.stats2.dom),this.statsGl.init(this.canvas),this.statsGl.container.style.display="flex",this.statsGl.container.style.justifyContent="flex-end";let t=0;for(let r of this.statsGl.container.children){let i=r;t++===0&&(i.style.display="none"),i.style.position=""}}setVisibility(e){e>0?(this.stats.dom.style.display="block",this.stats2.dom.style.display=e>=2?"block":"none",this.statsGl.container.style.display=e>=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()}},p5=class{constructor(e,t,r){this.initOptions=e;this.externalCanvas=t;d(this,"canvas");d(this,"renderer");d(this,"animationFrameId");d(this,"timeoutId");d(this,"lastRenderTime",0);d(this,"previousCanvasWidth",0);d(this,"previousCanvasHeight",0);d(this,"currentWidth",0);d(this,"currentHeight",0);d(this,"pendingResize",!1);d(this,"renderedFps",0);d(this,"fpsInterval");d(this,"stats");d(this,"paused",!1);d(this,"disconnected",!1);d(this,"preRender",()=>{});d(this,"render",e=>{});d(this,"postRender",()=>{});d(this,"sizeChanged",()=>{});d(this,"droppedFpsPercentage",0);d(this,"config");d(this,"onRender",[]);d(this,"inWorldRenderingConfig");d(this,"nonReactiveState");this.config=e.config,t?this.canvas=t:this.addToPage();try{let s=e.getRendererOptions?.()?.gpuPreference??"default";this.renderer=new c1.WebGLRenderer({canvas:this.canvas,preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0,powerPreference:Br(s)})}catch(s){throw e.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=c1.LinearSRGBColorSpace,t||(this.updatePixelRatio(),this.setupResizeListener()),this.sizeUpdated(),this.previousCanvasWidth=this.canvas.width,this.previousCanvasHeight=this.canvas.height;let i="WebGL2RenderingContext"in globalThis;!t&&i&&!le&&(this.stats=new Ir(this.canvas,this.config.statsVisible)),this.setupFpsTracking(),this.startRenderLoop()}setupResizeListener(){if(typeof window>"u")return;let e,t=()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.pendingResize=!0},16)};window.addEventListener("resize",t,{passive:!0})}updatePixelRatio(){if(typeof window>"u")return;let e=window.devicePixelRatio||1;this.renderer.capabilities.isWebGL2||(e=1),this.renderer.setPixelRatio(e)}sizeUpdated(){this.renderer.setSize(this.currentWidth,this.currentHeight,!1)}addToPage(){this.canvas=es(),this.updateCanvasSize()}updateSizeExternal(e,t,r){this.currentWidth=e,this.currentHeight=t,this.renderer.setPixelRatio(r),this.sizeUpdated()}updateCanvasSize(){if(this.externalCanvas||typeof document>"u")return;let e=document.body.offsetWidth,t=document.body.offsetHeight;this.currentWidth!==e&&(this.currentWidth=e),this.currentHeight!==t&&(this.currentHeight=t)}setupFpsTracking(){let e=0;this.fpsInterval=setInterval(()=>{e>0&&(this.droppedFpsPercentage=this.renderedFps/e),e=Math.max(this.renderedFps,e),this.nonReactiveState&&(this.nonReactiveState.fps=this.renderedFps),this.renderedFps=0},1e3)}startRenderLoop(){let e=()=>{if(this.disconnected)return;if(this.config.timeoutRendering){let i=1e3/(this.config.fpsLimit?Math.min(this.config.fpsLimit,60):60);this.timeoutId=setTimeout(e,i)}else this.animationFrameId=requestAnimationFrame(e);if(this.paused||this.renderer.xr.isPresenting&&!this.inWorldRenderingConfig?.vrPageGameRendering)return;if(!this.config.timeoutRendering&&this.config.fpsLimit){let r=performance.now(),i=r-this.lastRenderTime,s=1e3/this.config.fpsLimit;if(i<s)return;this.lastRenderTime=r-i%s}let t=!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(),t=!0),this.frameRender(t),this.config.statsVisible!==void 0&&this.stats?.setVisibility(this.config.statsVisible)};e()}frameRender(e){this.preRender(),this.stats?.markStart(),$2(),globalThis.freezeRender||this.render(e);for(let t of this.onRender)t(e);this.renderedFps++,this.stats?.markEnd(),this.postRender()}setPaused(e){this.paused=e}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 es(){let n=document.createElement("canvas");return n.id="viewer-canvas",document.body.appendChild(n),n}var Hr=()=>{let n=es(),e=n.transferControlToOffscreen(),t=!1,r=(o,v)=>{},i={width:0,height:0},s=()=>{t||((i.width!==window.innerWidth||i.height!==window.innerHeight)&&(r(window.innerWidth,window.innerHeight),i={width:window.innerWidth,height:window.innerHeight}),requestAnimationFrame(s))};return requestAnimationFrame(s),{canvas:e,destroy(){t=!0,n.remove()},onSizeChanged(o){r=o},get size(){return{width:window.innerWidth,height:window.innerHeight}}}};import{ItemsRenderer as rs}from"mc-assets/dist/itemsRenderer";import{getLoadedItemDefinitionsStore as Dr}from"mc-assets/dist/stores";var d1=null;function ss(n){return le?((!d1||typeof d1.get!="function")&&(d1=Dr(Or)),d1):(os(n),n.itemsDefinitionsStore)}function os(n){le||typeof n.itemsDefinitionsStore?.get=="function"||(n.itemsDefinitionsStore=Dr(n.sourceItemDefinitionsJson??Or))}var Pt=class{constructor(e){d(this,"sourceItemDefinitionsJson",Or);d(this,"itemsDefinitionsStore",Dr(this.sourceItemDefinitionsJson));d(this,"allReady",!1);d(this,"itemsAtlasImage");d(this,"blocksAtlasImage");d(this,"blocksAtlasJson");d(this,"itemsAtlasJson");d(this,"customBlockStates");d(this,"customModels");d(this,"customItemModelNames",{});d(this,"customTextures",{});d(this,"guiAtlas",null);d(this,"guiAtlasVersion",0);d(this,"itemsRenderer");d(this,"worldBlockProvider");d(this,"blockstatesModels",null);d(this,"version");d(this,"texturesVersion");d(this,"mcData");if(e){let t={...e};delete t.itemsDefinitionsStore,delete t.sourceItemDefinitionsJson,Object.assign(this,t),os(this)}if(this.version){let t=globalThis.loadedData??globalThis.mcData;le&&t?.entitiesByName?this.mcData=t:this.mcData=ns(this.version)}}prepareForTransfer(){let e={};for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&typeof this[t]!="function"&&(t==="itemsRenderer"||t==="worldBlockProvider"||t==="mcData"||t==="itemsDefinitionsStore"||t==="sourceItemDefinitionsJson"||(e[t]=this[t]));return e.customTextures={},delete e.itemsDefinitionsStore,delete e.sourceItemDefinitionsJson,e}},is="1.21.4",I0=class I0 extends q0{constructor(){super(...arguments);d(this,"sourceBlockStatesModels",null);d(this,"sourceBlocksAtlases",g6);d(this,"sourceItemsAtlases",b6);d(this,"currentResources");d(this,"itemsAtlasParser");d(this,"blocksAtlasParser");d(this,"currentConfig");d(this,"abortController",new AbortController);d(this,"_promiseAssetsReadyResolvers",Promise.withResolvers())}rebuildWorkerRenderers(t){if(le&&!(!t.version||!t.blockstatesModels||!t.blocksAtlasJson)){if(this.blocksAtlasParser=new tt({latest:t.blocksAtlasJson},""),t.itemsAtlasJson)this.itemsAtlasParser=new tt({latest:t.itemsAtlasJson},"");else if(!this.itemsAtlasParser?.atlas?.latest){if(!this.sourceItemsAtlases||Object.keys(this.sourceItemsAtlases).length===0)return;this.itemsAtlasParser=new tt(this.sourceItemsAtlases,"")}t.itemsRenderer=new rs(t.version,t.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser),t.worldBlockProvider=ts(t.blockstatesModels,this.blocksAtlasParser.atlas,is)}}static restoreTransferred(t,r){let i=new I0,s=o=>{i.currentResources=new Pt(o),i.rebuildWorkerRenderers(i.currentResources)};return s(t.currentResources),r&&r.addEventListener("message",({data:o})=>{o.class===I0.restorerName&&(o.type==="newResources"&&s(o.currentResources),o.type==="event"&&i.emit(o.eventName,...o.args))}),i}enrichTransferSnapshot(t){return t&&(this.itemsAtlasParser?.atlas?.latest&&(t.itemsAtlasJson=this.itemsAtlasParser.atlas.latest),this.blocksAtlasParser?.atlas?.latest&&(t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest),t)}prepareForTransfer(t){if(t){let r=this.emit.bind(this);this.emit=(i,...s)=>{if(r(i,...s),t.postMessage({class:I0.restorerName,type:"event",eventName:i,args:a1(s)}),i==="assetsTexturesUpdated"||i==="assetsInventoryReady"){let o=this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer());t.postMessage({class:I0.restorerName,type:"newResources",currentResources:o})}}}return{__restorer:I0.restorerName,currentResources:this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer())}}get promiseAssetsReady(){return this._promiseAssetsReadyResolvers.promise}async loadSourceData(t=this.currentConfig?.version){if(!t)throw new Error("No version loaded");this.sourceBlockStatesModels??(this.sourceBlockStatesModels=(await import("mc-assets/dist/blockStatesModels.json")).default)}resetResources(){this.currentResources=new Pt}async updateAssetsData(t,r=!1){if(!this.currentConfig)throw new Error("No config loaded");this._promiseAssetsReadyResolvers=Promise.withResolvers();let i=new AbortController;if(await this.loadSourceData(this.currentConfig.version),i.signal.aborted)return;let s=this.currentResources??new Pt;s.version=this.currentConfig.version,s.texturesVersion=this.currentConfig.texturesVersion??s.version,s.mcData=ns(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)]),!i.signal.aborted&&(s.version&&s.blockstatesModels&&this.itemsAtlasParser&&this.blocksAtlasParser&&(s.itemsRenderer=new rs(s.version,s.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser)),!i.signal.aborted&&(this.currentResources=s,s.allReady=!0,r||this.emit("assetsTexturesUpdated"),this.currentConfig.noInventoryGui?this._promiseAssetsReadyResolvers.resolve():(this.emit("assetsInventoryStarted"),this.generateGuiTextures().then(()=>{i.signal.aborted||(r||this.emit("assetsInventoryReady"),this._promiseAssetsReadyResolvers.resolve())}))))}async recreateBlockAtlas(t=this.currentResources){let r={},i=new Date;(i.getMonth()===11&&i.getDate()>=24||i.getMonth()===0&&i.getDate()<=6)&&Object.assign(r,E6);let s=new tt(this.sourceBlocksAtlases,y6,_6),o=Object.keys(t.customTextures.blocks?.textures??{}),{atlas:v,canvas:a}=await s.makeNewAtlas(t.texturesVersion,l=>{if(this.currentConfig.includeOnlyBlocks&&!this.currentConfig.includeOnlyBlocks.includes(l))return!1;let c=t.customTextures.blocks?.textures[l];return r[l]??c},void 0,void 0,o,{needHorizontalIndexes:!!this.currentConfig.includeOnlyBlocks});this.blocksAtlasParser=new tt({latest:v},a.toDataURL()),t.blocksAtlasImage=await createImageBitmap(a),t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest,t.worldBlockProvider=ts(t.blockstatesModels,this.blocksAtlasParser.atlas,is)}async recreateItemsAtlas(t=this.currentResources){let r=new tt(this.sourceItemsAtlases,w6,A6),i=Object.keys(t.customTextures.items?.textures??{}),{atlas:s,canvas:o}=await r.makeNewAtlas(t.texturesVersion,v=>{let a=t.customTextures.items?.textures[v];if(a)return a},t.customTextures.items?.tileSize,void 0,i);this.itemsAtlasParser=new tt({latest:s},o.toDataURL()),t.itemsAtlasImage=await createImageBitmap(o),t.itemsAtlasJson=this.itemsAtlasParser.atlas.latest}async generateGuiTextures(){}async downloadDebugAtlas(t=!1){if(!this.currentResources)throw new Error("No resources loaded");let s=await(t?this.itemsAtlasParser:this.blocksAtlasParser).createDebugImage(!0),o=document.createElement("a");o.href=s,o.download=`atlas-debug-${t?"items":"blocks"}.png`,o.click()}destroy(){this.abortController.abort(),this.currentResources=void 0,this.abortController=new AbortController}};d(I0,"restorerName","ResourcesManager");var m0=I0;E();x();k();R();var a0=class extends Error{constructor(t,r){super(t);d(this,"failure");this.name="MesherWorkerPreloadError",this.failure=r}};function x6(n){return!n||typeof n!="object"?!1:n.type==="mc-web-pong"?!0:Array.isArray(n)?n.some(e=>e&&typeof e=="object"&&e.type==="mc-web-pong"):!1}var R6=45e3,k6=1e4;async function as(n){if(D.env.SINGLE_FILE_BUILD)return;let e=n?.fetchTimeoutMs??R6,t=n?.pingTimeoutMs??k6,r=n?.script??"mesher.js",i=new URL(r,document.baseURI).href,s;try{let u=new AbortController,f=window.setTimeout(()=>u.abort(),e);try{s=await fetch(i,{credentials:"same-origin",cache:"force-cache",signal:u.signal})}finally{clearTimeout(f)}}catch(u){let f=u;throw f?.name==="AbortError"?new a0(`Mesher script fetch timed out after ${e}ms (${i}).`,{phase:"fetch",code:"timeout"}):new a0(`Mesher script fetch failed (network): ${f?.message??u}. URL: ${i}`,{phase:"fetch",code:"network",detail:String(f?.message??u)})}if(!s.ok)throw new a0(`Mesher script HTTP ${s.status} ${s.statusText}: ${i}`,{phase:"fetch",code:"bad-status",status:s.status});let o=s.headers.get("content-type")??"",v=await s.arrayBuffer();if(v.byteLength===0)throw new a0(`Mesher script response was empty: ${i}`,{phase:"fetch",code:"invalid-body",hint:"empty"});let a=Math.min(1024,v.byteLength),l=new TextDecoder().decode(v.slice(0,a)).trimStart();if(l.startsWith("<!DOCTYPE")||l.startsWith("<html")||l.startsWith("<HTML"))throw new a0(`Mesher URL returned HTML (wrong path, redirect, or SPA fallback), not JavaScript: ${i}`,{phase:"fetch",code:"invalid-body",hint:"html"});o.length>0&&/javascript|ecmascript/i.test(o);let c;try{c=new Worker(i)}catch(u){let f=u instanceof Error?u.message:String(u);throw new a0(`Could not construct Worker for mesher (${i}): ${f}`,{phase:"worker",code:"construct-failed",message:f})}await new Promise((u,f)=>{let p=!1,g=window.setTimeout(()=>{p||(p=!0,y(),f(new a0(`Mesher worker did not reply with mc-web-pong within ${t}ms (wrong script, SW stale cache, worker blocked, or COEP/CORP). URL: ${i}`,{phase:"ping",code:"timeout"})))},t),y=()=>{clearTimeout(g);let M=c;c=void 0,M&&(M.removeEventListener("message",_),M.removeEventListener("error",S),M.removeEventListener("messageerror",C),M.terminate())},A=()=>{p||(p=!0,y(),u())},b=M=>{p||(p=!0,y(),f(M))};function _(M){x6(M.data)&&A()}function S(M){b(new a0(`Mesher worker script failed to load or threw during startup: ${M.message||"unknown"} @ ${i}`,{phase:"worker",code:"script-error",message:M.message}))}function C(){b(new a0(`Mesher worker message channel error (structured clone / deserialization). URL: ${i}`,{phase:"ping",code:"messageerror"}))}c.addEventListener("message",_),c.addEventListener("error",S),c.addEventListener("messageerror",C);try{c.postMessage({type:"mc-web-ping",t:performance.now(),workerIndex:0})}catch(M){let P=M instanceof Error?M.message:String(M);b(new a0(`Failed to post mc-web-ping to mesher worker: ${P}`,{phase:"ping",code:"post-failed",detail:P}))}})}var ls=class{constructor(e={},t=new m0){this.resourcesManager=t;d(this,"waitBackendLoadPromises",[]);d(this,"onWorldStart");d(this,"onBeforeWorldStart");d(this,"worldView");d(this,"config");d(this,"menuBackgroundOptions");d(this,"inWorldRenderingConfig");d(this,"backend");d(this,"backendLoader");d(this,"currentState");d(this,"currentDisplay",null);d(this,"playerState",{reactive:kr()});d(this,"rendererState");d(this,"nonReactiveState");d(this,"worldReady");d(this,"resolveWorldReady");d(this,"lastCamUpdate",0);d(this,"getRendererOptions");this.config={...N2,...e.config},this.menuBackgroundOptions={...e.config?.menuBackground,...e.menuBackground},this.inWorldRenderingConfig=vs({...u5,...e.rendererConfig});let r=Z0();this.rendererState=r.reactive,this.nonReactiveState=r.nonReactive,this.initWorldReadyPromise()}initWorldReadyPromise(){let{promise:e,resolve:t}=Promise.withResolvers();this.worldReady=e,this.resolveWorldReady=t}preloadWorkers(){let e=this.inWorldRenderingConfig.wasmMesher?"mesherWasm.js":"mesher.js";return as({script:e})}bindRendererOptions(e){this.getRendererOptions=e}async loadBackend(e){this.backend&&this.disconnectBackend(),await Promise.all(this.waitBackendLoadPromises),this.waitBackendLoadPromises=[],this.backendLoader=e;let t={config:this.config,getRendererOptions:this.getRendererOptions,callbacks:{displayCriticalError:i=>{},setRendererSpecificSettings:(i,s)=>{},fireCustomEvent:(i,...s)=>{}},rendererSpecificSettings:{}},r=e(t);if(this.backend=await Promise.resolve(r),this.currentState)if(this.currentState.method==="startMenuBackground")this.startMenuBackground(...this.currentState.args);else{let{method:i,args:s}=this.currentState;this.backend[i](...s)}}async startWorld(e,t,r=this.playerState.reactive,i){if(this.currentDisplay==="world")throw new Error("World already started");this.currentDisplay="world";let s=i??new T6(0,64,0);this.worldView=new et(e,t,s),this.worldView.isPlayground=this.inWorldRenderingConfig.isPlayground;let o={version:this.resourcesManager?.currentConfig?.version??"1.20.4",worldView:this.worldView,inWorldRenderingConfig:this.inWorldRenderingConfig,playerStateReactive:r,rendererState:this.rendererState,nonReactiveState:this.nonReactiveState,resourcesManager:this.resourcesManager};this.onBeforeWorldStart?.();let v;if(this.backend){let a=this.backend.startWorld(o);a&&typeof a.then=="function"&&(v=a)}return this.currentState={method:"startWorld",args:[o]},await v,this.resolveWorldReady(),this.onWorldStart?.(),!!v}startMenuBackground(e){if(this.currentDisplay==="menu")return;let t={...this.menuBackgroundOptions,...e,resourcesManager:e?.resourcesManager??this.resourcesManager};this.backend&&(this.currentDisplay="menu",this.backend.startMenuBackground(t)),this.currentState={method:"startMenuBackground",args:[t]}}resetBackend(e=!1){this.disconnectBackend(e),this.backendLoader&&this.loadBackend(this.backendLoader)}disconnectBackend(e=!1){e&&(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=vs(Z0().reactive),this.nonReactiveState=Z0().nonReactive}updateCamera(e,t,r){this.backend?.updateCamera(e,t,r)}setRendering(e){this.backend?.setRendering(e)}async startWithBot(e,t){await this.startWorld(e.world,t),this.worldView&&typeof this.worldView.listenToBot=="function"&&this.worldView.listenToBot(e)}destroyAll(){this.disconnectBackend(!0),this.resourcesManager&&typeof this.resourcesManager.destroy=="function"&&this.resourcesManager.destroy()}get utils(){let e=this.backend;return{async waitingForChunks(){if(!e?.worldState?.allChunksLoaded)return new Promise(t=>{let r=setInterval(()=>{e?.worldState?.allChunksLoaded&&(clearInterval(r),t())},100)})}}}destroy(){this.disconnectBackend(!0)}};E();x();k();R();import{subscribe as z6}from"valtio/vanilla";E();x();k();R();E();x();k();R();var rt=["galaxy","nether","end","cyber","light"],it=["cruise","barrel","dive","orbit","snake"],g5={galaxy:"Galaxy",nether:"Nether",end:"The End",cyber:"Cyber",light:"Light Space"},b5={cruise:"Cruise",barrel:"Barrel",dive:"Dive",orbit:"Orbit",snake:"Snake"},nt=["mixed","stainedGlass","wool","construction","glow","world"],y5={mixed:"Mixed",stainedGlass:"Stained glass",wool:"Wool",construction:"Construction",glow:"Glow",world:"World (grass & ores)"};E();x();k();R();var y0={mode:"v2",minecraftTextures:!0,v2Scene:"light",v2Camera:"dive",v2BlockGroup:"stainedGlass",v2CameraSpeedPercent:80,v2BlockSpeedPercent:40},x0=n=>n/100,_5={camera:x0(y0.v2CameraSpeedPercent),block:x0(y0.v2BlockSpeedPercent)};var M6={off:0,holes:1,texIndex:2,faces:3,atlasAlpha:4};function Fr(n){return M6[n]}var st=y0,cs={rendererWorldPerformance:"normal",rendererMeshersCountOverride:null,starfieldRendering:!0,defaultSkybox:!0,menuBackgroundMode:st.mode,menuBackgroundMinecraftTextures:st.minecraftTextures,menuBackgroundV2Scene:st.v2Scene,menuBackgroundV2Camera:st.v2Camera,menuBackgroundV2BlockGroup:st.v2BlockGroup,menuBackgroundV2CameraSpeed:st.v2CameraSpeedPercent,menuBackgroundV2BlockSpeed:st.v2BlockSpeedPercent,rendererFuturisticReveal:!1,rendererPerfDebugOverlay:!1,disableBlockEntityTextures:!1,rendererMesher:"wasm",rendererShaderCubeBlocks:!1,rendererShaderCubeDebugMode:"off",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",fov:75};function S6(n){n.highPerformanceGpu&&(n.gpuPreference="high-performance",delete n.highPerformanceGpu),n.rendererMesher!=="wasm"&&n.rendererMesher!=="legacy-js"&&(typeof n.rendererWasmMesher=="boolean"?n.rendererMesher=n.rendererWasmMesher?"wasm":"legacy-js":typeof n.wasmExperimentalMesher=="boolean"&&(n.rendererMesher=n.wasmExperimentalMesher?"wasm":"legacy-js")),delete n.wasmExperimentalMesher,delete n.rendererWasmMesher,n.menuBackgroundMode==="futuristic"&&(n.menuBackgroundMode="v2");let e=[["menuBackgroundFuturisticScene","menuBackgroundV2Scene"],["menuBackgroundFuturisticCamera","menuBackgroundV2Camera"],["menuBackgroundFuturisticBlockGroup","menuBackgroundV2BlockGroup"],["menuBackgroundFuturisticCameraSpeed","menuBackgroundV2CameraSpeed"],["menuBackgroundFuturisticBlockSpeed","menuBackgroundV2BlockSpeed"]];for(let[t,r]of e)n[t]!==void 0&&n[r]===void 0&&(n[r]=n[t]),delete n[t]}var ds={menuBackgroundMode:{possibleValues:[["classic","Classic"],["v2","V2"]],requiresRestart:!0},menuBackgroundMinecraftTextures:{text:"Minecraft block textures",tooltip:"Use block atlas on V2 menu cubes (loads assets on menu)"},menuBackgroundV2Scene:{possibleValues:rt.map(n=>[n,g5[n]])},menuBackgroundV2Camera:{possibleValues:it.map(n=>[n,b5[n]])},menuBackgroundV2BlockGroup:{possibleValues:nt.map(n=>[n,y5[n]]),text:"Block pool",tooltip:"Block set for textured menu cubes (requires Minecraft textures)"},menuBackgroundV2CameraSpeed:{text:"Camera speed",tooltip:"Orbit / fly-through camera path speed. 0 freezes the path; mouse parallax still works.",min:0,max:200,unit:"%"},menuBackgroundV2BlockSpeed:{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},rendererShaderCubeBlocks:{text:"Instanced shader cubes",tooltip:"Render full blocks through the global GPU instanced path. Requires WASM mesher and WebGL2.",requiresChunksReload:!0},rendererShaderCubeDebugMode:{text:"Shader cube debug",tooltip:"Instanced cube path visualization (requires shader cubes enabled).",possibleValues:[["off","Off"],["holes","Hole test (red)"],["texIndex","Tile index colors"],["faces","Face id colors"],["atlasAlpha","Atlas alpha"]]},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:""},fov:{min:30,max:110,unit:"\xB0",text:"FOV"},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"]]}},us=[{title:"World rendering",keys:["rendererWorldPerformance","starfieldRendering","defaultSkybox","disableBlockEntityTextures","showChunkBorders","renderEntities","smoothLighting","vanillaLook","newVersionsLighting","dayCycleAndLighting","loadPlayerSkins","renderEars","showHand","viewBobbing","fov","keepChunksDistance","highlightBlockColor","clipWorldBelowY"]},{title:"Frame pacing",keys:["frameLimit","backgroundRendering","renderDebug","gpuPreference"]},{title:"VR",keys:["vrSupport","vrPageGameRendering"]},{title:"Menu background",keys:["menuBackgroundMode","menuBackgroundMinecraftTextures","menuBackgroundV2Scene","menuBackgroundV2Camera","menuBackgroundV2BlockGroup","menuBackgroundV2CameraSpeed","menuBackgroundV2BlockSpeed"]},{title:"Mesher",keys:["rendererMesher","rendererShaderCubeBlocks"]},{title:"Renderer debug",keys:["rendererFuturisticReveal","rendererPerfDebugOverlay","rendererShaderCubeDebugMode"]}];E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();function zr(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let v=0;v<i;v++){let a=(o+v*r)*4;if(s.data[a+3]!==255)return!0}return!1}function u1(n){return n/64}function fs(n,e,t){if(t){if(zr(n,0,0,e,e))return}else if(zr(n,0,0,e,e/2))return;let r=u1(e),i=(s,o,v,a)=>n.clearRect(s*r,o*r,v*r,a*r);i(40,0,8,8),i(48,0,8,8),i(32,8,8,8),i(40,8,8,8),i(48,8,8,8),i(56,8,8,8),t&&(i(4,32,4,4),i(8,32,4,4),i(0,36,4,12),i(4,36,4,12),i(8,36,4,12),i(12,36,4,12),i(20,32,8,4),i(28,32,8,4),i(16,36,4,12),i(20,36,8,12),i(28,36,4,12),i(32,36,8,12),i(44,32,4,4),i(48,32,4,4),i(40,36,4,12),i(44,36,4,12),i(48,36,4,12),i(52,36,12,12),i(4,48,4,4),i(8,48,4,4),i(0,52,4,12),i(4,52,4,12),i(8,52,4,12),i(12,52,4,12),i(52,48,4,4),i(56,48,4,4),i(48,52,4,12),i(52,52,4,12),i(56,52,4,12),i(60,52,4,12))}function C6(n,e){n.save(),n.scale(-1,1);let t=u1(e),r=(i,s,o,v,a,l)=>n.drawImage(n.canvas,i*t,s*t,o*t,v*t,-a*t,l*t,-o*t,v*t);r(4,16,4,4,20,48),r(8,16,4,4,24,48),r(0,20,4,12,24,52),r(4,20,4,12,20,52),r(8,20,4,12,16,52),r(12,20,4,12,28,52),r(44,16,4,4,36,48),r(48,16,4,4,40,48),r(40,20,4,12,40,52),r(44,20,4,12,36,52),r(48,20,4,12,32,52),r(52,20,4,12,44,52),n.restore()}function Lr(n,e){let t=!1;if(e.width!==e.height)if(e.width===2*e.height)t=!0;else throw new Error(`Bad skin size: ${e.width}x${e.height}`);let r=n.getContext("2d",{willReadFrequently:!0});if(t){let i=e.width;n.width=i,n.height=i,r.clearRect(0,0,i,i),r.drawImage(e,0,0,i,i/2),C6(r,i),fs(r,n.width,!1)}else n.width=e.width,n.height=e.height,r.clearRect(0,0,e.width,e.height),r.drawImage(e,0,0,n.width,n.height),fs(r,n.width,!0)}function B6(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 Ur(n,e){let t=B6(e);n.width=64*t,n.height=32*t;let r=n.getContext("2d",{willReadFrequently:!0});r.clearRect(0,0,n.width,n.height),r.drawImage(e,0,0,e.width,e.height)}function P6(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let v=0;v<i;v++){let a=(o+v*r)*4;if(!(s.data[a+0]===0&&s.data[a+1]===0&&s.data[a+2]===0&&s.data[a+3]===255))return!1}return!0}function I6(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let v=0;v<i;v++){let a=(o+v*r)*4;if(!(s.data[a+0]===255&&s.data[a+1]===255&&s.data[a+2]===255&&s.data[a+3]===255))return!1}return!0}function Gr(n){let e=u1(n.width),t=n.getContext("2d",{willReadFrequently:!0}),r=(v,a,l,c)=>zr(t,v*e,a*e,l*e,c*e),i=(v,a,l,c)=>P6(t,v*e,a*e,l*e,c*e),s=(v,a,l,c)=>I6(t,v*e,a*e,l*e,c*e);return r(50,16,2,4)||r(54,20,2,12)||r(42,48,2,4)||r(46,52,2,12)||i(50,16,2,4)&&i(54,20,2,12)&&i(42,48,2,4)&&i(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 Vr(n,e){if(e.width!==e.height&&e.width!==2*e.height)throw new Error(`Bad skin size: ${e.width}x${e.height}`);let t=u1(e.width),r=14*t,i=7*t;n.width=r,n.height=i;let s=n.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,r,i),s.drawImage(e,24*t,0,r,i,0,0,r,i)}E();x();k();R();import D6 from"mc-assets/dist/other-textures/latest/entity/player/wide/steve.png";E();x();k();R();import*as p0 from"three";E();x();k();R();var H6=()=>{if(typeof OffscreenCanvas>"u")return!1;try{let n=new OffscreenCanvas(1,1);return(n.getContext("webgl2")||n.getContext("webgl"))!==null}catch{return!1}},O6=H6(),je=(n,e)=>{if(O6||typeof document>"u")return new OffscreenCanvas(n,e);let t=document.createElement("canvas");return t.width=n,t.height=e,t};async function ot(n){let t=await(await fetch(n)).blob();return createImageBitmap(t)}var ke=(n,e=!1)=>{n instanceof p0.Mesh&&(n.geometry?.dispose?.(),n.material?.dispose?.()),n.children&&n.children.forEach(t=>ke(t,e)),e&&n instanceof p0.Mesh&&n.material?.map?.dispose?.()},Wr={},hs={},w5=n=>{let e=new p0.Texture,t=ot(n).then(r=>{let i=new OffscreenCanvas(r.width,r.height);return i.getContext("2d").drawImage(r,0,0),e.source.data=i,e.needsUpdate=!0,e});return{texture:e,promise:t}},It=async n=>w5(n).texture,H0=n=>{let e=je(n.width,n.height);e.getContext("2d").drawImage(n,0,0);let r=new p0.Texture(e);return r.magFilter=p0.NearestFilter,r.minFilter=p0.NearestFilter,r};function Ht(n){let{texture:e,promise:t}=w5(n);return e.magFilter=p0.NearestFilter,e.minFilter=p0.NearestFilter,t.catch(r=>{}),e}async function f1(n,e,t){if(!Wr[n]){let{promise:i,resolve:s}=Promise.withResolvers(),o=w5(n);Wr[n]=o.texture,o.promise.then(s),hs[n]=i}e(Wr[n]),hs[n].then(()=>{t?.()})}var e0=D6,vf=It(e0),ms={apiEnabled:!0},h1=n=>{Object.assign(ms,n)};async function O0(n,e){if(!ms.apiEnabled||e==="cape")return;let t=`https://playerdb.co/api/player/minecraft/${n}`,r=await fetch(t);return r.ok?(await r.json()).data.player.skin_texture:void 0}async function _0(n){n.startsWith("data:")||(n=await F6(n.replace("http://","https://")));let e=await ot(n),t=je(64,64);return Lr(t,e),{canvas:t,image:e}}var F6=async n=>{let t=await(await fetch(n,{})).arrayBuffer();return`data:image/png;base64,${z.from(t).toString("base64")}`};function bf(n){return{mode:n.menuBackgroundMode,useMinecraftTextures:n.menuBackgroundMinecraftTextures,v2Scene:n.menuBackgroundV2Scene,v2Camera:n.menuBackgroundV2Camera,v2BlockGroup:n.menuBackgroundV2BlockGroup,v2CameraSpeed:x0(n.menuBackgroundV2CameraSpeed),v2BlockSpeed:x0(n.menuBackgroundV2BlockSpeed)}}function L6(n,e){let t=n.v2;t&&(t.setScene?.(e.menuBackgroundV2Scene),t.setCamera?.(e.menuBackgroundV2Camera),t.setBlockGroup?.(e.menuBackgroundV2BlockGroup),t.setCameraSpeed?.(x0(e.menuBackgroundV2CameraSpeed)),t.setBlockSpeed?.(x0(e.menuBackgroundV2BlockSpeed)))}function U6(n){return n.rendererMesher!=="legacy-js"}function G6(n,e,t){let r=n.inWorldRenderingConfig,i=e.rendererMeshersCountOverride,s=o=>{r.mesherWorkers=i??o};switch(e.rendererWorldPerformance){case"low-energy":s(1),r.dedicatedChangeWorker=!1;break;case"normal":s(2),r.dedicatedChangeWorker=!t;break;case"maximum":s(Math.max(3,Math.min(navigator.hardwareConcurrency??0,8))),r.dedicatedChangeWorker=!t;break}}function V6(n,e,t){let r=e.backgroundRendering,i=e.frameLimit;t?n.config.fpsLimit=i||void 0:r==="5fps"?n.config.fpsLimit=5:r==="20fps"?n.config.fpsLimit=20:n.config.fpsLimit=void 0}function W6(n,e,t){let{renderDebug:r}=e;r==="none"||t.isCypress?n.config.statsVisible=0:r==="basic"?n.config.statsVisible=1:r==="advanced"&&(n.config.statsVisible=2)}function N6(n,e,t={}){let r=n.inWorldRenderingConfig,i=U6(e);r.showChunkBorders=e.showChunkBorders,r.futuristicReveal=e.rendererFuturisticReveal,G6(n,e,i),r.renderEntities=e.renderEntities,W6(n,e,t),V6(n,e,t.windowFocused!==!1),r.vrSupport=e.vrSupport,r.vrPageGameRendering=e.vrPageGameRendering,r.enableDebugOverlay=e.rendererPerfDebugOverlay,r.clipWorldBelowY=e.clipWorldBelowY,r.extraBlockRenderers=!e.disableBlockEntityTextures,r.fetchPlayerSkins=e.loadPlayerSkins,r.highlightBlockColor=e.highlightBlockColor,r.wasmMesher=i,r.shaderCubeBlocks=e.rendererShaderCubeBlocks&&i,r.disableMesherConversionCache=!!t.isSafari,h1({apiEnabled:e.loadPlayerSkins}),r.smoothLighting=e.smoothLighting,r.shadingTheme=e.vanillaLook?"vanilla":"high-contrast",r.starfield=e.starfieldRendering,r.defaultSkybox=e.defaultSkybox,r.fov=e.fov,r.shaderCubeDebugMode=Fr(e.rendererShaderCubeDebugMode)}function yf(n,e,t){e.keepChunksDistance=t.keepChunksDistance;let r=n.inWorldRenderingConfig;r.renderEars=t.renderEars,r.showHand=t.showHand,r.viewBobbing=t.viewBobbing,r.dayCycle=t.dayCycleAndLighting}function _f(n,e,t={}){n.bindRendererOptions(()=>e);let r=t.getWindowFocused?.()??!0,i=()=>{let s=e;if(N6(n,s,{isSafari:t.isSafari,isCypress:t.isCypress,windowFocused:r}),n.currentDisplay==="menu"){let o=n.backend?.getMenuBackground?.();o&&L6(o,s)}};return i(),t.onRegisterFocusHandlers?.({onFocus:()=>{r=!0,i()},onBlur:()=>{r=!1,i()}}),z6(e,i)}function wf(n,e,t){n.inWorldRenderingConfig.enableLighting=!t||e}E();x();k();R();import{proxy as j6}from"valtio";var ps=()=>j6({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,fovMultiplier:1,cameraSpectatingEntity:void 0,team:void 0}),Y6=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"}}),Q6=()=>({reactive:ps()}),gs=(n,e,t)=>({...e,"minecraft:date":new Date});E();x();k();R();E();x();k();R();import*as J5 from"three";import{Vec3 as f9}from"vec3";E();x();k();R();import{proxy as K6,getVersion as Yr,subscribe as _s}from"valtio";import{Vec3 as Qr}from"vec3";function ws(n,e){let t=e??globalThis;return t.addEventListener("message",r=>{let{type:i,args:s,msgId:o}=r.data;if(n[i]){let v=n[i](...s);v instanceof Promise&&v.then(a=>{t.postMessage({type:"result",msgId:o,args:[a]})})}}),null}var As=(n,e=!0)=>{let t=0;return new Proxy({},{get(r,i){return i==="transfer"?(...s)=>new Proxy({},{get(o,v){return(...a)=>{n.postMessage({type:v,args:a},s)}}}):(...s)=>{let o=t++,v=e?s.filter(a=>a instanceof ArrayBuffer||a instanceof MessagePort||typeof ImageBitmap<"u"&&a instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas||typeof ImageData<"u"&&a instanceof ImageData):[];return n.postMessage({type:i,msgId:o,args:s},v),{then(a){let l=({data:c})=>{c.type==="result"&&c.msgId===o&&(a(c.args[0]),n.removeEventListener("message",l))};n.addEventListener("message",l)}}}}})},Es=!1,A5={toWorker:0,fromWorker:0},bs=null,J6=()=>{bs==null&&(typeof window>"u"||(bs=setInterval(()=>{globalThis.debugWorkerSyncStats={...A5},A5.toWorker=0,A5.fromWorker=0},1e3)))},m1=n=>{J6(),n==="toWorker"?A5.toWorker++:A5.fromWorker++};var Z6=()=>Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15),q6=(n,e,t)=>{if(e.length===0)return;let r=n;for(let i=0;i<e.length-1;i++){let s=e[i];(r[s]==null||typeof r[s]!="object")&&(r[s]={}),r=r[s]}r[e[e.length-1]]=t},X6=(n,e)=>{if(e.length===0)return;let t=n;for(let r=0;r<e.length-1;r++)if(t=t[e[r]],t==null)return;delete t[e[e.length-1]]},jr=(n,e)=>{if(n==null||typeof n!="object")return n;if(n instanceof Qr)return{x:n.x,y:n.y,z:n.z,__restorer:"Vec3"};if(typeof n.prepareForTransfer=="function")return n.prepareForTransfer(e);if(ArrayBuffer.isView(n))return n;if(Array.isArray(n))return n.map(r=>jr(r,e));if(Yr(n)!==void 0)return E5(n);let t={};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=jr(n[r],e));return t},$6=(n,e)=>{let t=[];for(let r of n){let i=r[0];i==="delete"?t.push({kind:"delete",path:r[1]}):i==="set"&&t.push({kind:"set",path:r[1],value:jr(r[2],e)})}return t},xs=(n,e,t,r,i)=>{if(e.length===0)return;let s=$6(e,t);if(s.length!==0)try{t.postMessage({type:"sync",syncId:n,ops:s}),r==="toWorker"&&m1("toWorker")}catch{for(let v of s)v.kind==="set"&&at(v.value)}},Rs=(n,e,t,r=!1)=>{for(let i of e)i.kind==="delete"?X6(n,i.path):q6(n,i.path,R5(i.value,[],t,!1,!1));r==="fromWorker"&&m1("fromWorker")},ks=(n,e,t,r,i)=>{try{let s=E5(e);t.postMessage({type:"sync",syncId:n,value:s}),r==="toWorker"&&m1("toWorker")}catch{at(e)}},Ts=(n,e,t,r=!1)=>{Object.assign(n,R5(e,[],t,!1,!1)),r==="fromWorker"&&m1("fromWorker")},Nr=(n,e,t,r,i)=>{let s=n.__syncFromWorker||e.__syncFromWorker,o=n.__syncToWorker||e.__syncToWorker;if(!o&&!s&&!r)return;let v=Z6();if(n.__syncId=v,o||r){r&&o!==!1&&_s(e,l=>{xs(v,l,t,"toWorker",`toWorker:${i}`)});let a=n.__syncToWorkerInterval??e.__syncToWorkerInterval??0;a>0&&!r&&setInterval(()=>{ks(v,e,t,"toWorker",`toWorker:interval:${i}`)},a)}e.__syncFromWorker&&t.addEventListener("message",a=>{a.data.type==="sync"&&a.data.syncId===v&&(a.data.ops?Rs(e,a.data.ops,t,"fromWorker"):a.data.value&&Ts(e,a.data.value,t,"fromWorker"))})},E5=n=>{if(Yr(n)===void 0)return n;if(Array.isArray(n))return n.map(E5);if(typeof n=="object"&&n!==null){let e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=E5(n[t]));return e}return n},x5=(n,e,t=!0,r=!0,i=!1)=>{var v,a;let s=n,o={};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){if(t&&typeof n[l]=="function")continue;if(n[l]instanceof Date||n[l]instanceof RegExp||n[l]instanceof Map||n[l]instanceof Set||n[l]instanceof WeakMap||n[l]instanceof WeakSet,n[l]instanceof Qr){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(e);continue}let c=Yr(n[l])!==void 0;o[l]=c?E5(n[l]):n[l],n[l].__syncFromWorker&&(o[l].__syncFromWorker=!0),n[l].__syncToWorker&&(o[l].__syncToWorker=!0),n[l].__syncFromWorkerInterval&&(o[l].__syncFromWorkerInterval=n[l].__syncFromWorkerInterval),n[l].__syncToWorkerInterval&&(o[l].__syncToWorkerInterval=n[l].__syncToWorkerInterval);let u=n[l].__syncToWorker!==!1&&!i&&c&&!n[l].__syncFromWorker;if((v=o[l]).__syncToWorker??(v.__syncToWorker=u),c&&((a=o[l]).__valtio??(a.__valtio=!0)),o[l].__syncToWorker&&c){Nr(o[l],s[l],e,!0,l);continue}if(o[l].__syncFromWorker||o[l].__syncToWorker){Nr(o[l],s[l],e,c,l);continue}Nr(o[l],s[l],e,!1,l),o[l]=x5(o[l],e,t,!1,c)}}return o},at=(n,e=[])=>{for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(!n[t])continue;typeof n[t]=="object"&&n[t]!==null&&at(n[t],[...e,t]);try{structuredClone(n[t])}catch{}}},ys=new WeakMap,e7=(n,e,t)=>{if(!n.__syncId)return;let r=n.__syncId,i=ys.get(e);if(i||(i=new Set,ys.set(e,i)),!i.has(r)&&(i.add(r),n.__syncToWorker&&e.addEventListener("message",s=>{s.data.type==="sync"&&s.data.syncId===r&&(s.data.ops?Rs(n,s.data.ops,e):s.data.value&&Ts(n,s.data.value,e))}),n.__syncFromWorker)){n.__valtio&&_s(n,o=>{xs(r,o,e,"fromWorker",`fromWorker:${t}`)});let s=n.__syncFromWorkerInterval??0;s>0&&!n.__valtio&&setInterval(()=>{ks(r,n,e,"fromWorker",`fromWorker:interval:${t}`)},s)}},t7=[{restorerName:"Vec3",restoreTransferred(n,e){return new Qr(n.x,n.y,n.z)}}];var R5=(n,e,t,r=!0,i=!0)=>{let s=[...t7,...e],o=(v,a)=>{if(v==null||typeof v!="object")return v;if(v.__restorer){let l=s.find(u=>u.restorerName?u.restorerName===v.__restorer:u.name===v.__restorer);if(l)return l.restoreTransferred(v,t);let c=new Error(`Restorer ${v.__restorer} not found`);if(typeof r=="function")r(c);else if(r)throw c;return v}if(Array.isArray(v))return v.map((l,c)=>o(l,`${a}[${c}]`));for(let l in v){if(!Object.prototype.hasOwnProperty.call(v,l))continue;let c=v[l];c!=null&&typeof c=="object"&&(v[l]=o(c,`${a}.${l}`))}return v.__valtio&&(v=K6(v)),i&&e7(v,t,a),v};return o(n,"root")};E();x();k();R();var p1=class{constructor(e){this.nonReactiveState=e;d(this,"events",[]);d(this,"frozenEvents",[]);d(this,"lastSecondEvents",[]);d(this,"currentFrameStartTime",null);d(this,"lastInteractionTime",0);d(this,"lastSecondUpdateTime",0);d(this,"timeWindowMs",5e3);d(this,"lastSecondWindowMs",1e3);d(this,"maxEvents",500);d(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 e=performance.now(),t=e-this.currentFrameStartTime;this.addEvent({type:"frameEnd",timestamp:e,duration:t}),this.currentFrameStartTime=null}markCameraUpdate(e){if(!e)return;let t=performance.now();this.lastInteractionTime=t,this.addEvent({type:"cameraUpdate",timestamp:t}),this.frozenEvents=[...this.events],this.trimEvents(this.frozenEvents),this.syncFrozenEvents()}markFrameDisplay(){this.addEvent({type:"frameDisplay",timestamp:performance.now()})}addEvent(e){this.events.push(e),this.lastSecondEvents.push(e),this.trimEvents(this.events),this.trimLastSecondEvents(),this.syncLiveEvents()}trimEvents(e){let r=performance.now()-this.timeWindowMs;for(;e.length>0&&e[0].timestamp<r;)e.shift();e.length>this.maxEvents&&e.splice(0,e.length-this.maxEvents)}trimLastSecondEvents(){let t=performance.now()-this.lastSecondWindowMs;for(;this.lastSecondEvents.length>0&&this.lastSecondEvents[0].timestamp<t;)this.lastSecondEvents.shift()}updateLastSecondTimeline(){let e=performance.now();e-this.lastSecondUpdateTime<this.lastSecondUpdateInterval||(this.lastSecondUpdateTime=e,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()}};E();x();k();R();import*as Q from"three";import{Vec3 as V0}from"vec3";import n9 from"prismarine-chat";E();x();k();R();var r7=(n,e)=>{try{return JSON.parse(n)}catch{return null}},i7={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"},g1=(n,e,t,r=s=>{},i=(s,o)=>je(s,o))=>{let v=[16,9],a=v[0]-v[1],l=a/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 u=i(16*40,a*40),f=u.getContext("2d");r(f);let p=("front_text"in n?n.front_text.color:n.Color)||"black";for(let[g,y]of c.slice(0,4).entries())y!=="null"&&Kr(y,t,u,64,p,64*(g+1)+(e?0:-8));return u},Kr=(n,e,t,r,i,s=0)=>{let o=!1,v=typeof n=="string"&&(n?.startsWith("{")||n?.startsWith('"'))?r7(n??'""',"sign text"):n;if(!v||typeof v!="object"&&typeof v!="string")return;let a=t.getContext("2d");if(!a)throw new Error("Could not get 2d context");a.imageSmoothingEnabled=!1,a.font=`${r}px mojangles`;let l=new e(v),c=[],u=!1,f="",p=s,g=[],y=(S,C)=>{S.text!==null&&S.text!==void 0&&S.text;let M=S.text===null||S.text===void 0?void 0:String(S.text),P={color:S.color??C?.color,underlined:S.underlined??C?.underlined,strikethrough:S.strikethrough??C?.strikethrough,bold:S.bold??C?.bold,italic:S.italic??C?.italic};if(u=u||P.underlined||P.strikethrough||!1,M?.includes(`
|
|
285
|
+
`;Z1=6,c0={LX_BITS:4,LY_BITS:4,LZ_BITS:4,FACE_BITS:3,TINT_BITS:8,AO_BITS_PER_CORNER:2,NUM_CORNERS:4,LX_SHIFT:0,LY_SHIFT:4,LZ_SHIFT:8,FACE_SHIFT:12,TINT_SHIFT:15,AO_SHIFT:23,TRANSPARENT_SHIFT:31},ra={TEX_INDEX_BITS:12,DIAGONAL_FLAG_SHIFT:12,SECTION_Y_SHIFT:13,SECTION_Y_BITS:5,EMPTY_SHIFT:18,SPARE_BITS:13}});var X1,ia=Xe(()=>{"use strict";E();x();k();R();X1=class{constructor(e){d(this,"atlasWidth");d(this,"atlasHeight");d(this,"tileSize");d(this,"tilesPerRow");d(this,"maxTiles");d(this,"valid");this.atlasWidth=e.width,this.atlasHeight=e.height,this.tileSize=e.tileSize,this.tilesPerRow=Math.floor(this.atlasWidth/this.tileSize),this.maxTiles=this.tilesPerRow*Math.floor(this.atlasHeight/this.tileSize),this.valid=this.atlasWidth===1024&&this.atlasHeight===1024&&this.tileSize===16&&this.maxTiles<=4096}isValid(){return this.valid}getTilesPerRow(){return this.tilesPerRow}tileIndexFromPixelCoords(e,t){if(!this.valid)return-1;let r=Math.floor(e/this.tileSize),i=Math.floor(t/this.tileSize);if(r<0||r>=this.tilesPerRow||i<0)return-1;let s=i*this.tilesPerRow+r;return s>=this.maxTiles?-1:s}tileIndexFromTextureEntry(e){return!this.valid||e.su!==this.tileSize||e.sv!==this.tileSize?-1:this.tileIndexFromPixelCoords(e.u,e.v)}tileIndexFromTextureName(e,t){if(!this.valid)return-1;let r=t.textures[e];if(!r&&e.includes(":")&&(r=t.textures[e.split(":")[1]]),!r&&e.includes("/")&&(r=t.textures[e.split("/")[1]]),r||(r=t.textures[`block/${e}`]),!r){let i=e.replace(/^block\//,"");r=t.textures[i]}return r?this.tileIndexFromTextureEntry(r):-1}}});import*as d0 from"three";var $1,na=Xe(()=>{"use strict";E();x();k();R();$1=class n{constructor(){d(this,"entries",[{r:1,g:1,b:1}]);d(this,"colorToIndex",new Map);d(this,"categoryBiomeToIndex",new Map);d(this,"texture",null);d(this,"ready",!1)}packColor(e,t,r){let i=Math.round(e*255),s=Math.round(t*255),o=Math.round(r*255);return i<<16|s<<8|o}add(e,t,r,i,s){let o=this.packColor(e,t,r),a=`${i}:${s}`,v=this.categoryBiomeToIndex.get(a);if(v!==void 0)return v;let l=this.colorToIndex.get(o);if(l!==void 0)return this.categoryBiomeToIndex.set(a,l),l;let c=this.entries.length;return this.entries.push({r:e,g:t,b:r}),this.colorToIndex.set(o,c),this.categoryBiomeToIndex.set(a,c),c}getTintIndex(e,t,r,i){return e===void 0?0:e===0?t==="redstone_wire"?this.categoryBiomeToIndex.get(`redstone:${r.power}`)??this.categoryBiomeToIndex.get("redstone:0")??0:t==="birch_leaves"||t==="spruce_leaves"||t==="lily_pad"?this.categoryBiomeToIndex.get(`constant:${t}`)??this.categoryBiomeToIndex.get("constant:default")??0:t.includes("leaves")||t==="vine"?this.categoryBiomeToIndex.get(`foliage:${i}`)??this.categoryBiomeToIndex.get("foliage:plains")??0:this.categoryBiomeToIndex.get(`grass:${i}`)??this.categoryBiomeToIndex.get("grass:plains")??0:0}getEntry(e){return this.entries[e]??this.entries[0]}get size(){return this.entries.length}buildTextureData(){let e=new Float32Array(1024);for(let t=0;t<this.entries.length&&t<256;t++){let r=this.entries[t];e[t*4]=r.r,e[t*4+1]=r.g,e[t*4+2]=r.b,e[t*4+3]=1}return e}createTexture(){this.texture&&(this.texture.dispose(),this.texture=null,this.ready=!1);let e=this.buildTextureData(),t=new d0.DataTexture(e,256,1,d0.RGBAFormat,d0.FloatType);return t.minFilter=d0.NearestFilter,t.magFilter=d0.NearestFilter,t.wrapS=d0.ClampToEdgeWrapping,t.wrapT=d0.ClampToEdgeWrapping,t.needsUpdate=!0,this.texture=t,this.ready=!0,t}getTexture(){return this.texture}isReady(){return this.ready}static fromTintsData(e){let t=new n;function r(i){let s=(i>>16&255)/255,o=(i>>8&255)/255,a=(i&255)/255;return[s,o,a]}if(e.grass){let i=r(e.grass.default);for(let{keys:s,color:o}of e.grass.data??[]){let a=r(o);for(let v of s)t.add(a[0],a[1],a[2],"grass",v)}t.add(i[0],i[1],i[2],"grass","plains")}if(e.foliage){let i=r(e.foliage.default);for(let{keys:s,color:o}of e.foliage.data??[]){let a=r(o);for(let v of s)t.add(a[0],a[1],a[2],"foliage",v)}t.add(i[0],i[1],i[2],"foliage","plains")}if(e.redstone){let i=r(e.redstone.default);for(let{keys:s,color:o}of e.redstone.data??[]){let a=r(o);for(let v of s)t.add(a[0],a[1],a[2],"redstone",v)}t.add(i[0],i[1],i[2],"redstone","0")}if(e.constant){let i=r(e.constant.default);for(let{keys:s,color:o}of e.constant.data??[]){let a=r(o);for(let v of s)t.add(a[0],a[1],a[2],"constant",v)}t.add(i[0],i[1],i[2],"constant","default")}return t}}});import sa from"mc-assets/dist/blocksAtlases.json";function Sv(){let n=globalThis.loadedData?.tints;return n||(oa||(oa=!0),null)}function tr(){let n=Sv();if(!n)return null;if(er||(er=$1.fromTintsData(n),er.createTexture()),!Ni){let e=sa.latest??sa;Ni=new X1({width:e.width,height:e.height,tileSize:e.tileSize??16,suSv:e.suSv??16,textures:e.textures??{}})}return{tintPalette:er,textureIndexMapping:Ni}}function aa(){return 1<<ra.EMPTY_SHIFT>>>0}var Jt,er,Ni,oa,qt=Xe(()=>{"use strict";E();x();k();R();gt();ia();na();Jt=4,er=null,Ni=null,oa=!1});import*as Ce from"three";function Cv(n,e){let t=new Ce.InstancedBufferGeometry,r=new Float32Array(Z1*3);t.setAttribute("position",new Ce.BufferAttribute(r,3));let i=new Uint32Array(e),s=new Uint32Array(e),o=new Uint32Array(e),a=new Uint32Array(e),v=Jt;for(let l=0;l<e;l++)i[l]=n[l*v],s[l]=n[l*v+1],o[l]=n[l*v+2],a[l]=n[l*v+3];return t.setAttribute("a_w0",new Ce.InstancedBufferAttribute(i,1)),t.setAttribute("a_w1",new Ce.InstancedBufferAttribute(s,1)),t.setAttribute("a_w2",new Ce.InstancedBufferAttribute(o,1)),t.setAttribute("a_w3",new Ce.InstancedBufferAttribute(a,1)),t.instanceCount=e,t.boundingBox=new Ce.Box3(new Ce.Vector3(-8,-8,-8),new Ce.Vector3(8,8,8)),t.boundingSphere=new Ce.Sphere(new Ce.Vector3(0,0,0),Math.sqrt(3*8**2)),t}function Bv(n){n.raycast=(e,t)=>{let{geometry:r}=n;if(!r.boundingBox||(va.copy(r.boundingBox).applyMatrix4(n.matrixWorld),!e.ray.intersectBox(va,Wi)))return;let i=e.ray.origin.distanceTo(Wi);t.push({distance:i,point:Wi.clone(),object:n})}}function rr(n,e){let t=Cv(n.words,n.count),r=new Ce.Mesh(t,e);return r.name="shaderMesh",r.matrixAutoUpdate=!1,r.frustumCulled=!1,Bv(r),r}function ji(n){n.geometry.dispose()}var va,Wi,Yi=Xe(()=>{"use strict";E();x();k();R();gt();qt();va=new Ce.Box3,Wi=new Ce.Vector3});var ha={};q5(ha,{applyWorldGeometryExport:()=>Hv,createMeshesFromExport:()=>ua,downloadWorldGeometry:()=>Qi,exportWorldGeometry:()=>ca,loadTextureFromDataUrl:()=>fa,loadWorldGeometryFromUrl:()=>Pv});import*as Be from"three";function ca(n,e,t,r=!1){let i=[];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"),u=l.getAttribute("normal"),h=l.getAttribute("color"),p=l.getAttribute("uv"),g=l.index;if(!c||!g)continue;let y=n.sceneOrigin.getWorldPosition(v);i.push({key:o,position:{x:y?.x??n.sceneOrigin.toWorldX(v.position.x),y:y?.y??n.sceneOrigin.toWorldY(v.position.y),z:y?.z??n.sceneOrigin.toWorldZ(v.position.z)},geometry:{positions:[...c.array],normals:u?[...u.array]:[],colors:h?[...h.array]:[],uvs:p?[...p.array]:[],indices:[...g.array]}})}let s={version:n.version??"unknown",exportedAt:new Date().toISOString(),camera:{position:e,rotation:t},sections:i};if(r&&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 Qi(n,e,t,r="world-geometry.json",i=!1){let s=ca(n,e,t,i),o=JSON.stringify(s),a=new Blob([o],{type:"application/json"}),v=URL.createObjectURL(a),l=document.createElement("a");l.href=v,l.download=r,l.click(),URL.revokeObjectURL(v)}async function Pv(n){let e=await fetch(n);if(!e.ok)throw new Error(`Failed to fetch world geometry: ${e.statusText}`);return e.json()}function da(n){let e=n.map??n.map;if(!e)return null;let t=q1();t.uniforms.u_atlas.value=e;let r=tr();if(!r)return null;let{tintPalette:i}=r;return i.isReady()||i.createTexture(),t.uniforms.u_tintPalette.value=i.getTexture(),t}function ua(n,e,t){let r=[],i=t??da(e);for(let s of n.sections){let o=new Be.Group;if(o.name="chunk",s.geometry.positions.length>0&&s.geometry.indices.length>0){let l=new Be.BufferGeometry;l.setAttribute("position",new Be.Float32BufferAttribute(s.geometry.positions,3)),s.geometry.normals.length&&l.setAttribute("normal",new Be.Float32BufferAttribute(s.geometry.normals,3)),s.geometry.colors.length&&l.setAttribute("color",new Be.Float32BufferAttribute(s.geometry.colors,3)),s.geometry.uvs.length&&l.setAttribute("uv",new Be.Float32BufferAttribute(s.geometry.uvs,2));let u=Math.max(...s.geometry.indices)>65535?Uint32Array:Uint16Array;l.setIndex(new Be.BufferAttribute(new u(s.geometry.indices),1));let h=new Be.Mesh(l,e);h.position.set(s.position.x,s.position.y,s.position.z),h.name="mesh",o.add(h)}let v=s.shaderCubes;if(v&&v.count>0&&i){let l=rr(v,i);l.position.set(s.position.x,s.position.y,s.position.z),o.add(l)}o.children.length>0&&r.push(o)}return r}async function fa(n){return new Promise((e,t)=>{let r=new Image;r.onload=()=>{let i=new Be.Texture(r);i.magFilter=Be.NearestFilter,i.minFilter=Be.NearestFilter,i.needsUpdate=!0,i.flipY=!1,e(i)},r.onerror=t,r.src=n})}async function Hv(n,e){let{scene:t,renderUpdateEmitter:r,material:i}=n,s=t.getObjectByName(la);s&&(t.remove(s),Iv(s));let o=!!e.textureAtlasDataUrl,a;if(o&&e.textureAtlasDataUrl){let u=await fa(e.textureAtlasDataUrl);a=new Be.MeshLambertMaterial({map:u,vertexColors:!0,transparent:!0,alphaTest:.1}),a.name="geometry-export-material"}else a=i;let v=e.sections.some(u=>(u.shaderCubes?.count??0)>0)?da(a):null,l=ua(e,a,v),c=new Be.Group;c.name=la,o&&(c.userData.geometryExportMaterial=a);for(let u of l)c.add(u);return t.add(c),r.emit("update"),l.length}var la,Iv,Ki=Xe(()=>{"use strict";E();x();k();R();qt();gt();Yi();la="geometry-export-root";Iv=n=>{n.traverse(t=>{t.isMesh&&t.geometry?.dispose()});let e=n.userData?.geometryExportMaterial;e&&(e.map?.dispose?.(),e.dispose?.())}});E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();import{proxy as z2}from"valtio";E();x();k();R();E();x();k();R();var yr=()=>({longRenderTime:!1,constantLongRenderTime:!1,tooManyEntities:!1,tooManyTextures:!1,unknownReason:!1});E();x();k();R();var t1=30;var _r=45,wr=100;E();x();k();R();var v5=class{constructor(e){this.factors=e;d(this,"renderTimeHistory",[])}onFrame(e){this.pushRenderTime(e.totalMs),this.recompute(e)}pushRenderTime(e){this.renderTimeHistory.push(e),this.renderTimeHistory.length>24&&this.renderTimeHistory.shift()}recompute(e){let t=e.fps>0&&e.fps<=45,r=Math.max(0,e.totalMs-e.entitiesMs),i=e.totalMs>=30,s=this.renderTimeHistory.length,o=this.renderTimeHistory.filter(h=>h>=30).length,a=s>=8&&o/s>=.65,v=e.loadedTextureCount>=100,l=t&&e.entitiesMs>=8&&r<=20,u=t&&!(i||a||l||v);this.factors.longRenderTime=i,this.factors.constantLongRenderTime=a,this.factors.tooManyEntities=l,this.factors.tooManyTextures=v,this.factors.unknownReason=u}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}};E();x();k();R();var a6=[{key:"longRenderTime",code:"LR"},{key:"constantLongRenderTime",code:"CLR"},{key:"tooManyEntities",code:"ENT"},{key:"tooManyTextures",code:"TEX"},{key:"unknownReason",code:"UNK"}];function Ar(n){let e=a6.filter(({key:t})=>n[t]).map(({code:t})=>t);return e.length>0?e.join("+"):""}var l5={paused:!1,showChunkBorders:!1,enableDebugOverlay:!1,debugWasmPerf:!1,debugModelVariant:void 0,futuristicReveal:!1,wasmMesher:!0,shaderCubeBlocks:!1,shaderCubeDebugMode: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:{}},L2={fpsLimit:void 0,sceneBackground:"lightblue",timeoutRendering:!1},yl=(n={})=>z2({...l5,...n}),J0=()=>({reactive:z2({world:{chunksLoaded:{},heightmaps:{},allChunksLoaded:!1,mesherWork:!1,instabilityFactors:yr(),intersectMedia:null},renderer:"...",preventEscapeMenu:!1}),nonReactive:{fps:0,worstRenderTime:0,avgRenderTime:0,world:{chunksLoadedCount:0,chunksTotalNumber:0,chunksFullInfo:"-"},renderer:{timeline:{live:[],frozen:[],lastSecond:[]}}}});E();x();k();R();import{proxy as v6}from"valtio";var Er=()=>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,fovMultiplier:1,cameraSpectatingEntity:void 0,team:void 0}),U2=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"}}),G2=()=>({reactive:Er()});E();x();k();R();import{Vec3 as w6}from"vec3";import{proxy as is}from"valtio";E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();var r1={},V2=!1;function l6(){if(V2)return r1;V2=!0;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(M,I,B){return Function.prototype.apply.call(M,I,B)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:t=function(M){return Object.getOwnPropertyNames(M)};function r(C){}var i=Number.isNaN||function(M){return M!==M};function s(){s.init.call(this)}r1=s,r1.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");o=C}}),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(M){if(typeof M!="number"||M<0||i(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function v(C){return C._maxListeners===void 0?s.defaultMaxListeners:C._maxListeners}s.prototype.getMaxListeners=function(){return v(this)},s.prototype.emit=function(M){for(var I=[],B=1;B<arguments.length;B++)I.push(arguments[B]);var H=M==="error",G=this._events;if(G!==void 0)H=H&&G.error===void 0;else if(!H)return!1;if(H){var O;if(I.length>0&&(O=I[0]),O instanceof Error)throw O;var j=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw j.context=O,j}var J=G[M];if(J===void 0)return!1;if(typeof J=="function")e(J,this,I);else for(var q=J.length,$=g(J,q),B=0;B<q;++B)e($[B],this,I);return!0};function l(C,M,I,B){var H,G,O;if(a(I),G=C._events,G===void 0?(G=C._events=Object.create(null),C._eventsCount=0):(G.newListener!==void 0&&(C.emit("newListener",M,I.listener?I.listener:I),G=C._events),O=G[M]),O===void 0)O=G[M]=I,++C._eventsCount;else if(typeof O=="function"?O=G[M]=B?[I,O]:[O,I]:B?O.unshift(I):O.push(I),H=v(C),H>0&&O.length>H&&!O.warned){O.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=C,j.type=M,j.count=O.length}return C}s.prototype.addListener=function(M,I){return l(this,M,I,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(M,I){return l(this,M,I,!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 u(C,M,I){var B={fired:!1,wrapFn:void 0,target:C,type:M,listener:I},H=c.bind(B);return H.listener=I,B.wrapFn=H,H}s.prototype.once=function(M,I){return a(I),this.on(M,u(this,M,I)),this},s.prototype.prependOnceListener=function(M,I){return a(I),this.prependListener(M,u(this,M,I)),this},s.prototype.removeListener=function(M,I){var B,H,G,O,j;if(a(I),H=this._events,H===void 0)return this;if(B=H[M],B===void 0)return this;if(B===I||B.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete H[M],H.removeListener&&this.emit("removeListener",M,B.listener||I));else if(typeof B!="function"){for(G=-1,O=B.length-1;O>=0;O--)if(B[O]===I||B[O].listener===I){j=B[O].listener,G=O;break}if(G<0)return this;G===0?B.shift():y(B,G),B.length===1&&(H[M]=B[0]),H.removeListener!==void 0&&this.emit("removeListener",M,j||I)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(M){var I,B,H;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[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[M]),this;if(arguments.length===0){var G=Object.keys(B),O;for(H=0;H<G.length;++H)O=G[H],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=B[M],typeof I=="function")this.removeListener(M,I);else if(I!==void 0)for(H=I.length-1;H>=0;H--)this.removeListener(M,I[H]);return this};function h(C,M,I){var B=C._events;if(B===void 0)return[];var H=B[M];return H===void 0?[]:typeof H=="function"?I?[H.listener||H]:[H]:I?A(H):g(H,H.length)}s.prototype.listeners=function(M){return h(this,M,!0)},s.prototype.rawListeners=function(M){return h(this,M,!1)},s.listenerCount=function(C,M){return typeof C.listenerCount=="function"?C.listenerCount(M):p.call(C,M)},s.prototype.listenerCount=p;function p(C){var M=this._events;if(M!==void 0){var I=M[C];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function g(C,M){for(var I=new Array(M),B=0;B<M;++B)I[B]=C[B];return I}function y(C,M){for(;M+1<C.length;M++)C[M]=C[M+1];C.pop()}function A(C){for(var M=new Array(C.length),I=0;I<M.length;++I)M[I]=C[I].listener||C[I];return M}function b(C,M){return new Promise(function(I,B){function H(O){C.removeListener(M,G),B(O)}function G(){typeof C.removeListener=="function"&&C.removeListener("error",H),I([].slice.call(arguments))}S(C,M,G,{once:!0}),M!=="error"&&w(C,H,{once:!0})})}function w(C,M,I){typeof C.on=="function"&&S(C,"error",M,I)}function S(C,M,I,B){if(typeof C.on=="function")B.once?C.once(M,I):C.on(M,I);else if(typeof C.addEventListener=="function")C.addEventListener(M,function H(G){B.once&&C.removeEventListener(M,H),I(G)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return r1}var i1=l6();i1.once;i1.once=function(n,e){return new Promise((t,r)=>{function i(...o){s!==void 0&&n.removeListener("error",s),t(o)}let s;e!=="error"&&(s=o=>{n.removeListener(name,i),r(o)},n.once("error",s)),n.once(e,i)})};i1.on=function(n,e){let t=[],r=[],i=null,s=!1,o={async next(){let l=t.shift();if(l)return createIterResult(l,!1);if(i){let c=Promise.reject(i);return i=null,c}return s?createIterResult(void 0,!0):new Promise((c,u)=>r.push({resolve:c,reject:u}))},async return(){n.removeListener(e,a),n.removeListener("error",v),s=!0;for(let l of r)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){i=l,n.removeListener(e,a),n.removeListener("error",v)},[Symbol.asyncIterator](){return this}};return n.on(e,a),n.on("error",v),o;function a(...l){let c=r.shift();c?c.resolve(createIterResult(l,!1)):t.push(l)}function v(l){s=!0;let c=r.shift();c?c.reject(l):i=l,o.return()}};var{EventEmitter:q0,defaultMaxListeners:Ol,init:Dl,listenerCount:Fl,on:zl,once:Ll}=i1;import{Vec3 as Z0}from"vec3";E();x();k();R();function c5(n){let e=n*2+1;if(e<=0)return[];let t=[],r=0,i=0,s=0,o=-1;for(let a=0;a<e*e;a++){if(Math.abs(r)<=e/2&&Math.abs(i)<=e/2&&t.push([r,i]),r===i||r<0&&r===-i||r>0&&r===1-i){let v=s;s=-o,o=v}r+=s,i+=o}return t}E();x();k();R();function xr(n,e=0){if(e>16)return;if(n==null)return n;let t=typeof n;if(t==="function"||t==="symbol")return;if(t==="bigint")return n.toString();if(t!=="object"||n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n)){let s=n;return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}if(n instanceof Date)return n.toISOString();if(Array.isArray(n))return n.map(s=>xr(s,e+1)).filter(s=>s!==void 0);let r=n;if(typeof r.x=="number"&&typeof r.y=="number"&&typeof r.z=="number"&&!("w"in r))return{x:r.x,y:r.y,z:r.z};let i={};for(let s of Object.keys(r)){if(s==="_client"||s==="_events"||s==="_eventsCount")continue;let o=xr(r[s],e+1);o!==void 0&&(i[s]=o)}return i}function n1(n){return n.map(e=>xr(e))}var Mt=n=>[Math.floor(n.x/16),Math.floor(n.z/16)],c6=n=>[Math.floor(n.x/16),Math.floor(n.y/16),Math.floor(n.z/16)],N2=async(n,e,t,r=1)=>{for(let i=0;i<n.length;i+=r)e&&await new Promise(s=>setTimeout(s,e)),await t(n[i],i)},Tt=new WeakMap,d5=class d5 extends q0{static restoreTransferred(e,t){let r=new d5;if(!t)return r;let i=Tt.get(t);if(i)i.activeWorldView=r;else{let s=({data:o})=>{let v=Tt.get(t)?.activeWorldView;!v||o?.class!==d5.restorerName||o.type==="event"&&v.emit(o.eventName,...o.args)};t.addEventListener("message",s),i={activeWorldView:r,handler:s},Tt.set(t,i)}return r}static clearWorkerBridgeForTest(e){let t=Tt.get(e);t&&(e.removeEventListener("message",t.handler),Tt.delete(e))}static getWorkerBridgeListenerCountForTest(e){return Tt.has(e)?1:0}};d(d5,"restorerName","WorldViewWorker");var X0=d5,$0=class extends q0{constructor(t,r,i=new Z0(0,0,0)){super();this.world=t;this.viewDistance=r;d(this,"spiralNumber",0);d(this,"gotPanicLastTime",!1);d(this,"panicChunksReload",()=>{});d(this,"loadedChunks",{});d(this,"inLoading",!1);d(this,"chunkReceiveTimes",[]);d(this,"lastChunkReceiveTime",0);d(this,"lastChunkReceiveTimeAvg",0);d(this,"panicTimeout");d(this,"lastPos");d(this,"eventListeners",{});d(this,"debugChunksInfo",{});d(this,"waitingSpiralChunksLoad",{});d(this,"addWaitTime",1);d(this,"keepChunksDistance",0);d(this,"isPlayground",!1);d(this,"allowPositionUpdate",!0);d(this,"lastBiomeId",null);d(this,"lastPosCheck",null);this.lastPos=new Z0(0,0,0).update(i)}prepareForTransfer(t){if(t){let r=this.emit.bind(this);this.emit=(i,...s)=>{r(i,...s),t.postMessage({class:X0.restorerName,type:"event",eventName:i,args:n1(s)})}}return{__restorer:X0.restorerName}}setBlockStateId(t,r){let i=this.world.setBlockStateId(t,r);if(i&&typeof i.then=="function")throw new Error("setBlockStateId returned promise (not supported)");this.emit("blockUpdate",{pos:t,stateId:r})}updateViewDistance(t){this.viewDistance=t,this.emit("renderDistance",t)}async init(t,r){this.updateViewDistance(this.viewDistance),this.emit("chunkPosUpdate",{pos:t}),r?.time?.timeOfDay!==void 0&&this.emit("time",r.time.timeOfDay),r?.entity&&this.emit("playerEntity",r.entity),this.emitterGotConnected(r);let[i,s]=Mt(t),o=c5(this.viewDistance).map(([a,v])=>new Z0((i+a)*16,0,(s+v)*16));this.lastPos.update(t),await this._loadChunks(o,t)}chunkProgress(){if(this.panicTimeout&&clearTimeout(this.panicTimeout),this.chunkReceiveTimes.length>=5){let t=this.chunkReceiveTimes.reduce((i,s)=>i+s,0)/this.chunkReceiveTimes.length;this.lastChunkReceiveTimeAvg=t;let r=t*2+1e3;this.panicTimeout&&clearTimeout(this.panicTimeout),this.panicTimeout=setTimeout(()=>{!this.gotPanicLastTime&&this.inLoading&&(this.gotPanicLastTime=!0,this.panicChunksReload())},r)}}async _loadChunks(t,r){this.spiralNumber++;let{spiralNumber:i}=this;for(let o of Object.keys(this.waitingSpiralChunksLoad))this.waitingSpiralChunksLoad[o](!1),delete this.waitingSpiralChunksLoad[o];let s=!0;this.inLoading=!0,await N2(t,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 ${i} from ${r.x},${r.z}`),this.chunkProgress()))}),i===this.spiralNumber&&(this.panicTimeout&&clearTimeout(this.panicTimeout),this.inLoading=!1,this.gotPanicLastTime=!1,this.chunkReceiveTimes=[],this.lastChunkReceiveTime=0)}async loadChunk(t,r=!1,i="spiral"){var l,c;let[s,o]=Mt(this.lastPos),a=Math.abs(s-Math.floor(t.x/16)),v=Math.abs(o-Math.floor(t.z/16));if(a<=this.viewDistance&&v<=this.viewDistance){let u=await this.world.getColumnAt(t.y!==void 0?t:new Z0(t.x,0,t.z));if(u){let h=u.toJson(),p={minY:u.minY??0,worldHeight:u.worldHeight??256};this.emit("loadChunk",{x:t.x,z:t.z,chunk:h,blockEntities:u.blockEntities,worldConfig:p,isLightUpdate:r}),this.loadedChunks[`${t.x},${t.z}`]=!0,(l=this.debugChunksInfo)[c=`${t.x},${t.z}`]??(l[c]={loads:[]}),this.debugChunksInfo[`${t.x},${t.z}`].loads.push({dataLength:h.length,reason:i,time:Date.now()})}else this.isPlayground&&this.emit("markAsLoaded",{x:t.x,z:t.z})}}unloadAllChunks(){for(let t of Object.keys(this.loadedChunks)){let[r,i]=t.split(",").map(Number);this.unloadChunk({x:r,z:i})}}unloadChunk(t){this.emit("unloadChunk",{x:t.x,z:t.z}),delete this.loadedChunks[`${t.x},${t.z}`],delete this.debugChunksInfo[`${t.x},${t.z}`]}emitterGotConnected(t){typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope||!t||this.emit("blockEntities",new Proxy({},{get(i,s,o){if(typeof s!="string")return;let[a,v,l]=s.split(",").map(Number);return t.world.getBlock(new Z0(a,v,l))?.entity}}))}updateBiome(t){try{if(!this.world.getBiome)return;let r=this.world.getBiome(t);r!==this.lastBiomeId&&(this.lastBiomeId=r,this.emit("biomeReset"))}catch{}}async updatePosition(t,r=!1){if(!this.allowPositionUpdate)return;let i=t.floored();if(!r&&this.lastPosCheck&&this.lastPosCheck.equals(i))return;this.lastPosCheck=i,this.updateBiome(t);let[s,o]=Mt(this.lastPos),[a,v]=Mt(t);if(s!==a||o!==v||r){this.emit("chunkPosUpdate",{pos:t});let l=[],c=r?this.viewDistance:this.viewDistance+this.keepChunksDistance;for(let h of Object.keys(this.loadedChunks)){let[p,g]=h.split(",").map(Number),y=new Z0(p,0,g),[A,b]=Mt(y),w=Math.abs(a-A),S=Math.abs(v-b);(w>c||S>c)&&l.push(y)}for(let h of l)this.unloadChunk(h);let u=c5(this.viewDistance).map(([h,p])=>{let g=new Z0((a+h)*16,0,(v+p)*16);if(!this.loadedChunks[`${g.x},${g.z}`])return g}).filter(h=>!!h);this.lastPos.update(t),this._loadChunks(u,t)}else this.emit("chunkPosUpdate",{pos:t}),this.lastPos.update(t)}};E();x();k();R();E();x();k();R();import $2 from"minecraft-data";import d6 from"mc-assets/dist/blocksAtlases.json";import u6 from"mc-assets/dist/itemsAtlases.json";import Pr from"mc-assets/dist/itemDefinitions.json";import f6 from"mc-assets/dist/blocksAtlasLatest.png";import h6 from"mc-assets/dist/blocksAtlasLegacy.png";import m6 from"mc-assets/dist/itemsAtlasLatest.png";import p6 from"mc-assets/dist/itemsAtlasLegacy.png";import g6 from"mc-assets/dist/textureReplacements/christmas";import{AtlasParser as et}from"mc-assets/dist/atlasParser";import q2 from"mc-assets/dist/worldBlockProvider";E();x();k();R();var Sr=o5(W2(),1);import*as a1 from"three";E();x();k();R();E();x();k();R();var s1=class{constructor(e,t,r){this.name=e,this.fg=t,this.bg=r,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(e,t,r,i,s=0){let o=1/0,a=0;this.context&&(o=Math.min(o,e),a=Math.max(r,e),i=Math.max(i,t),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(e.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-t/i)*this.GRAPH_HEIGHT))}};var j2=class o1{constructor({logsPerSecond:e=20,samplesLog:t=100,samplesGraph:r=10,precision:i=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 o1.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new o1.Panel("CPU","#0f0","#020"),1),this.gpuPanel=null,this.samplesLog=t,this.samplesGraph=r,this.precision=i,this.logsPerSecond=e,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(e,t){e.canvas.style.position="absolute",this.minimal?e.canvas.style.display="none":(e.canvas.style.display="block",this.horizontal?(e.canvas.style.top="0px",e.canvas.style.left=t*e.WIDTH/e.PR+"px"):(e.canvas.style.left="0px",e.canvas.style.top=t*e.HEIGHT/e.PR+"px"))}addPanel(e,t){return e.canvas&&(this.container.appendChild(e.canvas),this.resizePanel(e,t)),e}showPanel(e){for(let t=0;t<this.container.children.length;t++){let r=this.container.children[t];r.style.display=t===e?"block":"none"}this.mode=e}init(e){if(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext("webgl2"),!this.gl)return}else return;this.ext=this.gl.getExtension("EXT_disjoint_timer_query_webgl2"),this.ext&&(this.gpuPanel=this.addPanel(new o1.Panel("GPU","#ff0","#220"),2))}}begin(){if(this.beginProfiling("cpu-started"),!(!this.gl||!this.ext)){if(this.query){let e=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT_AVAILABLE);if(this.disjoint=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT),e&&!this.disjoint){this.ns=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT);let t=this.ns*1e-6;(e||this.disjoint)&&(this.gl.deleteQuery(this.query),this.query=null),e&&this.addToAverage(t,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 e=(performance||Date).now();if(e>=this.prevCpuTime+1e3/this.logsPerSecond&&(this.updatePanel(this.msPanel,this.averageCpu),this.updatePanel(this.gpuPanel,this.averageGpu),this.prevCpuTime=e),e>=this.prevTime+1e3){let t=this.frames*1e3/(e-this.prevTime);this.fpsPanel.update(t,t,100,100,0),this.prevTime=e,this.frames=0}return e}addToAverage(e,t){t.logs.push(e),t.logs.length>this.samplesLog&&t.logs.shift(),t.graph.push(e),t.graph.length>this.samplesGraph&&t.graph.shift()}beginProfiling(e){window.performance&&window.performance.mark(e)}endProfiling(e,t,r,i){if(window.performance&&t){window.performance.mark(t);let s=performance.measure(r,e,t);this.addToAverage(s.duration,i)}}updatePanel(e,t){if(t.logs.length>0){let r=0,i=.01;for(let a=0;a<t.logs.length;a++)r+=t.logs[a],t.logs[a]>i&&(i=t.logs[a]);let s=0,o=.01;for(let a=0;a<t.graph.length;a++)s+=t.graph[a],t.graph[a]>o&&(o=t.graph[a]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),s/Math.min(t.graph.length,this.samplesGraph),i,o,this.precision)}}};j2.Panel=s1;var Y2=j2;E();x();k();R();var He=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 e=1.70158;return n===1?1:n*n*((e+1)*n-e)},Out:function(n){var e=1.70158;return n===0?0:--n*n*((e+1)*n+e)+1},InOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)}}),Bounce:Object.freeze({In:function(n){return 1-He.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?He.Bounce.In(n*2)*.5:He.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(e){return Math.pow(e,n)},Out:function(e){return 1-Math.pow(1-e,n)},InOut:function(e){return e<.5?Math.pow(e*2,n)/2:(1-Math.pow(2-e*2,n))/2+.5}}}}),u5=function(){return performance.now()},Ct=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},n.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},n.prototype.update=function(e,t){e===void 0&&(e=u5()),t===void 0&&(t=!1);var r=Object.keys(this._tweens);if(r.length===0)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var s=this._tweens[r[i]],o=!t;s&&s.update(e,o)===!1&&!t&&delete this._tweens[r[i]]}r=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),St={Linear:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=St.Utils.Linear;return e<0?s(n[0],n[1],r):e>1?s(n[t],n[t-1],t-r):s(n[i],n[i+1>t?t:i+1],r-i)},Bezier:function(n,e){for(var t=0,r=n.length-1,i=Math.pow,s=St.Utils.Bernstein,o=0;o<=r;o++)t+=i(1-e,r-o)*i(e,o)*n[o]*s(r,o);return t},CatmullRom:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=St.Utils.CatmullRom;return n[0]===n[t]?(e<0&&(i=Math.floor(r=t*(1+e))),s(n[(i-1+t)%t],n[i],n[(i+1)%t],n[(i+2)%t],r-i)):e<0?n[0]-(s(n[0],n[0],n[1],n[1],-r)-n[0]):e>1?n[t]-(s(n[t],n[t],n[t-1],n[t-1],r-t)-n[t]):s(n[i?i-1:0],n[i],n[t<i+1?t:i+1],n[t<i+2?t:i+2],r-i)},Utils:{Linear:function(n,e,t){return(e-n)*t+n},Bernstein:function(n,e){var t=St.Utils.Factorial;return t(n)/t(e)/t(n-e)},Factorial:function(){var n=[1];return function(e){var t=1;if(n[e])return n[e];for(var r=e;r>1;r--)t*=r;return n[e]=t,t}}(),CatmullRom:function(n,e,t,r,i){var s=(t-n)*.5,o=(r-e)*.5,a=i*i,v=i*a;return(2*e-2*t+s+o)*v+(-3*e+3*t-2*s-o)*a+s*i+e}}},Q2=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),Tr=new Ct,Oe=function(){function n(e,t){t===void 0&&(t=Tr),this._object=e,this._group=t,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=He.Linear.None,this._interpolationFunction=St.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Q2.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(e,t){if(t===void 0&&(t=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=e,this._propertiesAreSetUp=!1,this._duration=t,this},n.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e,this},n.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},n.prototype.start=function(e,t){if(e===void 0&&(e=u5()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var s in this._valuesEnd)i[s]=this._valuesEnd[s];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},n.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},n.prototype._setupProperties=function(e,t,r,i,s){for(var o in r){var a=e[o],v=Array.isArray(a),l=v?"array":typeof a,c=!v&&Array.isArray(r[o]);if(!(l==="undefined"||l==="function")){if(c){var u=r[o];if(u.length===0)continue;for(var h=[a],p=0,g=u.length;p<g;p+=1){var y=this._handleRelativeValue(a,u[p]);if(isNaN(y)){c=!1;break}h.push(y)}c&&(r[o]=h)}if((l==="object"||v)&&a&&!c){t[o]=v?[]:{};var A=a;for(var b in A)t[o][b]=A[b];i[o]=v?[]:{};var u=r[o];if(!this._isDynamic){var w={};for(var b in u)w[b]=u[b];r[o]=u=w}this._setupProperties(A,t[o],u,i[o],s)}else(typeof t[o]>"u"||s)&&(t[o]=a),v||(t[o]*=1),c?i[o]=r[o].slice().reverse():i[o]=t[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(e){return e===void 0&&(e=u5()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},n.prototype.resume=function(e){return e===void 0&&(e=u5()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},n.prototype.group=function(e){return e===void 0&&(e=Tr),this._group=e,this},n.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},n.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},n.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},n.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},n.prototype.easing=function(e){return e===void 0&&(e=He.Linear.None),this._easingFunction=e,this},n.prototype.interpolation=function(e){return e===void 0&&(e=St.Linear),this._interpolationFunction=e,this},n.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},n.prototype.onStart=function(e){return this._onStartCallback=e,this},n.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},n.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},n.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},n.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},n.prototype.onStop=function(e){return this._onStopCallback=e,this},n.prototype.update=function(e,t){if(e===void 0&&(e=u5()),t===void 0&&(t=!0),this._isPaused)return!0;var r,i,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>s)return!1;t&&this.start(e,!0)}if(this._goToEnd=!1,e<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),i=(e-this._startTime)/this._duration,i=this._duration===0||i>1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=e+this._repeatDelayTime:this._startTime=e+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(e,t,r,i){for(var s in r)if(t[s]!==void 0){var o=t[s]||0,a=r[s],v=Array.isArray(e[s]),l=Array.isArray(a),c=!v&&l;c?e[s]=this._interpolationFunction(a,i):typeof a=="object"&&a?this._updateProperties(e[s],o,a,i):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(e[s]=o+(a-o)*i))}},n.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},n.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},n}();var Ic=Q2.nextId,g0=Tr,Hc=g0.getAll.bind(g0),Oc=g0.removeAll.bind(g0),Dc=g0.add.bind(g0),Fc=g0.remove.bind(g0),K2=g0.update.bind(g0);E();x();k();R();function Mr(n){if(n==="high-performance")return"high-performance";if(n==="low-power")return"low-power"}var ae=typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope,Cr=class{constructor(e,t=0){this.canvas=e;d(this,"stats");d(this,"stats2");d(this,"statsGl");d(this,"total",0);d(this,"denseMode");this.stats=new Sr.default,this.stats2=new Sr.default,this.statsGl=new Y2({minimal:!0}),this.stats2.showPanel(2),this.denseMode=typeof D<"u"&&!0||typeof window<"u"&&window.innerHeight<500,this.initStats(),this.setVisibility(t)}addStat(e,t=80){e.style.position="absolute",this.denseMode&&(e.style.height="12px"),e.style.overflow="hidden",e.style.left="",e.style.top="0",e.style.right=`${this.total}px`,e.style.width="80px",e.style.zIndex="1",e.style.opacity="0.8";let r=document.getElementById("corner-indicator-stats"),i=r??document.body;r&&(e.style.position="relative"),i.appendChild(e),this.total+=t}initStats(){let e=this.stats2.dom.children.length===3;this.addStat(this.stats.dom),e&&this.addStat(this.stats2.dom),this.statsGl.init(this.canvas),this.statsGl.container.style.display="flex",this.statsGl.container.style.justifyContent="flex-end";let t=0;for(let r of this.statsGl.container.children){let i=r;t++===0&&(i.style.display="none"),i.style.position=""}}setVisibility(e){e>0?(this.stats.dom.style.display="block",this.stats2.dom.style.display=e>=2?"block":"none",this.statsGl.container.style.display=e>=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()}},f5=class{constructor(e,t,r){this.initOptions=e;this.externalCanvas=t;d(this,"canvas");d(this,"renderer");d(this,"animationFrameId");d(this,"timeoutId");d(this,"lastRenderTime",0);d(this,"previousCanvasWidth",0);d(this,"previousCanvasHeight",0);d(this,"currentWidth",0);d(this,"currentHeight",0);d(this,"pendingResize",!1);d(this,"renderedFps",0);d(this,"fpsInterval");d(this,"stats");d(this,"paused",!1);d(this,"disconnected",!1);d(this,"preRender",()=>{});d(this,"render",e=>{});d(this,"postRender",()=>{});d(this,"sizeChanged",()=>{});d(this,"droppedFpsPercentage",0);d(this,"config");d(this,"onRender",[]);d(this,"inWorldRenderingConfig");d(this,"nonReactiveState");this.config=e.config,t?this.canvas=t:this.addToPage();try{let s=e.getRendererOptions?.()?.gpuPreference??"default";this.renderer=new a1.WebGLRenderer({canvas:this.canvas,preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0,powerPreference:Mr(s)})}catch(s){throw e.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=a1.LinearSRGBColorSpace,t||(this.updatePixelRatio(),this.setupResizeListener()),this.sizeUpdated(),this.previousCanvasWidth=this.canvas.width,this.previousCanvasHeight=this.canvas.height;let i="WebGL2RenderingContext"in globalThis;!t&&i&&!ae&&(this.stats=new Cr(this.canvas,this.config.statsVisible)),this.setupFpsTracking(),this.startRenderLoop()}setupResizeListener(){if(typeof window>"u")return;let e,t=()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.pendingResize=!0},16)};window.addEventListener("resize",t,{passive:!0})}updatePixelRatio(){if(typeof window>"u")return;let e=window.devicePixelRatio||1;this.renderer.capabilities.isWebGL2||(e=1),this.renderer.setPixelRatio(e)}sizeUpdated(){this.renderer.setSize(this.currentWidth,this.currentHeight,!1)}addToPage(){this.canvas=J2(),this.updateCanvasSize()}updateSizeExternal(e,t,r){this.currentWidth=e,this.currentHeight=t,this.renderer.setPixelRatio(r),this.sizeUpdated()}updateCanvasSize(){if(this.externalCanvas||typeof document>"u")return;let e=document.body.offsetWidth,t=document.body.offsetHeight;this.currentWidth!==e&&(this.currentWidth=e),this.currentHeight!==t&&(this.currentHeight=t)}setupFpsTracking(){let e=0;this.fpsInterval=setInterval(()=>{e>0&&(this.droppedFpsPercentage=this.renderedFps/e),e=Math.max(this.renderedFps,e),this.nonReactiveState&&(this.nonReactiveState.fps=this.renderedFps),this.renderedFps=0},1e3)}startRenderLoop(){let e=()=>{if(this.disconnected)return;if(this.config.timeoutRendering){let i=1e3/(this.config.fpsLimit?Math.min(this.config.fpsLimit,60):60);this.timeoutId=setTimeout(e,i)}else this.animationFrameId=requestAnimationFrame(e);if(this.paused||this.renderer.xr.isPresenting&&!this.inWorldRenderingConfig?.vrPageGameRendering)return;if(!this.config.timeoutRendering&&this.config.fpsLimit){let r=performance.now(),i=r-this.lastRenderTime,s=1e3/this.config.fpsLimit;if(i<s)return;this.lastRenderTime=r-i%s}let t=!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(),t=!0),this.frameRender(t),this.config.statsVisible!==void 0&&this.stats?.setVisibility(this.config.statsVisible)};e()}frameRender(e){this.preRender(),this.stats?.markStart(),K2(),globalThis.freezeRender||this.render(e);for(let t of this.onRender)t(e);this.renderedFps++,this.stats?.markEnd(),this.postRender()}setPaused(e){this.paused=e}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 J2(){let n=document.createElement("canvas");return n.id="viewer-canvas",document.body.appendChild(n),n}var Br=()=>{let n=J2(),e=n.transferControlToOffscreen(),t=!1,r=(o,a)=>{},i={width:0,height:0},s=()=>{t||((i.width!==window.innerWidth||i.height!==window.innerHeight)&&(r(window.innerWidth,window.innerHeight),i={width:window.innerWidth,height:window.innerHeight}),requestAnimationFrame(s))};return requestAnimationFrame(s),{canvas:e,destroy(){t=!0,n.remove()},onSizeChanged(o){r=o},get size(){return{width:window.innerWidth,height:window.innerHeight}}}};import{ItemsRenderer as Z2}from"mc-assets/dist/itemsRenderer";import{getLoadedItemDefinitionsStore as Ir}from"mc-assets/dist/stores";var v1=null;function es(n){return ae?((!v1||typeof v1.get!="function")&&(v1=Ir(Pr)),v1):(ts(n),n.itemsDefinitionsStore)}function ts(n){ae||typeof n.itemsDefinitionsStore?.get=="function"||(n.itemsDefinitionsStore=Ir(n.sourceItemDefinitionsJson??Pr))}var Bt=class{constructor(e){d(this,"sourceItemDefinitionsJson",Pr);d(this,"itemsDefinitionsStore",Ir(this.sourceItemDefinitionsJson));d(this,"allReady",!1);d(this,"itemsAtlasImage");d(this,"blocksAtlasImage");d(this,"blocksAtlasJson");d(this,"itemsAtlasJson");d(this,"customBlockStates");d(this,"customModels");d(this,"customItemModelNames",{});d(this,"customTextures",{});d(this,"guiAtlas",null);d(this,"guiAtlasVersion",0);d(this,"itemsRenderer");d(this,"worldBlockProvider");d(this,"blockstatesModels",null);d(this,"version");d(this,"texturesVersion");d(this,"mcData");if(e){let t={...e};delete t.itemsDefinitionsStore,delete t.sourceItemDefinitionsJson,Object.assign(this,t),ts(this)}if(this.version){let t=globalThis.loadedData??globalThis.mcData;ae&&t?.entitiesByName?this.mcData=t:this.mcData=$2(this.version)}}prepareForTransfer(){let e={};for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&typeof this[t]!="function"&&(t==="itemsRenderer"||t==="worldBlockProvider"||t==="mcData"||t==="itemsDefinitionsStore"||t==="sourceItemDefinitionsJson"||(e[t]=this[t]));return e.customTextures={},delete e.itemsDefinitionsStore,delete e.sourceItemDefinitionsJson,e}},X2="1.21.4",P0=class P0 extends q0{constructor(){super(...arguments);d(this,"sourceBlockStatesModels",null);d(this,"sourceBlocksAtlases",d6);d(this,"sourceItemsAtlases",u6);d(this,"currentResources");d(this,"itemsAtlasParser");d(this,"blocksAtlasParser");d(this,"currentConfig");d(this,"abortController",new AbortController);d(this,"_promiseAssetsReadyResolvers",Promise.withResolvers())}rebuildWorkerRenderers(t){if(ae&&!(!t.version||!t.blockstatesModels||!t.blocksAtlasJson)){if(this.blocksAtlasParser=new et({latest:t.blocksAtlasJson},""),t.itemsAtlasJson)this.itemsAtlasParser=new et({latest:t.itemsAtlasJson},"");else if(!this.itemsAtlasParser?.atlas?.latest){if(!this.sourceItemsAtlases||Object.keys(this.sourceItemsAtlases).length===0)return;this.itemsAtlasParser=new et(this.sourceItemsAtlases,"")}t.itemsRenderer=new Z2(t.version,t.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser),t.worldBlockProvider=q2(t.blockstatesModels,this.blocksAtlasParser.atlas,X2)}}static restoreTransferred(t,r){let i=new P0,s=o=>{i.currentResources=new Bt(o),i.rebuildWorkerRenderers(i.currentResources)};return s(t.currentResources),r&&r.addEventListener("message",({data:o})=>{o.class===P0.restorerName&&(o.type==="newResources"&&s(o.currentResources),o.type==="event"&&i.emit(o.eventName,...o.args))}),i}enrichTransferSnapshot(t){return t&&(this.itemsAtlasParser?.atlas?.latest&&(t.itemsAtlasJson=this.itemsAtlasParser.atlas.latest),this.blocksAtlasParser?.atlas?.latest&&(t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest),t)}prepareForTransfer(t){if(t){let r=this.emit.bind(this);this.emit=(i,...s)=>{if(r(i,...s),t.postMessage({class:P0.restorerName,type:"event",eventName:i,args:n1(s)}),i==="assetsTexturesUpdated"||i==="assetsInventoryReady"){let o=this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer());t.postMessage({class:P0.restorerName,type:"newResources",currentResources:o})}}}return{__restorer:P0.restorerName,currentResources:this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer())}}get promiseAssetsReady(){return this._promiseAssetsReadyResolvers.promise}async loadSourceData(t=this.currentConfig?.version){if(!t)throw new Error("No version loaded");this.sourceBlockStatesModels??(this.sourceBlockStatesModels=(await import("mc-assets/dist/blockStatesModels.json")).default)}resetResources(){this.currentResources=new Bt}async updateAssetsData(t,r=!1){if(!this.currentConfig)throw new Error("No config loaded");this._promiseAssetsReadyResolvers=Promise.withResolvers();let i=new AbortController;if(await this.loadSourceData(this.currentConfig.version),i.signal.aborted)return;let s=this.currentResources??new Bt;s.version=this.currentConfig.version,s.texturesVersion=this.currentConfig.texturesVersion??s.version,s.mcData=$2(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)]),!i.signal.aborted&&(s.version&&s.blockstatesModels&&this.itemsAtlasParser&&this.blocksAtlasParser&&(s.itemsRenderer=new Z2(s.version,s.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser)),!i.signal.aborted&&(this.currentResources=s,s.allReady=!0,r||this.emit("assetsTexturesUpdated"),this.currentConfig.noInventoryGui?this._promiseAssetsReadyResolvers.resolve():(this.emit("assetsInventoryStarted"),this.generateGuiTextures().then(()=>{i.signal.aborted||(r||this.emit("assetsInventoryReady"),this._promiseAssetsReadyResolvers.resolve())}))))}async recreateBlockAtlas(t=this.currentResources){let r={},i=new Date;(i.getMonth()===11&&i.getDate()>=24||i.getMonth()===0&&i.getDate()<=6)&&Object.assign(r,g6);let s=new et(this.sourceBlocksAtlases,f6,h6),o=Object.keys(t.customTextures.blocks?.textures??{}),{atlas:a,canvas:v}=await s.makeNewAtlas(t.texturesVersion,l=>{if(this.currentConfig.includeOnlyBlocks&&!this.currentConfig.includeOnlyBlocks.includes(l))return!1;let c=t.customTextures.blocks?.textures[l];return r[l]??c},void 0,void 0,o,{needHorizontalIndexes:!!this.currentConfig.includeOnlyBlocks});this.blocksAtlasParser=new et({latest:a},v.toDataURL()),t.blocksAtlasImage=await createImageBitmap(v),t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest,t.worldBlockProvider=q2(t.blockstatesModels,this.blocksAtlasParser.atlas,X2)}async recreateItemsAtlas(t=this.currentResources){let r=new et(this.sourceItemsAtlases,m6,p6),i=Object.keys(t.customTextures.items?.textures??{}),{atlas:s,canvas:o}=await r.makeNewAtlas(t.texturesVersion,a=>{let v=t.customTextures.items?.textures[a];if(v)return v},t.customTextures.items?.tileSize,void 0,i);this.itemsAtlasParser=new et({latest:s},o.toDataURL()),t.itemsAtlasImage=await createImageBitmap(o),t.itemsAtlasJson=this.itemsAtlasParser.atlas.latest}async generateGuiTextures(){}async downloadDebugAtlas(t=!1){if(!this.currentResources)throw new Error("No resources loaded");let s=await(t?this.itemsAtlasParser:this.blocksAtlasParser).createDebugImage(!0),o=document.createElement("a");o.href=s,o.download=`atlas-debug-${t?"items":"blocks"}.png`,o.click()}destroy(){this.abortController.abort(),this.currentResources=void 0,this.abortController=new AbortController}};d(P0,"restorerName","ResourcesManager");var h0=P0;E();x();k();R();var o0=class extends Error{constructor(t,r){super(t);d(this,"failure");this.name="MesherWorkerPreloadError",this.failure=r}};function b6(n){return!n||typeof n!="object"?!1:n.type==="mc-web-pong"?!0:Array.isArray(n)?n.some(e=>e&&typeof e=="object"&&e.type==="mc-web-pong"):!1}var y6=45e3,_6=1e4;async function rs(n){if(D.env.SINGLE_FILE_BUILD)return;let e=n?.fetchTimeoutMs??y6,t=n?.pingTimeoutMs??_6,r=n?.script??"mesher.js",i=new URL(r,document.baseURI).href,s;try{let u=new AbortController,h=window.setTimeout(()=>u.abort(),e);try{s=await fetch(i,{credentials:"same-origin",cache:"force-cache",signal:u.signal})}finally{clearTimeout(h)}}catch(u){let h=u;throw h?.name==="AbortError"?new o0(`Mesher script fetch timed out after ${e}ms (${i}).`,{phase:"fetch",code:"timeout"}):new o0(`Mesher script fetch failed (network): ${h?.message??u}. URL: ${i}`,{phase:"fetch",code:"network",detail:String(h?.message??u)})}if(!s.ok)throw new o0(`Mesher script HTTP ${s.status} ${s.statusText}: ${i}`,{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 o0(`Mesher script response was empty: ${i}`,{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 o0(`Mesher URL returned HTML (wrong path, redirect, or SPA fallback), not JavaScript: ${i}`,{phase:"fetch",code:"invalid-body",hint:"html"});o.length>0&&/javascript|ecmascript/i.test(o);let c;try{c=new Worker(i)}catch(u){let h=u instanceof Error?u.message:String(u);throw new o0(`Could not construct Worker for mesher (${i}): ${h}`,{phase:"worker",code:"construct-failed",message:h})}await new Promise((u,h)=>{let p=!1,g=window.setTimeout(()=>{p||(p=!0,y(),h(new o0(`Mesher worker did not reply with mc-web-pong within ${t}ms (wrong script, SW stale cache, worker blocked, or COEP/CORP). URL: ${i}`,{phase:"ping",code:"timeout"})))},t),y=()=>{clearTimeout(g);let M=c;c=void 0,M&&(M.removeEventListener("message",w),M.removeEventListener("error",S),M.removeEventListener("messageerror",C),M.terminate())},A=()=>{p||(p=!0,y(),u())},b=M=>{p||(p=!0,y(),h(M))};function w(M){b6(M.data)&&A()}function S(M){b(new o0(`Mesher worker script failed to load or threw during startup: ${M.message||"unknown"} @ ${i}`,{phase:"worker",code:"script-error",message:M.message}))}function C(){b(new o0(`Mesher worker message channel error (structured clone / deserialization). URL: ${i}`,{phase:"ping",code:"messageerror"}))}c.addEventListener("message",w),c.addEventListener("error",S),c.addEventListener("messageerror",C);try{c.postMessage({type:"mc-web-ping",t:performance.now(),workerIndex:0})}catch(M){let I=M instanceof Error?M.message:String(M);b(new o0(`Failed to post mc-web-ping to mesher worker: ${I}`,{phase:"ping",code:"post-failed",detail:I}))}})}var ns=class{constructor(e={},t=new h0){this.resourcesManager=t;d(this,"waitBackendLoadPromises",[]);d(this,"onWorldStart");d(this,"onBeforeWorldStart");d(this,"worldView");d(this,"config");d(this,"menuBackgroundOptions");d(this,"inWorldRenderingConfig");d(this,"backend");d(this,"backendLoader");d(this,"currentState");d(this,"currentDisplay",null);d(this,"playerState",{reactive:Er()});d(this,"rendererState");d(this,"nonReactiveState");d(this,"worldReady");d(this,"resolveWorldReady");d(this,"lastCamUpdate",0);d(this,"getRendererOptions");this.config={...L2,...e.config},this.menuBackgroundOptions={...e.config?.menuBackground,...e.menuBackground},this.inWorldRenderingConfig=is({...l5,...e.rendererConfig});let r=J0();this.rendererState=r.reactive,this.nonReactiveState=r.nonReactive,this.initWorldReadyPromise()}initWorldReadyPromise(){let{promise:e,resolve:t}=Promise.withResolvers();this.worldReady=e,this.resolveWorldReady=t}preloadWorkers(){let e=this.inWorldRenderingConfig.wasmMesher?"mesherWasm.js":"mesher.js";return rs({script:e})}bindRendererOptions(e){this.getRendererOptions=e}async loadBackend(e){this.backend&&this.disconnectBackend(),await Promise.all(this.waitBackendLoadPromises),this.waitBackendLoadPromises=[],this.backendLoader=e;let t={config:this.config,getRendererOptions:this.getRendererOptions,callbacks:{displayCriticalError:i=>{},setRendererSpecificSettings:(i,s)=>{},fireCustomEvent:(i,...s)=>{}},rendererSpecificSettings:{}},r=e(t);if(this.backend=await Promise.resolve(r),this.currentState)if(this.currentState.method==="startMenuBackground")this.startMenuBackground(...this.currentState.args);else{let{method:i,args:s}=this.currentState;this.backend[i](...s)}}async startWorld(e,t,r=this.playerState.reactive,i){if(this.currentDisplay==="world")throw new Error("World already started");this.currentDisplay="world";let s=i??new w6(0,64,0);this.worldView=new $0(e,t,s),this.worldView.isPlayground=this.inWorldRenderingConfig.isPlayground;let o={version:this.resourcesManager?.currentConfig?.version??"1.20.4",worldView:this.worldView,inWorldRenderingConfig:this.inWorldRenderingConfig,playerStateReactive:r,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(e){if(this.currentDisplay==="menu")return;let t={...this.menuBackgroundOptions,...e,resourcesManager:e?.resourcesManager??this.resourcesManager};this.backend&&(this.currentDisplay="menu",this.backend.startMenuBackground(t)),this.currentState={method:"startMenuBackground",args:[t]}}resetBackend(e=!1){this.disconnectBackend(e),this.backendLoader&&this.loadBackend(this.backendLoader)}disconnectBackend(e=!1){e&&(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=is(J0().reactive),this.nonReactiveState=J0().nonReactive}updateCamera(e,t,r){this.backend?.updateCamera(e,t,r)}setRendering(e){this.backend?.setRendering(e)}async startWithBot(e,t){await this.startWorld(e.world,t),this.worldView&&typeof this.worldView.listenToBot=="function"&&this.worldView.listenToBot(e)}destroyAll(){this.disconnectBackend(!0),this.resourcesManager&&typeof this.resourcesManager.destroy=="function"&&this.resourcesManager.destroy()}get utils(){let e=this.backend;return{async waitingForChunks(){if(!e?.worldState?.allChunksLoaded)return new Promise(t=>{let r=setInterval(()=>{e?.worldState?.allChunksLoaded&&(clearInterval(r),t())},100)})}}}destroy(){this.disconnectBackend(!0)}};E();x();k();R();import{subscribe as P6}from"valtio/vanilla";E();x();k();R();E();x();k();R();var tt=["galaxy","nether","end","cyber","light"],rt=["cruise","barrel","dive","orbit","snake"],h5={galaxy:"Galaxy",nether:"Nether",end:"The End",cyber:"Cyber",light:"Light Space"},m5={cruise:"Cruise",barrel:"Barrel",dive:"Dive",orbit:"Orbit",snake:"Snake"},it=["mixed","stainedGlass","wool","construction","glow","world"],p5={mixed:"Mixed",stainedGlass:"Stained glass",wool:"Wool",construction:"Construction",glow:"Glow",world:"World (grass & ores)"};E();x();k();R();var b0={mode:"v2",minecraftTextures:!0,v2Scene:"light",v2Camera:"dive",v2BlockGroup:"stainedGlass",v2CameraSpeedPercent:80,v2BlockSpeedPercent:40},E0=n=>n/100,g5={camera:E0(b0.v2CameraSpeedPercent),block:E0(b0.v2BlockSpeedPercent)};var A6={off:0,holes:1,texIndex:2,faces:3,atlasAlpha:4};function Hr(n){return A6[n]}var nt=b0,ss={rendererWorldPerformance:"normal",rendererMeshersCountOverride:null,starfieldRendering:!0,defaultSkybox:!0,menuBackgroundMode:nt.mode,menuBackgroundMinecraftTextures:nt.minecraftTextures,menuBackgroundV2Scene:nt.v2Scene,menuBackgroundV2Camera:nt.v2Camera,menuBackgroundV2BlockGroup:nt.v2BlockGroup,menuBackgroundV2CameraSpeed:nt.v2CameraSpeedPercent,menuBackgroundV2BlockSpeed:nt.v2BlockSpeedPercent,rendererFuturisticReveal:!1,rendererPerfDebugOverlay:!1,disableBlockEntityTextures:!1,rendererMesher:"wasm",rendererShaderCubeBlocks:!1,rendererShaderCubeDebugMode:"off",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",fov:75};function E6(n){n.highPerformanceGpu&&(n.gpuPreference="high-performance",delete n.highPerformanceGpu),n.rendererMesher!=="wasm"&&n.rendererMesher!=="legacy-js"&&(typeof n.rendererWasmMesher=="boolean"?n.rendererMesher=n.rendererWasmMesher?"wasm":"legacy-js":typeof n.wasmExperimentalMesher=="boolean"&&(n.rendererMesher=n.wasmExperimentalMesher?"wasm":"legacy-js")),delete n.wasmExperimentalMesher,delete n.rendererWasmMesher,n.menuBackgroundMode==="futuristic"&&(n.menuBackgroundMode="v2");let e=[["menuBackgroundFuturisticScene","menuBackgroundV2Scene"],["menuBackgroundFuturisticCamera","menuBackgroundV2Camera"],["menuBackgroundFuturisticBlockGroup","menuBackgroundV2BlockGroup"],["menuBackgroundFuturisticCameraSpeed","menuBackgroundV2CameraSpeed"],["menuBackgroundFuturisticBlockSpeed","menuBackgroundV2BlockSpeed"]];for(let[t,r]of e)n[t]!==void 0&&n[r]===void 0&&(n[r]=n[t]),delete n[t]}var os={menuBackgroundMode:{possibleValues:[["classic","Classic"],["v2","V2"]],requiresRestart:!0},menuBackgroundMinecraftTextures:{text:"Minecraft block textures",tooltip:"Use block atlas on V2 menu cubes (loads assets on menu)"},menuBackgroundV2Scene:{possibleValues:tt.map(n=>[n,h5[n]])},menuBackgroundV2Camera:{possibleValues:rt.map(n=>[n,m5[n]])},menuBackgroundV2BlockGroup:{possibleValues:it.map(n=>[n,p5[n]]),text:"Block pool",tooltip:"Block set for textured menu cubes (requires Minecraft textures)"},menuBackgroundV2CameraSpeed:{text:"Camera speed",tooltip:"Orbit / fly-through camera path speed. 0 freezes the path; mouse parallax still works.",min:0,max:200,unit:"%"},menuBackgroundV2BlockSpeed:{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},rendererShaderCubeBlocks:{text:"Instanced shader cubes",tooltip:"Render full blocks through the global GPU instanced path. Requires WASM mesher and WebGL2.",requiresChunksReload:!0},rendererShaderCubeDebugMode:{text:"Shader cube debug",tooltip:"Instanced cube path visualization (requires shader cubes enabled).",possibleValues:[["off","Off"],["holes","Hole test (red)"],["texIndex","Tile index colors"],["faces","Face id colors"],["atlasAlpha","Atlas alpha"]]},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:""},fov:{min:30,max:110,unit:"\xB0",text:"FOV"},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"]]}},as=[{title:"World rendering",keys:["rendererWorldPerformance","starfieldRendering","defaultSkybox","disableBlockEntityTextures","showChunkBorders","renderEntities","smoothLighting","vanillaLook","newVersionsLighting","dayCycleAndLighting","loadPlayerSkins","renderEars","showHand","viewBobbing","fov","keepChunksDistance","highlightBlockColor","clipWorldBelowY"]},{title:"Frame pacing",keys:["frameLimit","backgroundRendering","renderDebug","gpuPreference"]},{title:"VR",keys:["vrSupport","vrPageGameRendering"]},{title:"Menu background",keys:["menuBackgroundMode","menuBackgroundMinecraftTextures","menuBackgroundV2Scene","menuBackgroundV2Camera","menuBackgroundV2BlockGroup","menuBackgroundV2CameraSpeed","menuBackgroundV2BlockSpeed"]},{title:"Mesher",keys:["rendererMesher","rendererShaderCubeBlocks"]},{title:"Renderer debug",keys:["rendererFuturisticReveal","rendererPerfDebugOverlay","rendererShaderCubeDebugMode"]}];E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();function Or(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let a=0;a<i;a++){let v=(o+a*r)*4;if(s.data[v+3]!==255)return!0}return!1}function l1(n){return n/64}function vs(n,e,t){if(t){if(Or(n,0,0,e,e))return}else if(Or(n,0,0,e,e/2))return;let r=l1(e),i=(s,o,a,v)=>n.clearRect(s*r,o*r,a*r,v*r);i(40,0,8,8),i(48,0,8,8),i(32,8,8,8),i(40,8,8,8),i(48,8,8,8),i(56,8,8,8),t&&(i(4,32,4,4),i(8,32,4,4),i(0,36,4,12),i(4,36,4,12),i(8,36,4,12),i(12,36,4,12),i(20,32,8,4),i(28,32,8,4),i(16,36,4,12),i(20,36,8,12),i(28,36,4,12),i(32,36,8,12),i(44,32,4,4),i(48,32,4,4),i(40,36,4,12),i(44,36,4,12),i(48,36,4,12),i(52,36,12,12),i(4,48,4,4),i(8,48,4,4),i(0,52,4,12),i(4,52,4,12),i(8,52,4,12),i(12,52,4,12),i(52,48,4,4),i(56,48,4,4),i(48,52,4,12),i(52,52,4,12),i(56,52,4,12),i(60,52,4,12))}function x6(n,e){n.save(),n.scale(-1,1);let t=l1(e),r=(i,s,o,a,v,l)=>n.drawImage(n.canvas,i*t,s*t,o*t,a*t,-v*t,l*t,-o*t,a*t);r(4,16,4,4,20,48),r(8,16,4,4,24,48),r(0,20,4,12,24,52),r(4,20,4,12,20,52),r(8,20,4,12,16,52),r(12,20,4,12,28,52),r(44,16,4,4,36,48),r(48,16,4,4,40,48),r(40,20,4,12,40,52),r(44,20,4,12,36,52),r(48,20,4,12,32,52),r(52,20,4,12,44,52),n.restore()}function Dr(n,e){let t=!1;if(e.width!==e.height)if(e.width===2*e.height)t=!0;else throw new Error(`Bad skin size: ${e.width}x${e.height}`);let r=n.getContext("2d",{willReadFrequently:!0});if(t){let i=e.width;n.width=i,n.height=i,r.clearRect(0,0,i,i),r.drawImage(e,0,0,i,i/2),x6(r,i),vs(r,n.width,!1)}else n.width=e.width,n.height=e.height,r.clearRect(0,0,e.width,e.height),r.drawImage(e,0,0,n.width,n.height),vs(r,n.width,!0)}function R6(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 Fr(n,e){let t=R6(e);n.width=64*t,n.height=32*t;let r=n.getContext("2d",{willReadFrequently:!0});r.clearRect(0,0,n.width,n.height),r.drawImage(e,0,0,e.width,e.height)}function k6(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let a=0;a<i;a++){let v=(o+a*r)*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 T6(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let a=0;a<i;a++){let v=(o+a*r)*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 zr(n){let e=l1(n.width),t=n.getContext("2d",{willReadFrequently:!0}),r=(a,v,l,c)=>Or(t,a*e,v*e,l*e,c*e),i=(a,v,l,c)=>k6(t,a*e,v*e,l*e,c*e),s=(a,v,l,c)=>T6(t,a*e,v*e,l*e,c*e);return r(50,16,2,4)||r(54,20,2,12)||r(42,48,2,4)||r(46,52,2,12)||i(50,16,2,4)&&i(54,20,2,12)&&i(42,48,2,4)&&i(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 Lr(n,e){if(e.width!==e.height&&e.width!==2*e.height)throw new Error(`Bad skin size: ${e.width}x${e.height}`);let t=l1(e.width),r=14*t,i=7*t;n.width=r,n.height=i;let s=n.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,r,i),s.drawImage(e,24*t,0,r,i,0,0,r,i)}E();x();k();R();import C6 from"mc-assets/dist/other-textures/latest/entity/player/wide/steve.png";E();x();k();R();import*as m0 from"three";E();x();k();R();var M6=()=>{if(typeof OffscreenCanvas>"u")return!1;try{let n=new OffscreenCanvas(1,1);return(n.getContext("webgl2")||n.getContext("webgl"))!==null}catch{return!1}},S6=M6(),We=(n,e)=>{if(S6||typeof document>"u")return new OffscreenCanvas(n,e);let t=document.createElement("canvas");return t.width=n,t.height=e,t};async function st(n){let t=await(await fetch(n)).blob();return createImageBitmap(t)}var Re=(n,e=!1)=>{n instanceof m0.Mesh&&(n.geometry?.dispose?.(),n.material?.dispose?.()),n.children&&n.children.forEach(t=>Re(t,e)),e&&n instanceof m0.Mesh&&n.material?.map?.dispose?.()},Ur={},ls={},b5=n=>{let e=new m0.Texture,t=st(n).then(r=>{let i=new OffscreenCanvas(r.width,r.height);return i.getContext("2d").drawImage(r,0,0),e.source.data=i,e.needsUpdate=!0,e});return{texture:e,promise:t}},Pt=async n=>b5(n).texture,I0=n=>{let e=We(n.width,n.height);e.getContext("2d").drawImage(n,0,0);let r=new m0.Texture(e);return r.magFilter=m0.NearestFilter,r.minFilter=m0.NearestFilter,r};function It(n){let{texture:e,promise:t}=b5(n);return e.magFilter=m0.NearestFilter,e.minFilter=m0.NearestFilter,t.catch(r=>{}),e}async function c1(n,e,t){if(!Ur[n]){let{promise:i,resolve:s}=Promise.withResolvers(),o=b5(n);Ur[n]=o.texture,o.promise.then(s),ls[n]=i}e(Ur[n]),ls[n].then(()=>{t?.()})}var $e=C6,rf=Pt($e),cs={apiEnabled:!0},d1=n=>{Object.assign(cs,n)};async function H0(n,e){if(!cs.apiEnabled||e==="cape")return;let t=`https://playerdb.co/api/player/minecraft/${n}`,r=await fetch(t);return r.ok?(await r.json()).data.player.skin_texture:void 0}async function y0(n){n.startsWith("data:")||(n=await B6(n.replace("http://","https://")));let e=await st(n),t=We(64,64);return Dr(t,e),{canvas:t,image:e}}var B6=async n=>{let t=await(await fetch(n,{})).arrayBuffer();return`data:image/png;base64,${z.from(t).toString("base64")}`};function ff(n){return{mode:n.menuBackgroundMode,useMinecraftTextures:n.menuBackgroundMinecraftTextures,v2Scene:n.menuBackgroundV2Scene,v2Camera:n.menuBackgroundV2Camera,v2BlockGroup:n.menuBackgroundV2BlockGroup,v2CameraSpeed:E0(n.menuBackgroundV2CameraSpeed),v2BlockSpeed:E0(n.menuBackgroundV2BlockSpeed)}}function I6(n,e){let t=n.v2;t&&(t.setScene?.(e.menuBackgroundV2Scene),t.setCamera?.(e.menuBackgroundV2Camera),t.setBlockGroup?.(e.menuBackgroundV2BlockGroup),t.setCameraSpeed?.(E0(e.menuBackgroundV2CameraSpeed)),t.setBlockSpeed?.(E0(e.menuBackgroundV2BlockSpeed)))}function H6(n){return n.rendererMesher!=="legacy-js"}function O6(n,e,t){let r=n.inWorldRenderingConfig,i=e.rendererMeshersCountOverride,s=o=>{r.mesherWorkers=i??o};switch(e.rendererWorldPerformance){case"low-energy":s(1),r.dedicatedChangeWorker=!1;break;case"normal":s(2),r.dedicatedChangeWorker=!t;break;case"maximum":s(Math.max(3,Math.min(navigator.hardwareConcurrency??0,8))),r.dedicatedChangeWorker=!t;break}}function D6(n,e,t){let r=e.backgroundRendering,i=e.frameLimit;t?n.config.fpsLimit=i||void 0:r==="5fps"?n.config.fpsLimit=5:r==="20fps"?n.config.fpsLimit=20:n.config.fpsLimit=void 0}function F6(n,e,t){let{renderDebug:r}=e;r==="none"||t.isCypress?n.config.statsVisible=0:r==="basic"?n.config.statsVisible=1:r==="advanced"&&(n.config.statsVisible=2)}function z6(n,e,t={}){let r=n.inWorldRenderingConfig,i=H6(e);r.showChunkBorders=e.showChunkBorders,r.futuristicReveal=e.rendererFuturisticReveal,O6(n,e,i),r.renderEntities=e.renderEntities,F6(n,e,t),D6(n,e,t.windowFocused!==!1),r.vrSupport=e.vrSupport,r.vrPageGameRendering=e.vrPageGameRendering,r.enableDebugOverlay=e.rendererPerfDebugOverlay,r.clipWorldBelowY=e.clipWorldBelowY,r.extraBlockRenderers=!e.disableBlockEntityTextures,r.fetchPlayerSkins=e.loadPlayerSkins,r.highlightBlockColor=e.highlightBlockColor,r.wasmMesher=i,r.shaderCubeBlocks=e.rendererShaderCubeBlocks&&i,r.disableMesherConversionCache=!!t.isSafari,d1({apiEnabled:e.loadPlayerSkins}),r.smoothLighting=e.smoothLighting,r.shadingTheme=e.vanillaLook?"vanilla":"high-contrast",r.starfield=e.starfieldRendering,r.defaultSkybox=e.defaultSkybox,r.fov=e.fov,r.shaderCubeDebugMode=Hr(e.rendererShaderCubeDebugMode)}function hf(n,e,t){e.keepChunksDistance=t.keepChunksDistance;let r=n.inWorldRenderingConfig;r.renderEars=t.renderEars,r.showHand=t.showHand,r.viewBobbing=t.viewBobbing,r.dayCycle=t.dayCycleAndLighting}function mf(n,e,t={}){n.bindRendererOptions(()=>e);let r=t.getWindowFocused?.()??!0,i=()=>{let s=e;if(z6(n,s,{isSafari:t.isSafari,isCypress:t.isCypress,windowFocused:r}),n.currentDisplay==="menu"){let o=n.backend?.getMenuBackground?.();o&&I6(o,s)}};return i(),t.onRegisterFocusHandlers?.({onFocus:()=>{r=!0,i()},onBlur:()=>{r=!1,i()}}),P6(e,i)}function pf(n,e,t){n.inWorldRenderingConfig.enableLighting=!t||e}E();x();k();R();import{proxy as L6}from"valtio";var ds=()=>L6({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,fovMultiplier:1,cameraSpectatingEntity:void 0,team:void 0}),U6=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"}}),G6=()=>({reactive:ds()}),us=(n,e,t)=>({...e,"minecraft:date":new Date});E();x();k();R();E();x();k();R();import*as Y5 from"three";import{Vec3 as v9}from"vec3";E();x();k();R();import{proxy as V6,getVersion as Nr,subscribe as ms}from"valtio";import{Vec3 as Wr}from"vec3";function ps(n,e){let t=e??globalThis;return t.addEventListener("message",r=>{let{type:i,args:s,msgId:o}=r.data;if(n[i]){let a=n[i](...s);a instanceof Promise&&a.then(v=>{t.postMessage({type:"result",msgId:o,args:[v]})})}}),null}var gs=(n,e=!0)=>{let t=0;return new Proxy({},{get(r,i){return i==="transfer"?(...s)=>new Proxy({},{get(o,a){return(...v)=>{n.postMessage({type:a,args:v},s)}}}):(...s)=>{let o=t++,a=e?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:i,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)}}}}})},bs=!1,y5={toWorker:0,fromWorker:0},fs=null,N6=()=>{fs==null&&(typeof window>"u"||(fs=setInterval(()=>{globalThis.debugWorkerSyncStats={...y5},y5.toWorker=0,y5.fromWorker=0},1e3)))},u1=n=>{N6(),n==="toWorker"?y5.toWorker++:y5.fromWorker++};var W6=()=>Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15),j6=(n,e,t)=>{if(e.length===0)return;let r=n;for(let i=0;i<e.length-1;i++){let s=e[i];(r[s]==null||typeof r[s]!="object")&&(r[s]={}),r=r[s]}r[e[e.length-1]]=t},Y6=(n,e)=>{if(e.length===0)return;let t=n;for(let r=0;r<e.length-1;r++)if(t=t[e[r]],t==null)return;delete t[e[e.length-1]]},Vr=(n,e)=>{if(n==null||typeof n!="object")return n;if(n instanceof Wr)return{x:n.x,y:n.y,z:n.z,__restorer:"Vec3"};if(typeof n.prepareForTransfer=="function")return n.prepareForTransfer(e);if(ArrayBuffer.isView(n))return n;if(Array.isArray(n))return n.map(r=>Vr(r,e));if(Nr(n)!==void 0)return _5(n);let t={};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=Vr(n[r],e));return t},Q6=(n,e)=>{let t=[];for(let r of n){let i=r[0];i==="delete"?t.push({kind:"delete",path:r[1]}):i==="set"&&t.push({kind:"set",path:r[1],value:Vr(r[2],e)})}return t},ys=(n,e,t,r,i)=>{if(e.length===0)return;let s=Q6(e,t);if(s.length!==0)try{t.postMessage({type:"sync",syncId:n,ops:s}),r==="toWorker"&&u1("toWorker")}catch{for(let a of s)a.kind==="set"&&ot(a.value)}},_s=(n,e,t,r=!1)=>{for(let i of e)i.kind==="delete"?Y6(n,i.path):j6(n,i.path,A5(i.value,[],t,!1,!1));r==="fromWorker"&&u1("fromWorker")},ws=(n,e,t,r,i)=>{try{let s=_5(e);t.postMessage({type:"sync",syncId:n,value:s}),r==="toWorker"&&u1("toWorker")}catch{ot(e)}},As=(n,e,t,r=!1)=>{Object.assign(n,A5(e,[],t,!1,!1)),r==="fromWorker"&&u1("fromWorker")},Gr=(n,e,t,r,i)=>{let s=n.__syncFromWorker||e.__syncFromWorker,o=n.__syncToWorker||e.__syncToWorker;if(!o&&!s&&!r)return;let a=W6();if(n.__syncId=a,o||r){r&&o!==!1&&ms(e,l=>{ys(a,l,t,"toWorker",`toWorker:${i}`)});let v=n.__syncToWorkerInterval??e.__syncToWorkerInterval??0;v>0&&!r&&setInterval(()=>{ws(a,e,t,"toWorker",`toWorker:interval:${i}`)},v)}e.__syncFromWorker&&t.addEventListener("message",v=>{v.data.type==="sync"&&v.data.syncId===a&&(v.data.ops?_s(e,v.data.ops,t,"fromWorker"):v.data.value&&As(e,v.data.value,t,"fromWorker"))})},_5=n=>{if(Nr(n)===void 0)return n;if(Array.isArray(n))return n.map(_5);if(typeof n=="object"&&n!==null){let e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=_5(n[t]));return e}return n},w5=(n,e,t=!0,r=!0,i=!1)=>{var a,v;let s=n,o={};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){if(t&&typeof n[l]=="function")continue;if(n[l]instanceof Date||n[l]instanceof RegExp||n[l]instanceof Map||n[l]instanceof Set||n[l]instanceof WeakMap||n[l]instanceof WeakSet,n[l]instanceof Wr){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(e);continue}let c=Nr(n[l])!==void 0;o[l]=c?_5(n[l]):n[l],n[l].__syncFromWorker&&(o[l].__syncFromWorker=!0),n[l].__syncToWorker&&(o[l].__syncToWorker=!0),n[l].__syncFromWorkerInterval&&(o[l].__syncFromWorkerInterval=n[l].__syncFromWorkerInterval),n[l].__syncToWorkerInterval&&(o[l].__syncToWorkerInterval=n[l].__syncToWorkerInterval);let u=n[l].__syncToWorker!==!1&&!i&&c&&!n[l].__syncFromWorker;if((a=o[l]).__syncToWorker??(a.__syncToWorker=u),c&&((v=o[l]).__valtio??(v.__valtio=!0)),o[l].__syncToWorker&&c){Gr(o[l],s[l],e,!0,l);continue}if(o[l].__syncFromWorker||o[l].__syncToWorker){Gr(o[l],s[l],e,c,l);continue}Gr(o[l],s[l],e,!1,l),o[l]=w5(o[l],e,t,!1,c)}}return o},ot=(n,e=[])=>{for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(!n[t])continue;typeof n[t]=="object"&&n[t]!==null&&ot(n[t],[...e,t]);try{structuredClone(n[t])}catch{}}},hs=new WeakMap,K6=(n,e,t)=>{if(!n.__syncId)return;let r=n.__syncId,i=hs.get(e);if(i||(i=new Set,hs.set(e,i)),!i.has(r)&&(i.add(r),n.__syncToWorker&&e.addEventListener("message",s=>{s.data.type==="sync"&&s.data.syncId===r&&(s.data.ops?_s(n,s.data.ops,e):s.data.value&&As(n,s.data.value,e))}),n.__syncFromWorker)){n.__valtio&&ms(n,o=>{ys(r,o,e,"fromWorker",`fromWorker:${t}`)});let s=n.__syncFromWorkerInterval??0;s>0&&!n.__valtio&&setInterval(()=>{ws(r,n,e,"fromWorker",`fromWorker:interval:${t}`)},s)}},J6=[{restorerName:"Vec3",restoreTransferred(n,e){return new Wr(n.x,n.y,n.z)}}];var A5=(n,e,t,r=!0,i=!0)=>{let s=[...J6,...e],o=(a,v)=>{if(a==null||typeof a!="object")return a;if(a.__restorer){let l=s.find(u=>u.restorerName?u.restorerName===a.__restorer:u.name===a.__restorer);if(l)return l.restoreTransferred(a,t);let c=new Error(`Restorer ${a.__restorer} not found`);if(typeof r=="function")r(c);else if(r)throw c;return a}if(Array.isArray(a))return a.map((l,c)=>o(l,`${v}[${c}]`));for(let l in a){if(!Object.prototype.hasOwnProperty.call(a,l))continue;let c=a[l];c!=null&&typeof c=="object"&&(a[l]=o(c,`${v}.${l}`))}return a.__valtio&&(a=V6(a)),i&&K6(a,t,v),a};return o(n,"root")};E();x();k();R();var f1=class{constructor(e){this.nonReactiveState=e;d(this,"events",[]);d(this,"frozenEvents",[]);d(this,"lastSecondEvents",[]);d(this,"currentFrameStartTime",null);d(this,"lastInteractionTime",0);d(this,"lastSecondUpdateTime",0);d(this,"timeWindowMs",5e3);d(this,"lastSecondWindowMs",1e3);d(this,"maxEvents",500);d(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 e=performance.now(),t=e-this.currentFrameStartTime;this.addEvent({type:"frameEnd",timestamp:e,duration:t}),this.currentFrameStartTime=null}markCameraUpdate(e){if(!e)return;let t=performance.now();this.lastInteractionTime=t,this.addEvent({type:"cameraUpdate",timestamp:t}),this.frozenEvents=[...this.events],this.trimEvents(this.frozenEvents),this.syncFrozenEvents()}markFrameDisplay(){this.addEvent({type:"frameDisplay",timestamp:performance.now()})}addEvent(e){this.events.push(e),this.lastSecondEvents.push(e),this.trimEvents(this.events),this.trimLastSecondEvents(),this.syncLiveEvents()}trimEvents(e){let r=performance.now()-this.timeWindowMs;for(;e.length>0&&e[0].timestamp<r;)e.shift();e.length>this.maxEvents&&e.splice(0,e.length-this.maxEvents)}trimLastSecondEvents(){let t=performance.now()-this.lastSecondWindowMs;for(;this.lastSecondEvents.length>0&&this.lastSecondEvents[0].timestamp<t;)this.lastSecondEvents.shift()}updateLastSecondTimeline(){let e=performance.now();e-this.lastSecondUpdateTime<this.lastSecondUpdateInterval||(this.lastSecondUpdateTime=e,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()}};E();x();k();R();import*as Q from"three";import{Vec3 as G0}from"vec3";import $v from"prismarine-chat";E();x();k();R();var q6=(n,e)=>{try{return JSON.parse(n)}catch{return null}},Z6={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"},h1=(n,e,t,r=s=>{},i=(s,o)=>We(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 u=i(16*40,v*40),h=u.getContext("2d");r(h);let p=("front_text"in n?n.front_text.color:n.Color)||"black";for(let[g,y]of c.slice(0,4).entries())y!=="null"&&jr(y,t,u,64,p,64*(g+1)+(e?0:-8));return u},jr=(n,e,t,r,i,s=0)=>{let o=!1,a=typeof n=="string"&&(n?.startsWith("{")||n?.startsWith('"'))?q6(n??'""',"sign text"):n;if(!a||typeof a!="object"&&typeof a!="string")return;let v=t.getContext("2d");if(!v)throw new Error("Could not get 2d context");v.imageSmoothingEnabled=!1,v.font=`${r}px mojangles`;let l=new e(a),c=[],u=!1,h="",p=s,g=[],y=(S,C)=>{S.text!==null&&S.text!==void 0&&S.text;let M=S.text===null||S.text===void 0?void 0:String(S.text),I={color:S.color??C?.color,underlined:S.underlined??C?.underlined,strikethrough:S.strikethrough??C?.strikethrough,bold:S.bold??C?.bold,italic:S.italic??C?.italic};if(u=u||I.underlined||I.strikethrough||!1,M?.includes(`
|
|
286
286
|
`))for(let B of M.split(`
|
|
287
|
-
`))A(B,P),p+=r,f="";else M&&A(M,P);if(S.extra)for(let B of S.extra)y(B,P)},A=(S,C)=>{o||(o=S.trim()!==""),f+=S,g[p]=a.measureText(f).width;let M=C.color??i;M.startsWith("#")||(M=i7[M.toLowerCase()]||M),c.push({fontStyle:`${C.bold?"bold":""} ${C.italic?"italic":""}`,fillStyle:M,underlineStyle:C.underlined??!1,strikeStyle:C.strikethrough??!1,offset:p,text:S})};if(y(l),!u&&!l.toString().trim())return;let b=0,_=0;for(let{fillStyle:S,fontStyle:C,underlineStyle:M,strikeStyle:P,offset:B,text:H}of c){_!==B&&(b=0),_=B,a.fillStyle=S,a.textRendering="optimizeLegibility",a.font=`${C} ${r}px mojangles`;let G=g[B]??a.measureText(H).width,O=(t.width-G)/2+b;a.fillText(H,O,B),P&&(a.lineWidth=r/8,a.strokeStyle=S,a.beginPath(),a.moveTo(O,B-a.lineWidth*2.5),a.lineTo(O+a.measureText(H).width,B-a.lineWidth*2.5),a.stroke()),M&&(a.lineWidth=r/8,a.strokeStyle=S,a.beginPath(),a.moveTo(O,B+a.lineWidth),a.lineTo(O+a.measureText(H).width,B+a.lineWidth),a.stroke()),b+=a.measureText(H).width}return o};E();x();k();R();function Ot(n){let e=Math.floor(n.x/16),t=Math.floor(n.z/16);return[e,t]}function Jr(n){let e=Math.floor(n.x/16),t=Math.floor(n.y/16),r=Math.floor(n.z/16);return[e,t,r]}E();x();k();R();import{Vec3 as b1}from"vec3";import{subscribeKey as $r}from"valtio/utils";import{proxy as v7,subscribe as l7}from"valtio";E();x();k();R();var vt={blocks:"blocksArray",blockCollisionShapes:"blockCollisionShapes",biomes:"biomesArray",tints:"tints"};E();x();k();R();var Ms=16;var Ss=(n,e)=>e?`${n}:${e}`:String(n);E();x();k();R();var Cs=0,R0={},Zr=40,lt="mc-renderer-debug-overlay",ct=(n,e=80,t=Cs,r=Zr,i)=>{if(le)return{updateText(){},setVisibility(){}};let s=document.createElement("div");return s.style.position="fixed",s.style.top=`${r??Zr}px`,s.style.right=`${t}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",i?.className?s.className=i.className:s.style.zIndex="100",s.style.pointerEvents="none",document.body.appendChild(s),R0[n]=s,r===void 0&&t===Cs&&(Zr+=20),{updateText(o){s.innerText!==o&&(s.innerText=o)},setVisibility(o){s.style.display=o?"block":"none"}}};var qr=(n,e)=>{le||!R0[n]||(R0[n].innerText=e)},Bs=n=>{if(!le)for(let e in R0)R0[e].style.display=n?"block":"none"},Ps=()=>{if(!le)for(let n in R0)n7(n)},n7=n=>{le||!R0[n]||(R0[n].remove(),delete R0[n])};E();x();k();R();var s7=n=>{let e=n%24e3/24e3-.25;return e<0&&(e+=1),e>1&&(e-=1),e+(1-Math.cos(e*Math.PI))/2},o7=n=>{let e=(n%24e3+24e3)%24e3,t=s7(e),i=Math.cos(t*Math.PI*2)*.5+.5,s=Math.round(4+i*11);return Math.max(4,Math.min(15,s))},Xr=n=>{let e=(n%24e3+24e3)%24e3;if(e>=0&&e<12e3)return 15;if(e>=12e3&&e<13e3){let t=(e-12e3)/1e3;return Math.round(15-t*11)}else{if(e>=13e3&&e<23e3)return 4;{let t=(e-23e3)/1e3;return Math.round(4+t*11)}}},a7=()=>{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:e,label:t}of n){let r=o7(e),i=Xr(e)}};typeof window<"u"&&(window.debugSkyLight=a7);E();x();k();R();function Ve(n,e,t,r){if(n.on(e,t),r.aborted){n.off(e,t);return}r.addEventListener("abort",()=>{n.off(e,t)},{once:!0})}function Is(n,e,t,r){if(n.on(e,t),r.aborted){n.off(e,t);return}r.addEventListener("abort",()=>{n.off(e,t)},{once:!0})}function k5(n,e){return(n%e+e)%e}var k0=class k0{constructor(e,t,r){this.resourcesManager=e;this.displayOptions=t;this.initOptions=r;d(this,"worldReadyResolvers",Promise.withResolvers());d(this,"worldReadyPromise",this.worldReadyResolvers.promise);d(this,"timeOfTheDay",0);d(this,"worldSizeParams",{minY:0,worldHeight:256});d(this,"reactiveDebugParams",v7({stopRendering:!1,chunksRenderAboveOverride:void 0,chunksRenderAboveEnabled:!1,chunksRenderBelowOverride:void 0,chunksRenderBelowEnabled:!1,chunksRenderDistanceOverride:void 0,chunksRenderDistanceEnabled:!1,disableEntities:!1}));d(this,"active",!1);d(this,"loadedChunks",{});d(this,"finishedChunks",{});d(this,"finishedSections",{});d(this,"sectionsWaiting",new Map);d(this,"queuedChunks",new Set);d(this,"queuedFunctions",[]);d(this,"renderUpdateEmitter",new q0);d(this,"customTexturesDataUrl");d(this,"workers",[]);d(this,"viewerChunkPosition");d(this,"lastViewerChunkGridX");d(this,"lastViewerChunkGridZ");d(this,"lastCamUpdate",0);d(this,"droppedFpsPercentage",0);d(this,"initialChunkLoadWasStartedIn");d(this,"initialChunksLoad",!0);d(this,"enableChunksLoadDelay",!1);d(this,"texturesVersion");d(this,"viewDistance",-1);d(this,"onRenderDistanceChanged");d(this,"chunksLength",0);d(this,"allChunksFinished",!1);d(this,"messageQueue",[]);d(this,"isProcessingQueue",!1);d(this,"ONMESSAGE_TIME_LIMIT",30);d(this,"handleResize",()=>{});d(this,"highestBlocksByChunks",new Map);d(this,"blockEntities",{});d(this,"workersProcessAverageTime",0);d(this,"workersProcessAverageTimeCount",0);d(this,"maxWorkersProcessTime",0);d(this,"workersPreAverageTime",0);d(this,"workersWasmAverageTime",0);d(this,"workersPostAverageTime",0);d(this,"workersPhaseSampleCount",0);d(this,"workersPreTargetConvertAverageTime",0);d(this,"workersPreNeighborConvertAverageTime",0);d(this,"workersPreNeighborCountAverage",0);d(this,"workersPreTypedArrayBuildAverageTime",0);d(this,"workersPreOtherAverageTime",0);d(this,"workersPreCacheHitsTotal",0);d(this,"workersPreCacheMissesTotal",0);d(this,"geometryReceiveCount",{});d(this,"allLoadedIn");d(this,"onWorldSwitched",[]);d(this,"renderTimeMax",0);d(this,"renderTimeAvg",0);d(this,"renderTimeAvgCount",0);d(this,"edgeChunks",{});d(this,"lastAddChunk",null);d(this,"neighborChunkUpdates",!0);d(this,"lastChunkDistance",0);d(this,"debugStopGeometryUpdate",!1);d(this,"protocolCustomBlocks",new Map);d(this,"heightmapDebounceTimers",new Map);d(this,"sectionDirtyCount",new Map);d(this,"sectionDirtyTimers",new Map);d(this,"sectionDirtyPendingArgs",new Map);d(this,"blockStateModelInfo",new Map);d(this,"worldBlockProvider");d(this,"soundSystem");d(this,"worldRendererConfig");d(this,"playerStateReactive");d(this,"playerStateUtils");d(this,"reactiveState");d(this,"mesherLogReader");d(this,"forceCallFromMesherReplayer",!1);d(this,"stopMesherMessagesProcessing",!1);d(this,"abortController",new AbortController);d(this,"valtioUnsubs",[]);d(this,"lastRendered",0);d(this,"renderingActive",!0);d(this,"geometryReceiveCountPerSec",0);d(this,"mesherLogger",{contents:[],active:new URL(location.href).searchParams.get("mesherlog")==="true"});d(this,"currentRenderedFrames",0);d(this,"fpsAverage",0);d(this,"lastFps",0);d(this,"fpsWorst");d(this,"fpsSamples",0);d(this,"backendInfoReport","-");d(this,"chunksFullInfo","-");d(this,"workerCustomHandleTime",0);d(this,"queueAwaited",!1);d(this,"toWorkerMessagesQueue",{});this.snapshotInitialValues(),this.worldRendererConfig=t.inWorldRenderingConfig,this.playerStateReactive=t.playerStateReactive,this.playerStateUtils=j2(this.playerStateReactive),this.reactiveState=t.rendererState,this.renderUpdateEmitter.on("update",()=>{let o=Object.keys(this.finishedChunks).length;qr("loaded-chunks",`${o}/${this.chunksLength} chunks (${this.lastChunkDistance}/${this.viewDistance})`)}),ct("downloaded-chunks",100,140,20,{className:lt}),this.connect(this.displayOptions.worldView);let i=setInterval(()=>{this.geometryReceiveCountPerSec=Object.values(this.geometryReceiveCount).reduce((o,v)=>o+v,0),this.geometryReceiveCount={},Bs(this.displayAdvancedStats),this.updateChunksStats()},500),s=setInterval(()=>{this.fpsUpdate()},1e3);this.abortController.signal.addEventListener("abort",()=>{clearInterval(i),clearInterval(s)})}anyModuleRequiresHeightmap(){return!1}isShaderCubeBlocksEnabled(){return this.worldRendererConfig.shaderCubeBlocks===!0}shaderCubeBlocksEnabled(){return this.isShaderCubeBlocksEnabled()}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(e){this.mesherLogger.active&&this.mesherLogger.contents.push(typeof e=="function"?e():e)}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()})()]);let e=async()=>{this.active&&await this.updateAssetsData()};Is(this.resourcesManager,"assetsTexturesUpdated",e,this.abortController.signal),this.watchReactivePlayerState(),this.watchReactiveConfig(),this.worldReadyResolvers.resolve()}snapshotInitialValues(){}wasChunkSentToWorker(e){return this.loadedChunks[e]}async getHighestBlocks(e){return this.highestBlocksByChunks.get(e)}updateCustomBlock(e,t,r){if(this.protocolCustomBlocks.set(e,{...this.protocolCustomBlocks.get(e),[t]:r}),this.logWorkerWork(()=>`-> updateCustomBlock ${e} ${t} ${r} ${this.wasChunkSentToWorker(e)}`),this.wasChunkSentToWorker(e)){let[i,s,o]=t.split(",").map(Number);this.setBlockStateId(new b1(i,s,o),void 0)}}async getBlockInfo(e,t){let i=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`,s=this.protocolCustomBlocks.get(i)?.[`${e.x},${e.y},${e.z}`],o=Ss(t,s),v=this.blockStateModelInfo.get(o);return{customBlockName:s,modelInfo:v}}initWorkers(e=this.worldRendererConfig.mesherWorkers){for(let t=0;t<e+0;t++){let r=c7(i=>{Array.isArray(i)?this.messageQueue.push(...i):this.messageQueue.push(i),this.processMessageQueue("worker")},this.worldRendererConfig.wasmMesher?"mesherWasm.js":"mesher.js");this.workers.push(r)}}onReactivePlayerStateUpdated(e,t,r=!0){return r&&t(this.playerStateReactive[e]),$r(this.playerStateReactive,e,t)}onReactiveConfigUpdated(e,t){t(this.worldRendererConfig[e]),e==="*"?l7(this.worldRendererConfig,t):$r(this.worldRendererConfig,e,t)}onReactiveDebugUpdated(e,t){t(this.reactiveDebugParams[e]),$r(this.reactiveDebugParams,e,t)}watchReactivePlayerState(){this.valtioUnsubs.push(this.onReactivePlayerStateUpdated("backgroundColor",e=>{this.changeBackgroundColor(e)})),this.valtioUnsubs.push(this.onReactivePlayerStateUpdated("cardinalLight",e=>{this.changeCardinalLight(e)}))}watchReactiveConfig(){this.valtioUnsubs.push(this.onReactiveConfigUpdated("fetchPlayerSkins",e=>{h1({apiEnabled:e})}))}async processMessageQueue(e){if(this.isProcessingQueue||this.messageQueue.length===0)return;if(this.logWorkerWork(`# ${e} processing queue`),this.lastRendered&&performance.now()-this.lastRendered>this.ONMESSAGE_TIME_LIMIT&&this.worldRendererConfig._experimentalSmoothChunkLoading&&this.renderingActive){let i=performance.now();await new Promise(s=>{requestAnimationFrame(s)}),this.logWorkerWork(`# processing got delayed by ${performance.now()-i}ms`)}this.isProcessingQueue=!0;let t=performance.now(),r=0;for(;this.messageQueue.length>0;){let i=this.stopMesherMessagesProcessing;if(!i){let s=this.messageQueue.shift();this.handleMessage(s),r++}if(i||performance.now()-t>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(e){var r,i;let t=e;if(this.active){if(this.mesherLogReader?.workerMessageReceived(t.type,t),t.type!=="geometry"||!this.debugStopGeometryUpdate){let s=performance.now();this.handleWorkerMessage(t),this.workerCustomHandleTime+=performance.now()-s}if(t.type==="geometry"){this.logWorkerWork(()=>`-> ${t.workerIndex} geometry ${t.key} ${JSON.stringify({dataSize:JSON.stringify(t).length})}`),(r=this.geometryReceiveCount)[i=t.workerIndex]??(r[i]=0),this.geometryReceiveCount[t.workerIndex]++;let s=t.key.split(",").map(Number);this.lastChunkDistance=Math.max(...this.getDistance(new b1(s[0],0,s[2])))}if(t.type==="sectionFinished"){if(this.logWorkerWork(`<- ${t.workerIndex} sectionFinished ${t.key} ${JSON.stringify({processTime:t.processTime})}`),!this.sectionsWaiting.has(t.key))return;this.sectionsWaiting.set(t.key,this.sectionsWaiting.get(t.key)-1),this.sectionsWaiting.get(t.key)===0&&(this.sectionsWaiting.delete(t.key),this.finishedSections[t.key]=!0);let s=t.key.split(",").map(Number),o=`${s[0]},${s[2]}`;if(this.loadedChunks[o]){let v=!0,a=this.getSectionHeight();for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=a)if(!this.finishedSections[`${s[0]},${l},${s[2]}`]){v=!1;break}if(v){this.finishedChunks[o]=!0;let l=16,c=`${Math.floor(s[0]/l)},${Math.floor(s[2]/l)}`;this.reactiveState.world.chunksLoaded[c]=!0,this.renderUpdateEmitter.emit("chunkFinished",`${s[0]},${s[2]}`),this.checkAllFinished()}}if(this.renderUpdateEmitter.emit("update"),t.processTime&&(this.workersProcessAverageTimeCount++,this.workersProcessAverageTime=(this.workersProcessAverageTime*(this.workersProcessAverageTimeCount-1)+t.processTime)/this.workersProcessAverageTimeCount,this.maxWorkersProcessTime=Math.max(this.maxWorkersProcessTime,t.processTime)),typeof t.pre=="number"&&typeof t.wasm=="number"&&typeof t.post=="number"&&(t.pre>0||t.wasm>0||t.post>0)){let v=++this.workersPhaseSampleCount;this.workersPreAverageTime=(this.workersPreAverageTime*(v-1)+t.pre)/v,this.workersWasmAverageTime=(this.workersWasmAverageTime*(v-1)+t.wasm)/v,this.workersPostAverageTime=(this.workersPostAverageTime*(v-1)+t.post)/v;let a=typeof t.preTargetConvert=="number"?t.preTargetConvert:0,l=typeof t.preNeighborConvert=="number"?t.preNeighborConvert:0,c=typeof t.preNeighborCount=="number"?t.preNeighborCount:0,u=typeof t.preTypedArrayBuild=="number"?t.preTypedArrayBuild:0,f=typeof t.preOther=="number"?t.preOther:0,p=typeof t.preCacheHits=="number"?t.preCacheHits:0,g=typeof t.preCacheMisses=="number"?t.preCacheMisses:0;if(this.workersPreTargetConvertAverageTime=(this.workersPreTargetConvertAverageTime*(v-1)+a)/v,this.workersPreNeighborConvertAverageTime=(this.workersPreNeighborConvertAverageTime*(v-1)+l)/v,this.workersPreNeighborCountAverage=(this.workersPreNeighborCountAverage*(v-1)+c)/v,this.workersPreTypedArrayBuildAverageTime=(this.workersPreTypedArrayBuildAverageTime*(v-1)+u)/v,this.workersPreOtherAverageTime=(this.workersPreOtherAverageTime*(v-1)+f)/v,this.workersPreCacheHitsTotal+=p,this.workersPreCacheMissesTotal+=g,this.worldRendererConfig.debugWasmPerf&&v%k0.PHASE_PERF_LOG_INTERVAL===0){let y=this.workersPreAverageTime+this.workersWasmAverageTime+this.workersPostAverageTime,A=y>0?this.workersPreAverageTime/y*100:0,b=y>0?this.workersWasmAverageTime/y*100:0,_=y>0?this.workersPostAverageTime/y*100:0,S=this.workersPreAverageTime,C=S>0?this.workersPreTargetConvertAverageTime/S*100:0,M=S>0?this.workersPreNeighborConvertAverageTime/S*100:0,P=S>0?this.workersPreTypedArrayBuildAverageTime/S*100:0,B=S>0?this.workersPreOtherAverageTime/S*100:0,H=this.workersPreNeighborCountAverage,G=H>0?this.workersPreNeighborConvertAverageTime/H:0,O=this.workersPreCacheHitsTotal+this.workersPreCacheMissesTotal,j=O>0?this.workersPreCacheHitsTotal/O*100:0}}}if(t.type==="blockStateModelInfo")for(let[s,o]of Object.entries(t.info))this.blockStateModelInfo.set(s,o);if(t.type==="heightmap"){let s=new Int16Array(t.heightmap);this.reactiveState.world.heightmaps[t.key]=s}}}downloadMesherLog(){let e=document.createElement("a");e.href="data:text/plain;charset=utf-8,"+encodeURIComponent(this.mesherLogger.contents.join(`
|
|
288
|
-
`)),e.download="mesher.log",e.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(e,t){}updateViewerPosition(e){this.viewerChunkPosition=e;for(let[i,s]of Object.entries(this.loadedChunks))s&&this.updatePosDataChunk?.(i);let t=Math.floor(e.x/16),r=Math.floor(e.z/16);(t!==this.lastViewerChunkGridX||r!==this.lastViewerChunkGridZ)&&(this.lastViewerChunkGridX=t,this.lastViewerChunkGridZ=r,this.onViewerChunkPositionChanged())}onViewerChunkPositionChanged(){}sendWorkers(e){for(let t of this.workers)t.postMessage(e)}getDistance(e){let[t,r]=Ot(this.viewerChunkPosition),i=16,s=Math.abs(t-Math.floor(e.x/i)),o=Math.abs(r-Math.floor(e.z/i));return[s,o]}resetWorld(){for(let e of this.workers)e.terminate();this.workers=[]}async resetWorkers(){this.resetWorld(),typeof document<"u"&&document?.readyState==="loading"&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",e)}),this.initWorkers(),this.active=!0,this.sendMesherMcData()}getMesherConfig(){let e=this.timeOfTheDay,t=e<0||e>24e3?15:Xr(e);return{version:this.version,enableLighting:this.worldRendererConfig.enableLighting,skyLight:t,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,shaderCubeBlocks:this.isShaderCubeBlocksEnabled()}}sendMesherMcData(){let e=this.resourcesManager.currentResources.mcData;Os(this.workers,this.version,vt,e),this.logWorkerWork("# mcData sent")}async updateAssetsData(){let e=this.resourcesManager.currentResources;if(this.workers.length===0)throw new Error("workers not initialized yet");for(let[t,r]of this.workers.entries()){let{blockstatesModels:i}=e;r.postMessage({type:"mesherData",workerIndex:t,blocksAtlas:{latest:e.blocksAtlasJson},blockstatesModels:i,config:this.getMesherConfig()})}this.logWorkerWork("# mesherData sent")}getSectionHeight(){return Ms}get worldMinYRender(){let e=this.getSectionHeight();return Math.floor(Math.max(this.worldSizeParams.minY,this.worldRendererConfig.clipWorldBelowY??-1/0)/e)*e}updateChunksStats(){let e=Object.keys(this.finishedChunks);this.displayOptions.nonReactiveState.world.chunksLoadedCount=e.length,this.displayOptions.nonReactiveState.world.chunksTotalNumber=this.chunksLength,this.reactiveState.world.allChunksLoaded=this.allChunksFinished;let t=`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=t,this.displayOptions.nonReactiveState.world.chunksFullInfo=t,qr("downloaded-chunks",t)}addColumn(e,t,r,i){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[`${e},${t}`]=!0,this.updateChunksStats();let s=`${e},${t}`,o=this.protocolCustomBlocks.get(s);for(let l of this.workers)l.postMessage({type:"chunk",x:e,z:t,chunk:r,customBlockModels:o||void 0});this.worldRendererConfig.wasmMesher||this.workers[0].postMessage({type:"getHeightmap",x:e,z:t}),this.logWorkerWork(()=>`-> chunk ${JSON.stringify({x:e,z:t,chunkLength:r.length,customBlockModelsLength:o?Object.keys(o).length:0})}`),this.mesherLogReader?.chunkReceived(e,t,r.length);let v=this.getSectionHeight(),a=16;for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=v){let c=new b1(e,l,t);this.setSectionDirty(c),this.neighborChunkUpdates&&(!i||this.worldRendererConfig.smoothLighting)&&(this.setSectionDirty(c.offset(-a,0,0)),this.setSectionDirty(c.offset(a,0,0)),this.setSectionDirty(c.offset(0,0,-a)),this.setSectionDirty(c.offset(0,0,a)))}}markAsLoaded(e,t){this.loadedChunks[`${e},${t}`]=!0,this.finishedChunks[`${e},${t}`]=!0,this.logWorkerWork(`-> markAsLoaded ${JSON.stringify({x:e,z:t})}`),this.renderUpdateEmitter.emit("chunkFinished",`${e},${t}`),this.checkAllFinished()}removeColumn(e,t){var v;delete this.loadedChunks[`${e},${t}`];let r=`${e},${t}`,i=this.heightmapDebounceTimers.get(r);i&&(clearTimeout(i),this.heightmapDebounceTimers.delete(r));for(let[a,l]of this.sectionDirtyTimers)a.startsWith(`${e},`)&&a.endsWith(`,${t}`)&&(clearTimeout(l),this.sectionDirtyTimers.delete(a),this.sectionDirtyCount.delete(a),this.sectionDirtyPendingArgs.delete(a));for(let a=0;a<this.workers.length;a++)(v=this.toWorkerMessagesQueue)[a]??(v[a]=[]),this.toWorkerMessagesQueue[a].push({type:"unloadChunk",x:e,z:t});this.dispatchMessages(),this.logWorkerWork(`-> unloadChunk ${JSON.stringify({x:e,z:t})}`),delete this.finishedChunks[`${e},${t}`],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 a=this.worldMinYRender;a<this.worldSizeParams.worldHeight;a+=s){let l=`${e},${a},${t}`,c=this.sectionsWaiting.get(l);c!==void 0&&c>0,this.sectionsWaiting.delete(l),delete this.finishedSections[l]}this.highestBlocksByChunks.delete(`${e},${t}`);let o=`${Math.floor(e/16)},${Math.floor(t/16)}`;delete this.reactiveState.world.heightmaps[o],this.updateChunksStats(),Object.keys(this.loadedChunks).length===0&&(this.mesherLogger.contents=[],this.logWorkerWork("# all chunks unloaded. New log started"),this.mesherLogReader?.maybeStartReplay())}setBlockStateId(e,t,r=!0){(async()=>{let o=Math.floor(e.x/16)*16,v=Math.floor(e.z/16)*16;this.queuedChunks.has(`${o},${v}`)&&await new Promise(a=>{this.queuedFunctions.push(()=>{a()})}),this.loadedChunks[`${o},${v}`],this.setBlockStateIdInner(e,t,r)})()}updateEntity(e,t=!1){}lightUpdate(e,t){}connect(e){let t=e,r=this.abortController.signal;Ve(t,"entity",s=>{this.updateEntity(s,!1)},r),Ve(t,"entityMoved",s=>{this.updateEntity(s,!0)},r),Ve(t,"playerEntity",s=>{this.updatePlayerEntity?.(s)},r);let i=null;Ve(t,"loadChunk",({x:s,z:o,chunk:v,worldConfig:a,isLightUpdate:l})=>{this.worldSizeParams=a,this.queuedChunks.add(`${s},${o}`);let c=[s,o,v,l];i||(i={data:[],timeout:setTimeout(()=>{for(let u of i.data)this.queuedChunks.delete(`${u[0]},${u[1]}`),this.addColumn(...u);for(let u of this.queuedFunctions)u();this.queuedFunctions=[],i=null},this.worldRendererConfig.addChunksBatchWaitTime)}),i.data.push(c)},r),Ve(t,"blockEntities",s=>{this.blockEntities=s},r),Ve(t,"unloadChunk",({x:s,z:o})=>{this.removeColumn(s,o)},r),Ve(t,"blockUpdate",({pos:s,stateId:o})=>{this.setBlockStateId(new b1(s.x,s.y,s.z),o)},r),Ve(t,"chunkPosUpdate",({pos:s})=>{this.updateViewerPosition(s)},r),Ve(t,"end",()=>{this.worldStop?.()},r),Ve(t,"renderDistance",s=>{this.viewDistance=s,this.chunksLength=s===0?1:f5(s).length,this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,this.onRenderDistanceChanged?.(s)},r),Ve(t,"markAsLoaded",({x:s,z:o})=>{this.markAsLoaded(s,o)},r),Ve(t,"updateLight",({pos:s})=>{this.lightUpdate(s.x,s.z)},r),Ve(t,"onWorldSwitch",()=>{for(let s of this.onWorldSwitched)try{s()}catch(o){setTimeout(()=>{throw o},0)}},r),Ve(t,"time",s=>{this.worldRendererConfig.dayCycle&&(this.timeUpdated?.(s),this.timeOfTheDay=s)},r),Ve(t,"biomeUpdate",({biome:s})=>{this.biomeUpdated?.(s)},r),Ve(t,"biomeReset",()=>{this.biomeReset?.()},r)}setBlockStateIdInner(e,t,r=!0){let s=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`,o=`${e.x},${e.y},${e.z}`,v=this.protocolCustomBlocks.get(s)||{};for(let a of this.workers)a.postMessage({type:"blockUpdate",pos:e,stateId:t,customBlockModels:v});if(this.anyModuleRequiresHeightmap()){let a=Math.floor(e.x/16)*16,l=Math.floor(e.z/16)*16,c=`${a},${l}`;if(!this.worldRendererConfig.wasmMesher){let u=this.heightmapDebounceTimers.get(c);u&&clearTimeout(u),this.heightmapDebounceTimers.set(c,setTimeout(()=>{this.heightmapDebounceTimers.delete(c),this.workers[0]?.postMessage({type:"getHeightmap",x:a,z:l})},100))}}if(this.logWorkerWork(`-> blockUpdate ${JSON.stringify({pos:e,stateId:t,customBlockModels:v})}`),this.setSectionDirty(e,!0,!0),this.neighborChunkUpdates){let l=this.getSectionHeight();e.x&15||this.setSectionDirty(e.offset(-16,0,0),!0,!0),(e.x&15)===15&&this.setSectionDirty(e.offset(16,0,0),!0,!0),e.y&l-1||this.setSectionDirty(e.offset(0,-l,0),!0,!0),(e.y&l-1)===l-1&&this.setSectionDirty(e.offset(0,l,0),!0,!0),e.z&15||this.setSectionDirty(e.offset(0,0,-16),!0,!0),(e.z&15)===15&&this.setSectionDirty(e.offset(0,0,16),!0,!0),r&&(!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,0,-16),!0,!0),(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,0,-16),!0,!0),!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,0,16),!0,!0),(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,0,16),!0,!0),!(e.x&15)&&!(e.y&l-1)&&this.setSectionDirty(e.offset(-16,-l,0),!0,!0),(e.x&15)===15&&!(e.y&l-1)&&this.setSectionDirty(e.offset(16,-l,0),!0,!0),!(e.z&15)&&!(e.y&l-1)&&this.setSectionDirty(e.offset(0,-l,-16),!0,!0),(e.z&15)===15&&!(e.y&l-1)&&this.setSectionDirty(e.offset(0,-l,16),!0,!0),!(e.y&l-1)&&!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,-l,-16),!0,!0),!(e.y&l-1)&&(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,-l,-16),!0,!0),!(e.y&l-1)&&!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,-l,16),!0,!0),!(e.y&l-1)&&(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,-l,16),!0,!0))}}getWorkerNumber(e,t=!1){let i=this.getSectionHeight();if(this.worldRendererConfig.dedicatedChangeWorker&&this.workers.length>1){if(this.worldRendererConfig.wasmMesher)return k5(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let v=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(this.sectionsWaiting.get(v)&&!this.finishedSections[v]){let l=this.workers.length-1;return k5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),l)}return this.workers.length-1}let o=this.workers.length-1;return k5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),o)}if(this.worldRendererConfig.wasmMesher)return k5(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let o=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(!(this.sectionsWaiting.get(o)&&!this.finishedSections[o]))return 0}return k5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),this.workers.length)}async debugGetWorkerCustomBlockModel(e){let t=[];for(let r of this.workers)t.push(new Promise(i=>{r.addEventListener("message",s=>{s.data.type==="customBlockModel"&&i(s.data.customBlockModel)})})),r.postMessage({type:"getCustomBlockModel",pos:e});return Promise.all(t)}setSectionDirty(e,t=!0,r=!1){if(!this.forceCallFromMesherReplayer&&this.mesherLogReader)return;if(this.viewDistance===-1)throw new Error("viewDistance not set");let i=this.getDistance(e);if(!this.workers.length||i[0]>this.viewDistance||i[1]>this.viewDistance)return;if(!t){this._dispatchDirtyImmediate(e,t,r);return}let s=16,o=this.getSectionHeight(),v=`${Math.floor(e.x/s)*s},${Math.floor(e.y/o)*o},${Math.floor(e.z/s)*s}`,a=(this.sectionDirtyCount.get(v)??0)+1;this.sectionDirtyCount.set(v,a),a<=k0.GEOMETRY_THROTTLE_THRESHOLD?(this._dispatchDirtyImmediate(e,t,r),this.sectionDirtyTimers.has(v)||this.sectionDirtyTimers.set(v,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(v);this.sectionDirtyCount.delete(v),this.sectionDirtyTimers.delete(v),this.sectionDirtyPendingArgs.delete(v),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},k0.GEOMETRY_THROTTLE_DELAY))):(this.sectionDirtyPendingArgs.set(v,{pos:e,value:t,useChangeWorker:r}),this.sectionDirtyTimers.has(v)||this.sectionDirtyTimers.set(v,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(v);this.sectionDirtyCount.delete(v),this.sectionDirtyTimers.delete(v),this.sectionDirtyPendingArgs.delete(v),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},k0.GEOMETRY_THROTTLE_DELAY)))}_dispatchDirtyImmediate(e,t,r){var a;this.reactiveState.world.mesherWork=!0;let i=16,s=this.getSectionHeight(),o=`${Math.floor(e.x/i)*i},${Math.floor(e.y/s)*s},${Math.floor(e.z/i)*i}`;this.renderUpdateEmitter.emit("dirty",e,t);let v=this.getWorkerNumber(e,r&&(this.mesherLogger.active||this.worldRendererConfig.dedicatedChangeWorker));this.sectionsWaiting.set(o,(this.sectionsWaiting.get(o)??0)+1),this.forceCallFromMesherReplayer?this.workers[v].postMessage({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}):((a=this.toWorkerMessagesQueue)[v]??(a[v]=[]),this.toWorkerMessagesQueue[v].push({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}),this.dispatchMessages())}dispatchMessages(){this.queueAwaited||(this.queueAwaited=!0,setTimeout(()=>{for(let e in this.toWorkerMessagesQueue){let t=this.workers[Number(e)],r=this.toWorkerMessagesQueue[e];t.postMessage(r);for(let i of r)this.logWorkerWork(`-> ${e} dispatchMessages ${i.type} ${JSON.stringify({x:i.x,y:i.y,z:i.z,value:i.value})}`)}this.toWorkerMessagesQueue={},this.queueAwaited=!1}))}async waitForChunksToRender(){return new Promise((e,t)=>{if([...this.sectionsWaiting].length===0){e();return}let r=()=>{this.sectionsWaiting.size===0&&(this.renderUpdateEmitter.removeListener("update",r),e())};this.renderUpdateEmitter.on("update",r)})}async waitForChunkToLoad(e){return new Promise((t,r)=>{let s=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`;if(this.loadedChunks[s]){t();return}let o=()=>{this.loadedChunks[s]&&(this.renderUpdateEmitter.removeListener("update",o),t())};this.renderUpdateEmitter.on("update",o)})}destroy(){for(let e of this.valtioUnsubs)e();this.valtioUnsubs=[];for(let e of this.heightmapDebounceTimers.values())clearTimeout(e);this.heightmapDebounceTimers.clear();for(let e of this.sectionDirtyTimers.values())clearTimeout(e);this.sectionDirtyTimers.clear(),this.sectionDirtyCount.clear(),this.sectionDirtyPendingArgs.clear();for(let e of this.workers)e.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(),Ps()}};d(k0,"PHASE_PERF_LOG_INTERVAL",64),d(k0,"GEOMETRY_THROTTLE_THRESHOLD",1),d(k0,"GEOMETRY_THROTTLE_DELAY",100);var y1=k0,c7=(n,e="mesher.js")=>{let t;if(D.env.SINGLE_FILE_BUILD){let r=document.getElementById("mesher-worker-code").textContent,i=new Blob([r],{type:"text/javascript"});t=new Worker(window.URL.createObjectURL(i))}else t=new Worker(e);return t.onmessage=({data:r})=>{n(r)},t.on&&t.on("message",r=>{t.onmessage({data:r})}),t},Hs=!1,Os=(n,e,t=vt,r)=>{let i={version:JSON.parse(JSON.stringify(r.version))};for(let[s,o]of Object.entries(t))i[s]=r[o];"tints"in t&&!i.tints&&!Hs&&(Hs=!0);for(let s of n)s.postMessage({type:"mcData",mcData:i})},ei=(n,e,t=vt,r,i=1e4)=>Promise.all(n.map(s=>new Promise((o,v)=>{let a=setTimeout(()=>{s.removeEventListener("message",l),v(new Error(`mcData transfer timeout (${i}ms)`))},i),l=({data:c})=>{c?.type==="mcDataApplied"&&(clearTimeout(a),s.removeEventListener("message",l),o())};s.addEventListener("message",l),Os([s],e,t,r)}))).then(()=>{});E();x();k();R();import{Vec3 as d7}from"vec3";import*as n0 from"three";E();x();k();R();function _1(n,e){let t=e/180*Math.PI,r=Math.cos(t),i=Math.sin(t),s={x:0,y:1,z:2}[n],o=(s+1)%3,v=(s+2)%3,a=[[0,0,0],[0,0,0],[0,0,0]];return a[s][s]=1,a[o][o]=r,a[o][v]=-i,a[v][o]=+i,a[v][v]=r,a}function ti(n,e){return e?[n[0]+e[0],n[1]+e[1],n[2]+e[2]]:n}function ri(n,e){return e?[n[0]-e[0],n[1]-e[1],n[2]-e[2]]:n}function Dt(n,e){return n?[n[0][0]*e[0]+n[0][1]*e[1]+n[0][2]*e[2],n[1][0]*e[0]+n[1][1]*e[1]+n[1][2]*e[2],n[2][0]*e[0]+n[2][1]*e[1]+n[2][2]*e[2]]:e}function Ds(n,e){let t=[[0,0,0],[0,0,0],[0,0,0]],r=n[0][0],i=n[1][0],s=n[2][0],o=n[0][1],v=n[1][1],a=n[2][1],l=n[0][2],c=n[1][2],u=n[2][2],f=e[0][0],p=e[1][0],g=e[2][0],y=e[0][1],A=e[1][1],b=e[2][1],_=e[0][2],S=e[1][2],C=e[2][2];return t[0][0]=r*f+i*y+s*_,t[1][0]=r*p+i*A+s*S,t[2][0]=r*g+i*b+s*C,t[0][1]=o*f+v*y+a*_,t[1][1]=o*p+v*A+a*S,t[2][1]=o*g+v*b+a*C,t[0][2]=l*f+c*y+u*_,t[1][2]=l*p+c*A+u*S,t[2][2]=l*g+c*b+u*C,t}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 u7(n,e,t,r,i,s,o,v){let a=new d7(0,0,0);for(let l in n.faces){let c=n.faces[l],{corners:u,mask1:f,mask2:p}=ii[l],g=Dt(r,ii[l].dir);if(c.cullface&&v[l])continue;let y=n.from[0],A=n.from[1],b=n.from[2],_=n.to[0],S=n.to[1],C=n.to[2],M=c.texture,{u:P}=M,{v:B}=M,{su:H}=M,{sv:G}=M,O=Math.floor(t.positions.length/3),j=[1,1,1];c.tintindex!==void 0&&c.tintindex===0&&(j=[.5686274509803921,.7411764705882353,.34901960784313724]);let J=c.rotation||0,Z=Math.cos(J*Math.PI/180),X=-Math.sin(J*Math.PI/180),de=null,ae=null;n.rotation&&(de=_1(n.rotation.axis,n.rotation.angle),ae=ri(n.rotation.origin,Dt(de,n.rotation.origin)));let ve=[],ge=1;for(let Ee of u){let ne=[Ee[0]?_:y,Ee[1]?S:A,Ee[2]?C:b];ne=ti(Dt(de,ne),ae),ne=ti(Dt(r,ne),i),ne=ne.map(Ge=>Ge/16),t.positions.push(ne[0],ne[1],ne[2]),t.normals.push(...g);let Y=(Ee[3]-.5)*Z-(Ee[4]-.5)*X+.5,oe=(Ee[3]-.5)*X+(Ee[4]-.5)*Z+.5;t.uvs.push(Y*H+P,oe*G+B);let be=1;e&&(be=4/4*(15/15),ve.push(3)),t.colors.push(ge*j[0]*be,ge*j[1]*be,ge*j[2]*be)}e&&ve[0]+ve[3]>=ve[1]+ve[2]?t.indices.push(O,O+3,O+2,O,O+1,O+3):t.indices.push(O,O+1,O+2,O+2,O+1,O+3)}}var f7=(n,e,t,r,i=[],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[u,f]of n.entries()){let p=f[i[u]]??f[0];if(!p)continue;let g=null,y=null;for(let b of["x","y","z"])b in p&&(g?g=Ds(g,_1(b,-(p[b]??0))):g=_1(b,-(p[b]??0)));g&&(y=[8,8,8],y=ri(y,Dt(g,y)));let A=p.ao??!0;for(let b of p.elements??[])u7(b,A,l,g,y,e,t,s)}let c=l.positions.length/3;for(let u=0;u<l.t_positions.length/12;u++)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},h7=(...n)=>{let t={geometry:f7(...n)},r=new n0.BufferGeometry;return r.setAttribute("position",new n0.BufferAttribute(t.geometry.positions,3)),r.setAttribute("normal",new n0.BufferAttribute(t.geometry.normals,3)),r.setAttribute("color",new n0.BufferAttribute(t.geometry.colors,3)),r.setAttribute("uv",new n0.BufferAttribute(t.geometry.uvs,2)),r.setIndex(t.geometry.indices),r.name="block-geometry",r},ni=(n,...e)=>{let t=h7(...e),r=new n0.Mesh(t,n);r.position.set(-.5,-.5,-.5);let i=new n0.Group;return i.add(r),i.rotation.set(0,-n0.MathUtils.degToRad(90),0,"ZYX"),globalThis.mesh=i,i},Fs=(n,e)=>{n.position.set(e.x+.5,e.y+.5,e.z+.5)};E();x();k();R();import*as Fe from"three";var T5=async(n,e)=>{let t;if(!n&&!e){let{canvas:l}=await _0(e0);t=new Fe.CanvasTexture(l)}else{if(n||(n=await O0(e,"skin")),!n)return;let{canvas:l}=await _0(n);t=new Fe.CanvasTexture(l)}t.magFilter=Fe.NearestFilter,t.minFilter=Fe.NearestFilter;let r=!1,s=m7(40,16,r?-2:-3,-2,-2,r?3:4,12,4,64,64),o=new Fe.MeshStandardMaterial;o.map=t,o.needsUpdate=!0;let v=new Fe.Mesh(s,o),a=new Fe.Group;return a.add(v),a};function m7(n,e,t,r,i,s,o,v,a,l,c=!1){let u=t/16,f=r/16,p=i/16,g=(t+s)/16,y=(r+o)/16,A=(i+v)/16;c&&([u,g]=[g,u]);let b=[[u,f,p],[g,f,p],[g,y,p],[u,y,p],[u,f,A],[g,f,A],[g,y,A],[u,y,A]],_=n,S=n+v,C=n+v+s,M=n+v+s+s,P=n+v+s+v,B=n+v+s+v+s,H=e,G=e+v,O=e+v+o,j=[{vi:[5,4,0,1],uv:[S,H,C,G],n:[0,-1,0]},{vi:[2,3,7,6],uv:[C,G,M,H],n:[0,1,0]},{vi:[0,4,7,3],uv:[_,G,S,O],n:[-1,0,0]},{vi:[1,0,3,2],uv:[S,G,C,O],n:[0,0,-1]},{vi:[5,1,2,6],uv:[C,G,P,O],n:[1,0,0]},{vi:[4,5,6,7],uv:[P,G,B,O],n:[0,0,1]}],J=[],Z=[],X=[],de=[];for(let ve=0;ve<j.length;ve++){let ge=j[ve],Ee=ve*4,[ne,Y,oe,be]=ge.uv,Ge=[[oe/a,1-Y/l],[ne/a,1-Y/l],[ne/a,1-be/l],[oe/a,1-be/l]],Oe=c?[3,2,1,0]:[0,1,2,3],Xe=c?-ge.n[0]:ge.n[0];for(let he=0;he<4;he++){let h0=b[ge.vi[Oe[he]]];J.push(h0[0],h0[1],h0[2]),Z.push(Ge[he][0],Ge[he][1]),X.push(Xe,ge.n[1],ge.n[2])}de.push(Ee,Ee+1,Ee+2,Ee,Ee+2,Ee+3)}let ae=new Fe.BufferGeometry;return ae.setAttribute("position",new Fe.Float32BufferAttribute(J,3)),ae.setAttribute("uv",new Fe.Float32BufferAttribute(Z,2)),ae.setAttribute("normal",new Fe.Float32BufferAttribute(X,3)),ae.setIndex(de),ae}E();x();k();R();E();x();k();R();import*as Ce from"three";E();x();k();R();E();x();k();R();var D0=class n{constructor(e,t,r,i,s="div"){this.parent=e,this.object=t,this.property=r,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(i),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(r)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,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(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),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)}},si=class extends D0{constructor(e,t,r){super(e,t,r,"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 oi(n){let e,t;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}var p7={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:oi,toHexString:oi},S5={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},g7={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,t=1){let r=S5.fromHexString(n);e[0]=(r>>16&255)/255*t,e[1]=(r>>8&255)/255*t,e[2]=(r&255)/255*t},toHexString([n,e,t],r=1){r=255/r;let i=n*r<<16^e*r<<8^t*r<<0;return S5.toHexString(i)}},b7={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,t=1){let r=S5.fromHexString(n);e.r=(r>>16&255)/255*t,e.g=(r>>8&255)/255*t,e.b=(r&255)/255*t},toHexString({r:n,g:e,b:t},r=1){r=255/r;let i=n*r<<16^e*r<<8^t*r<<0;return S5.toHexString(i)}},y7=[p7,S5,g7,b7];function _7(n){return y7.find(e=>e.match(n))}var ai=class extends D0{constructor(e,t,r,i){super(e,t,r,"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=_7(this.initialValue),this._rgbScale=i,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=oi(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(e){if(this._format.isPrimitive){let t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),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}},M5=class extends D0{constructor(e,t,r){super(e,t,r,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",i=>{i.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},vi=class extends D0{constructor(e,t,r,i,s,o){super(e,t,r,"number"),this._initInput(),this.min(i),this.max(s);let v=o!==void 0;this.step(v?o:this._getImplicitStep(),v),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.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 t=()=>{let _=parseFloat(this.$input.value);isNaN(_)||(this._stepExplicit&&(_=this._snap(_)),this.setValue(this._clamp(_)))},r=_=>{let S=parseFloat(this.$input.value);isNaN(S)||(this._snapClampSetValue(S+_),this.$input.value=this.getValue())},i=_=>{_.key==="Enter"&&this.$input.blur(),_.code==="ArrowUp"&&(_.preventDefault(),r(this._step*this._arrowKeyMultiplier(_))),_.code==="ArrowDown"&&(_.preventDefault(),r(this._step*this._arrowKeyMultiplier(_)*-1))},s=_=>{this._inputFocused&&(_.preventDefault(),r(this._step*this._normalizeMouseWheel(_)))},o=!1,v,a,l,c,u,f=5,p=_=>{v=_.clientX,a=l=_.clientY,o=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",y)},g=_=>{if(o){let S=_.clientX-v,C=_.clientY-a;Math.abs(C)>f?(_.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(S)>f&&y()}if(!o){let S=_.clientY-l;u-=S*this._step*this._arrowKeyMultiplier(_),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}l=_.clientY},y=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",y)},A=()=>{this._inputFocused=!0},b=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",t),this.$input.addEventListener("keydown",i),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",p),this.$input.addEventListener("focus",A),this.$input.addEventListener("blur",b)}_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 e=(b,_,S,C,M)=>(b-_)/(S-_)*(M-C)+C,t=b=>{let _=this.$slider.getBoundingClientRect(),S=e(b,_.left,_.right,this._min,this._max);this._snapClampSetValue(S)},r=b=>{this._setDraggingStyle(!0),t(b.clientX),window.addEventListener("mousemove",i),window.addEventListener("mouseup",s)},i=b=>{t(b.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",s)},o=!1,v,a,l=b=>{b.preventDefault(),this._setDraggingStyle(!0),t(b.touches[0].clientX),o=!1},c=b=>{b.touches.length>1||(this._hasScrollBar?(v=b.touches[0].clientX,a=b.touches[0].clientY,o=!0):l(b),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",f))},u=b=>{if(o){let _=b.touches[0].clientX-v,S=b.touches[0].clientY-a;Math.abs(_)>Math.abs(S)?l(b):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",f))}else b.preventDefault(),t(b.touches[0].clientX)},f=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",f)},p=this._callOnFinishChange.bind(this),g=400,y,A=b=>{if(Math.abs(b.deltaX)<Math.abs(b.deltaY)&&this._hasScrollBar)return;b.preventDefault();let S=this._normalizeMouseWheel(b)*this._step;this._snapClampSetValue(this.getValue()+S),this.$input.value=this.getValue(),clearTimeout(y),y=setTimeout(p,g)};this.$slider.addEventListener("mousedown",r),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",A,{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${t}`,e)}_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(e){let{deltaX:t,deltaY:r}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,r=-e.wheelDelta/120,r*=this._stepExplicit?1:10),t+-r}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){let t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},li=class extends D0{constructor(e,t,r,i){super(e,t,r,"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(i)?i:Object.values(i),this._names=Array.isArray(i)?i:Object.keys(i),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 e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=t===-1?e:this._names[t],this}},ci=class extends D0{constructor(e,t,r){super(e,t,r,"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",i=>{i.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}},w7=`.lil-gui {
|
|
287
|
+
`))A(B,I),p+=r,h="";else M&&A(M,I);if(S.extra)for(let B of S.extra)y(B,I)},A=(S,C)=>{o||(o=S.trim()!==""),h+=S,g[p]=v.measureText(h).width;let M=C.color??i;M.startsWith("#")||(M=Z6[M.toLowerCase()]||M),c.push({fontStyle:`${C.bold?"bold":""} ${C.italic?"italic":""}`,fillStyle:M,underlineStyle:C.underlined??!1,strikeStyle:C.strikethrough??!1,offset:p,text:S})};if(y(l),!u&&!l.toString().trim())return;let b=0,w=0;for(let{fillStyle:S,fontStyle:C,underlineStyle:M,strikeStyle:I,offset:B,text:H}of c){w!==B&&(b=0),w=B,v.fillStyle=S,v.textRendering="optimizeLegibility",v.font=`${C} ${r}px mojangles`;let G=g[B]??v.measureText(H).width,O=(t.width-G)/2+b;v.fillText(H,O,B),I&&(v.lineWidth=r/8,v.strokeStyle=S,v.beginPath(),v.moveTo(O,B-v.lineWidth*2.5),v.lineTo(O+v.measureText(H).width,B-v.lineWidth*2.5),v.stroke()),M&&(v.lineWidth=r/8,v.strokeStyle=S,v.beginPath(),v.moveTo(O,B+v.lineWidth),v.lineTo(O+v.measureText(H).width,B+v.lineWidth),v.stroke()),b+=v.measureText(H).width}return o};E();x();k();R();function Ht(n){let e=Math.floor(n.x/16),t=Math.floor(n.z/16);return[e,t]}function Yr(n){let e=Math.floor(n.x/16),t=Math.floor(n.y/16),r=Math.floor(n.z/16);return[e,t,r]}E();x();k();R();import{Vec3 as m1}from"vec3";import{subscribeKey as qr}from"valtio/utils";import{proxy as r7,subscribe as i7}from"valtio";E();x();k();R();var at={blocks:"blocksArray",blockCollisionShapes:"blockCollisionShapes",biomes:"biomesArray",tints:"tints"};E();x();k();R();var Es=16;var xs=(n,e)=>e?`${n}:${e}`:String(n);E();x();k();R();var Rs=0,x0={},Qr=40,vt="mc-renderer-debug-overlay",lt=(n,e=80,t=Rs,r=Qr,i)=>{if(ae)return{updateText(){},setVisibility(){}};let s=document.createElement("div");return s.style.position="fixed",s.style.top=`${r??Qr}px`,s.style.right=`${t}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",i?.className?s.className=i.className:s.style.zIndex="100",s.style.pointerEvents="none",document.body.appendChild(s),x0[n]=s,r===void 0&&t===Rs&&(Qr+=20),{updateText(o){s.innerText!==o&&(s.innerText=o)},setVisibility(o){s.style.display=o?"block":"none"}}};var Kr=(n,e)=>{ae||!x0[n]||(x0[n].innerText=e)},ks=n=>{if(!ae)for(let e in x0)x0[e].style.display=n?"block":"none"},Ts=()=>{if(!ae)for(let n in x0)X6(n)},X6=n=>{ae||!x0[n]||(x0[n].remove(),delete x0[n])};E();x();k();R();var $6=n=>{let e=n%24e3/24e3-.25;return e<0&&(e+=1),e>1&&(e-=1),e+(1-Math.cos(e*Math.PI))/2},e7=n=>{let e=(n%24e3+24e3)%24e3,t=$6(e),i=Math.cos(t*Math.PI*2)*.5+.5,s=Math.round(4+i*11);return Math.max(4,Math.min(15,s))},Jr=n=>{let e=(n%24e3+24e3)%24e3;if(e>=0&&e<12e3)return 15;if(e>=12e3&&e<13e3){let t=(e-12e3)/1e3;return Math.round(15-t*11)}else{if(e>=13e3&&e<23e3)return 4;{let t=(e-23e3)/1e3;return Math.round(4+t*11)}}},t7=()=>{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:e,label:t}of n){let r=e7(e),i=Jr(e)}};typeof window<"u"&&(window.debugSkyLight=t7);E();x();k();R();function Ue(n,e,t,r){if(n.on(e,t),r.aborted){n.off(e,t);return}r.addEventListener("abort",()=>{n.off(e,t)},{once:!0})}function Ms(n,e,t,r){if(n.on(e,t),r.aborted){n.off(e,t);return}r.addEventListener("abort",()=>{n.off(e,t)},{once:!0})}function E5(n,e){return(n%e+e)%e}var R0=class R0{constructor(e,t,r){this.resourcesManager=e;this.displayOptions=t;this.initOptions=r;d(this,"worldReadyResolvers",Promise.withResolvers());d(this,"worldReadyPromise",this.worldReadyResolvers.promise);d(this,"timeOfTheDay",0);d(this,"worldSizeParams",{minY:0,worldHeight:256});d(this,"reactiveDebugParams",r7({stopRendering:!1,chunksRenderAboveOverride:void 0,chunksRenderAboveEnabled:!1,chunksRenderBelowOverride:void 0,chunksRenderBelowEnabled:!1,chunksRenderDistanceOverride:void 0,chunksRenderDistanceEnabled:!1,disableEntities:!1}));d(this,"active",!1);d(this,"loadedChunks",{});d(this,"finishedChunks",{});d(this,"finishedSections",{});d(this,"sectionsWaiting",new Map);d(this,"queuedChunks",new Set);d(this,"queuedFunctions",[]);d(this,"renderUpdateEmitter",new q0);d(this,"customTexturesDataUrl");d(this,"workers",[]);d(this,"viewerChunkPosition");d(this,"lastViewerChunkGridX");d(this,"lastViewerChunkGridZ");d(this,"lastCamUpdate",0);d(this,"droppedFpsPercentage",0);d(this,"initialChunkLoadWasStartedIn");d(this,"initialChunksLoad",!0);d(this,"enableChunksLoadDelay",!1);d(this,"texturesVersion");d(this,"viewDistance",-1);d(this,"onRenderDistanceChanged");d(this,"chunksLength",0);d(this,"allChunksFinished",!1);d(this,"messageQueue",[]);d(this,"isProcessingQueue",!1);d(this,"ONMESSAGE_TIME_LIMIT",30);d(this,"handleResize",()=>{});d(this,"highestBlocksByChunks",new Map);d(this,"blockEntities",{});d(this,"workersProcessAverageTime",0);d(this,"workersProcessAverageTimeCount",0);d(this,"maxWorkersProcessTime",0);d(this,"workersPreAverageTime",0);d(this,"workersWasmAverageTime",0);d(this,"workersPostAverageTime",0);d(this,"workersPhaseSampleCount",0);d(this,"workersPreTargetConvertAverageTime",0);d(this,"workersPreNeighborConvertAverageTime",0);d(this,"workersPreNeighborCountAverage",0);d(this,"workersPreTypedArrayBuildAverageTime",0);d(this,"workersPreOtherAverageTime",0);d(this,"workersPreCacheHitsTotal",0);d(this,"workersPreCacheMissesTotal",0);d(this,"geometryReceiveCount",{});d(this,"allLoadedIn");d(this,"onWorldSwitched",[]);d(this,"renderTimeMax",0);d(this,"renderTimeAvg",0);d(this,"renderTimeAvgCount",0);d(this,"edgeChunks",{});d(this,"lastAddChunk",null);d(this,"neighborChunkUpdates",!0);d(this,"lastChunkDistance",0);d(this,"debugStopGeometryUpdate",!1);d(this,"protocolCustomBlocks",new Map);d(this,"heightmapDebounceTimers",new Map);d(this,"sectionDirtyCount",new Map);d(this,"sectionDirtyTimers",new Map);d(this,"sectionDirtyPendingArgs",new Map);d(this,"blockStateModelInfo",new Map);d(this,"worldBlockProvider");d(this,"soundSystem");d(this,"worldRendererConfig");d(this,"playerStateReactive");d(this,"playerStateUtils");d(this,"reactiveState");d(this,"mesherLogReader");d(this,"forceCallFromMesherReplayer",!1);d(this,"stopMesherMessagesProcessing",!1);d(this,"abortController",new AbortController);d(this,"valtioUnsubs",[]);d(this,"lastRendered",0);d(this,"renderingActive",!0);d(this,"geometryReceiveCountPerSec",0);d(this,"mesherLogger",{contents:[],active:new URL(location.href).searchParams.get("mesherlog")==="true"});d(this,"currentRenderedFrames",0);d(this,"fpsAverage",0);d(this,"lastFps",0);d(this,"fpsWorst");d(this,"fpsSamples",0);d(this,"backendInfoReport","-");d(this,"chunksFullInfo","-");d(this,"workerCustomHandleTime",0);d(this,"queueAwaited",!1);d(this,"toWorkerMessagesQueue",{});this.snapshotInitialValues(),this.worldRendererConfig=t.inWorldRenderingConfig,this.playerStateReactive=t.playerStateReactive,this.playerStateUtils=U2(this.playerStateReactive),this.reactiveState=t.rendererState,this.renderUpdateEmitter.on("update",()=>{let o=Object.keys(this.finishedChunks).length;Kr("loaded-chunks",`${o}/${this.chunksLength} chunks (${this.lastChunkDistance}/${this.viewDistance})`)}),lt("downloaded-chunks",100,140,20,{className:vt}),this.connect(this.displayOptions.worldView);let i=setInterval(()=>{this.geometryReceiveCountPerSec=Object.values(this.geometryReceiveCount).reduce((o,a)=>o+a,0),this.geometryReceiveCount={},ks(this.displayAdvancedStats),this.updateChunksStats()},500),s=setInterval(()=>{this.fpsUpdate()},1e3);this.abortController.signal.addEventListener("abort",()=>{clearInterval(i),clearInterval(s)})}anyModuleRequiresHeightmap(){return!1}isShaderCubeBlocksEnabled(){return this.worldRendererConfig.shaderCubeBlocks===!0}shaderCubeBlocksEnabled(){return this.isShaderCubeBlocksEnabled()}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(e){this.mesherLogger.active&&this.mesherLogger.contents.push(typeof e=="function"?e():e)}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()})()]);let e=async()=>{this.active&&await this.updateAssetsData()};Ms(this.resourcesManager,"assetsTexturesUpdated",e,this.abortController.signal),this.watchReactivePlayerState(),this.watchReactiveConfig(),this.worldReadyResolvers.resolve()}snapshotInitialValues(){}wasChunkSentToWorker(e){return this.loadedChunks[e]}async getHighestBlocks(e){return this.highestBlocksByChunks.get(e)}updateCustomBlock(e,t,r){if(this.protocolCustomBlocks.set(e,{...this.protocolCustomBlocks.get(e),[t]:r}),this.logWorkerWork(()=>`-> updateCustomBlock ${e} ${t} ${r} ${this.wasChunkSentToWorker(e)}`),this.wasChunkSentToWorker(e)){let[i,s,o]=t.split(",").map(Number);this.setBlockStateId(new m1(i,s,o),void 0)}}async getBlockInfo(e,t){let i=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`,s=this.protocolCustomBlocks.get(i)?.[`${e.x},${e.y},${e.z}`],o=xs(t,s),a=this.blockStateModelInfo.get(o);return{customBlockName:s,modelInfo:a}}initWorkers(e=this.worldRendererConfig.mesherWorkers){for(let t=0;t<e+0;t++){let r=n7(i=>{Array.isArray(i)?this.messageQueue.push(...i):this.messageQueue.push(i),this.processMessageQueue("worker")},this.worldRendererConfig.wasmMesher?"mesherWasm.js":"mesher.js");this.workers.push(r)}}onReactivePlayerStateUpdated(e,t,r=!0){return r&&t(this.playerStateReactive[e]),qr(this.playerStateReactive,e,t)}onReactiveConfigUpdated(e,t){t(this.worldRendererConfig[e]),e==="*"?i7(this.worldRendererConfig,t):qr(this.worldRendererConfig,e,t)}onReactiveDebugUpdated(e,t){t(this.reactiveDebugParams[e]),qr(this.reactiveDebugParams,e,t)}watchReactivePlayerState(){this.valtioUnsubs.push(this.onReactivePlayerStateUpdated("backgroundColor",e=>{this.changeBackgroundColor(e)})),this.valtioUnsubs.push(this.onReactivePlayerStateUpdated("cardinalLight",e=>{this.changeCardinalLight(e)}))}watchReactiveConfig(){this.valtioUnsubs.push(this.onReactiveConfigUpdated("fetchPlayerSkins",e=>{d1({apiEnabled:e})}))}async processMessageQueue(e){if(this.isProcessingQueue||this.messageQueue.length===0)return;if(this.logWorkerWork(`# ${e} processing queue`),this.lastRendered&&performance.now()-this.lastRendered>this.ONMESSAGE_TIME_LIMIT&&this.worldRendererConfig._experimentalSmoothChunkLoading&&this.renderingActive){let i=performance.now();await new Promise(s=>{requestAnimationFrame(s)}),this.logWorkerWork(`# processing got delayed by ${performance.now()-i}ms`)}this.isProcessingQueue=!0;let t=performance.now(),r=0;for(;this.messageQueue.length>0;){let i=this.stopMesherMessagesProcessing;if(!i){let s=this.messageQueue.shift();this.handleMessage(s),r++}if(i||performance.now()-t>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(e){var r,i;let t=e;if(this.active){if(this.mesherLogReader?.workerMessageReceived(t.type,t),t.type!=="geometry"||!this.debugStopGeometryUpdate){let s=performance.now();this.handleWorkerMessage(t),this.workerCustomHandleTime+=performance.now()-s}if(t.type==="geometry"){this.logWorkerWork(()=>`-> ${t.workerIndex} geometry ${t.key} ${JSON.stringify({dataSize:JSON.stringify(t).length})}`),(r=this.geometryReceiveCount)[i=t.workerIndex]??(r[i]=0),this.geometryReceiveCount[t.workerIndex]++;let s=t.key.split(",").map(Number);this.lastChunkDistance=Math.max(...this.getDistance(new m1(s[0],0,s[2])))}if(t.type==="sectionFinished"){if(this.logWorkerWork(`<- ${t.workerIndex} sectionFinished ${t.key} ${JSON.stringify({processTime:t.processTime})}`),!this.sectionsWaiting.has(t.key))return;this.sectionsWaiting.set(t.key,this.sectionsWaiting.get(t.key)-1),this.sectionsWaiting.get(t.key)===0&&(this.sectionsWaiting.delete(t.key),this.finishedSections[t.key]=!0);let s=t.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,c=`${Math.floor(s[0]/l)},${Math.floor(s[2]/l)}`;this.reactiveState.world.chunksLoaded[c]=!0,this.renderUpdateEmitter.emit("chunkFinished",`${s[0]},${s[2]}`),this.checkAllFinished()}}if(this.renderUpdateEmitter.emit("update"),t.processTime&&(this.workersProcessAverageTimeCount++,this.workersProcessAverageTime=(this.workersProcessAverageTime*(this.workersProcessAverageTimeCount-1)+t.processTime)/this.workersProcessAverageTimeCount,this.maxWorkersProcessTime=Math.max(this.maxWorkersProcessTime,t.processTime)),typeof t.pre=="number"&&typeof t.wasm=="number"&&typeof t.post=="number"&&(t.pre>0||t.wasm>0||t.post>0)){let a=++this.workersPhaseSampleCount;this.workersPreAverageTime=(this.workersPreAverageTime*(a-1)+t.pre)/a,this.workersWasmAverageTime=(this.workersWasmAverageTime*(a-1)+t.wasm)/a,this.workersPostAverageTime=(this.workersPostAverageTime*(a-1)+t.post)/a;let v=typeof t.preTargetConvert=="number"?t.preTargetConvert:0,l=typeof t.preNeighborConvert=="number"?t.preNeighborConvert:0,c=typeof t.preNeighborCount=="number"?t.preNeighborCount:0,u=typeof t.preTypedArrayBuild=="number"?t.preTypedArrayBuild:0,h=typeof t.preOther=="number"?t.preOther:0,p=typeof t.preCacheHits=="number"?t.preCacheHits:0,g=typeof t.preCacheMisses=="number"?t.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)+u)/a,this.workersPreOtherAverageTime=(this.workersPreOtherAverageTime*(a-1)+h)/a,this.workersPreCacheHitsTotal+=p,this.workersPreCacheMissesTotal+=g,this.worldRendererConfig.debugWasmPerf&&a%R0.PHASE_PERF_LOG_INTERVAL===0){let y=this.workersPreAverageTime+this.workersWasmAverageTime+this.workersPostAverageTime,A=y>0?this.workersPreAverageTime/y*100:0,b=y>0?this.workersWasmAverageTime/y*100:0,w=y>0?this.workersPostAverageTime/y*100:0,S=this.workersPreAverageTime,C=S>0?this.workersPreTargetConvertAverageTime/S*100:0,M=S>0?this.workersPreNeighborConvertAverageTime/S*100:0,I=S>0?this.workersPreTypedArrayBuildAverageTime/S*100:0,B=S>0?this.workersPreOtherAverageTime/S*100:0,H=this.workersPreNeighborCountAverage,G=H>0?this.workersPreNeighborConvertAverageTime/H:0,O=this.workersPreCacheHitsTotal+this.workersPreCacheMissesTotal,j=O>0?this.workersPreCacheHitsTotal/O*100:0}}}if(t.type==="blockStateModelInfo")for(let[s,o]of Object.entries(t.info))this.blockStateModelInfo.set(s,o);if(t.type==="heightmap"){let s=new Int16Array(t.heightmap);this.reactiveState.world.heightmaps[t.key]=s}}}downloadMesherLog(){let e=document.createElement("a");e.href="data:text/plain;charset=utf-8,"+encodeURIComponent(this.mesherLogger.contents.join(`
|
|
288
|
+
`)),e.download="mesher.log",e.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(e,t){}updateViewerPosition(e){this.viewerChunkPosition=e;for(let[i,s]of Object.entries(this.loadedChunks))s&&this.updatePosDataChunk?.(i);let t=Math.floor(e.x/16),r=Math.floor(e.z/16);(t!==this.lastViewerChunkGridX||r!==this.lastViewerChunkGridZ)&&(this.lastViewerChunkGridX=t,this.lastViewerChunkGridZ=r,this.onViewerChunkPositionChanged())}onViewerChunkPositionChanged(){}sendWorkers(e){for(let t of this.workers)t.postMessage(e)}getDistance(e){let[t,r]=Ht(this.viewerChunkPosition),i=16,s=Math.abs(t-Math.floor(e.x/i)),o=Math.abs(r-Math.floor(e.z/i));return[s,o]}resetWorld(){for(let e of this.workers)e.terminate();this.workers=[]}async resetWorkers(){this.resetWorld(),typeof document<"u"&&document?.readyState==="loading"&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",e)}),this.initWorkers(),this.active=!0,this.sendMesherMcData()}getMesherConfig(){let e=this.timeOfTheDay,t=e<0||e>24e3?15:Jr(e);return{version:this.version,enableLighting:this.worldRendererConfig.enableLighting,skyLight:t,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,shaderCubeBlocks:this.isShaderCubeBlocksEnabled()}}sendMesherMcData(){let e=this.resourcesManager.currentResources.mcData;Cs(this.workers,this.version,at,e),this.logWorkerWork("# mcData sent")}async updateAssetsData(){let e=this.resourcesManager.currentResources;if(this.workers.length===0)throw new Error("workers not initialized yet");for(let[t,r]of this.workers.entries()){let{blockstatesModels:i}=e;r.postMessage({type:"mesherData",workerIndex:t,blocksAtlas:{latest:e.blocksAtlasJson},blockstatesModels:i,config:this.getMesherConfig()})}this.logWorkerWork("# mesherData sent")}getSectionHeight(){return Es}get worldMinYRender(){let e=this.getSectionHeight();return Math.floor(Math.max(this.worldSizeParams.minY,this.worldRendererConfig.clipWorldBelowY??-1/0)/e)*e}updateChunksStats(){let e=Object.keys(this.finishedChunks);this.displayOptions.nonReactiveState.world.chunksLoadedCount=e.length,this.displayOptions.nonReactiveState.world.chunksTotalNumber=this.chunksLength,this.reactiveState.world.allChunksLoaded=this.allChunksFinished;let t=`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=t,this.displayOptions.nonReactiveState.world.chunksFullInfo=t,Kr("downloaded-chunks",t)}addColumn(e,t,r,i){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[`${e},${t}`]=!0,this.updateChunksStats();let s=`${e},${t}`,o=this.protocolCustomBlocks.get(s);for(let l of this.workers)l.postMessage({type:"chunk",x:e,z:t,chunk:r,customBlockModels:o||void 0});this.worldRendererConfig.wasmMesher||this.workers[0].postMessage({type:"getHeightmap",x:e,z:t}),this.logWorkerWork(()=>`-> chunk ${JSON.stringify({x:e,z:t,chunkLength:r.length,customBlockModelsLength:o?Object.keys(o).length:0})}`),this.mesherLogReader?.chunkReceived(e,t,r.length);let a=this.getSectionHeight(),v=16;for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=a){let c=new m1(e,l,t);this.setSectionDirty(c),this.neighborChunkUpdates&&(!i||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(e,t){this.loadedChunks[`${e},${t}`]=!0,this.finishedChunks[`${e},${t}`]=!0,this.logWorkerWork(`-> markAsLoaded ${JSON.stringify({x:e,z:t})}`),this.renderUpdateEmitter.emit("chunkFinished",`${e},${t}`),this.checkAllFinished()}removeColumn(e,t){var a;delete this.loadedChunks[`${e},${t}`];let r=`${e},${t}`,i=this.heightmapDebounceTimers.get(r);i&&(clearTimeout(i),this.heightmapDebounceTimers.delete(r));for(let[v,l]of this.sectionDirtyTimers)v.startsWith(`${e},`)&&v.endsWith(`,${t}`)&&(clearTimeout(l),this.sectionDirtyTimers.delete(v),this.sectionDirtyCount.delete(v),this.sectionDirtyPendingArgs.delete(v));for(let v=0;v<this.workers.length;v++)(a=this.toWorkerMessagesQueue)[v]??(a[v]=[]),this.toWorkerMessagesQueue[v].push({type:"unloadChunk",x:e,z:t});this.dispatchMessages(),this.logWorkerWork(`-> unloadChunk ${JSON.stringify({x:e,z:t})}`),delete this.finishedChunks[`${e},${t}`],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 v=this.worldMinYRender;v<this.worldSizeParams.worldHeight;v+=s){let l=`${e},${v},${t}`,c=this.sectionsWaiting.get(l);c!==void 0&&c>0,this.sectionsWaiting.delete(l),delete this.finishedSections[l]}this.highestBlocksByChunks.delete(`${e},${t}`);let o=`${Math.floor(e/16)},${Math.floor(t/16)}`;delete this.reactiveState.world.heightmaps[o],this.updateChunksStats(),Object.keys(this.loadedChunks).length===0&&(this.mesherLogger.contents=[],this.logWorkerWork("# all chunks unloaded. New log started"),this.mesherLogReader?.maybeStartReplay())}setBlockStateId(e,t,r=!0){(async()=>{let o=Math.floor(e.x/16)*16,a=Math.floor(e.z/16)*16;this.queuedChunks.has(`${o},${a}`)&&await new Promise(v=>{this.queuedFunctions.push(()=>{v()})}),this.loadedChunks[`${o},${a}`],this.setBlockStateIdInner(e,t,r)})()}updateEntity(e,t=!1){}lightUpdate(e,t){}connect(e){let t=e,r=this.abortController.signal;Ue(t,"entity",s=>{this.updateEntity(s,!1)},r),Ue(t,"entityMoved",s=>{this.updateEntity(s,!0)},r),Ue(t,"playerEntity",s=>{this.updatePlayerEntity?.(s)},r);let i=null;Ue(t,"loadChunk",({x:s,z:o,chunk:a,worldConfig:v,isLightUpdate:l})=>{this.worldSizeParams=v,this.queuedChunks.add(`${s},${o}`);let c=[s,o,a,l];i||(i={data:[],timeout:setTimeout(()=>{for(let u of i.data)this.queuedChunks.delete(`${u[0]},${u[1]}`),this.addColumn(...u);for(let u of this.queuedFunctions)u();this.queuedFunctions=[],i=null},this.worldRendererConfig.addChunksBatchWaitTime)}),i.data.push(c)},r),Ue(t,"blockEntities",s=>{this.blockEntities=s},r),Ue(t,"unloadChunk",({x:s,z:o})=>{this.removeColumn(s,o)},r),Ue(t,"blockUpdate",({pos:s,stateId:o})=>{this.setBlockStateId(new m1(s.x,s.y,s.z),o)},r),Ue(t,"chunkPosUpdate",({pos:s})=>{this.updateViewerPosition(s)},r),Ue(t,"end",()=>{this.worldStop?.()},r),Ue(t,"renderDistance",s=>{this.viewDistance=s,this.chunksLength=s===0?1:c5(s).length,this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,this.onRenderDistanceChanged?.(s)},r),Ue(t,"markAsLoaded",({x:s,z:o})=>{this.markAsLoaded(s,o)},r),Ue(t,"updateLight",({pos:s})=>{this.lightUpdate(s.x,s.z)},r),Ue(t,"onWorldSwitch",()=>{for(let s of this.onWorldSwitched)try{s()}catch(o){setTimeout(()=>{throw o},0)}},r),Ue(t,"time",s=>{this.worldRendererConfig.dayCycle&&(this.timeUpdated?.(s),this.timeOfTheDay=s)},r),Ue(t,"biomeUpdate",({biome:s})=>{this.biomeUpdated?.(s)},r),Ue(t,"biomeReset",()=>{this.biomeReset?.()},r)}setBlockStateIdInner(e,t,r=!0){let s=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`,o=`${e.x},${e.y},${e.z}`,a=this.protocolCustomBlocks.get(s)||{};for(let v of this.workers)v.postMessage({type:"blockUpdate",pos:e,stateId:t,customBlockModels:a});if(this.anyModuleRequiresHeightmap()){let v=Math.floor(e.x/16)*16,l=Math.floor(e.z/16)*16,c=`${v},${l}`;if(!this.worldRendererConfig.wasmMesher){let u=this.heightmapDebounceTimers.get(c);u&&clearTimeout(u),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:e,stateId:t,customBlockModels:a})}`),this.setSectionDirty(e,!0,!0),this.neighborChunkUpdates){let l=this.getSectionHeight();e.x&15||this.setSectionDirty(e.offset(-16,0,0),!0,!0),(e.x&15)===15&&this.setSectionDirty(e.offset(16,0,0),!0,!0),e.y&l-1||this.setSectionDirty(e.offset(0,-l,0),!0,!0),(e.y&l-1)===l-1&&this.setSectionDirty(e.offset(0,l,0),!0,!0),e.z&15||this.setSectionDirty(e.offset(0,0,-16),!0,!0),(e.z&15)===15&&this.setSectionDirty(e.offset(0,0,16),!0,!0),r&&(!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,0,-16),!0,!0),(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,0,-16),!0,!0),!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,0,16),!0,!0),(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,0,16),!0,!0),!(e.x&15)&&!(e.y&l-1)&&this.setSectionDirty(e.offset(-16,-l,0),!0,!0),(e.x&15)===15&&!(e.y&l-1)&&this.setSectionDirty(e.offset(16,-l,0),!0,!0),!(e.z&15)&&!(e.y&l-1)&&this.setSectionDirty(e.offset(0,-l,-16),!0,!0),(e.z&15)===15&&!(e.y&l-1)&&this.setSectionDirty(e.offset(0,-l,16),!0,!0),!(e.y&l-1)&&!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,-l,-16),!0,!0),!(e.y&l-1)&&(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,-l,-16),!0,!0),!(e.y&l-1)&&!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,-l,16),!0,!0),!(e.y&l-1)&&(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,-l,16),!0,!0))}}getWorkerNumber(e,t=!1){let i=this.getSectionHeight();if(this.worldRendererConfig.dedicatedChangeWorker&&this.workers.length>1){if(this.worldRendererConfig.wasmMesher)return E5(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let a=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(this.sectionsWaiting.get(a)&&!this.finishedSections[a]){let l=this.workers.length-1;return E5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),l)}return this.workers.length-1}let o=this.workers.length-1;return E5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),o)}if(this.worldRendererConfig.wasmMesher)return E5(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let o=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(!(this.sectionsWaiting.get(o)&&!this.finishedSections[o]))return 0}return E5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),this.workers.length)}async debugGetWorkerCustomBlockModel(e){let t=[];for(let r of this.workers)t.push(new Promise(i=>{r.addEventListener("message",s=>{s.data.type==="customBlockModel"&&i(s.data.customBlockModel)})})),r.postMessage({type:"getCustomBlockModel",pos:e});return Promise.all(t)}setSectionDirty(e,t=!0,r=!1){if(!this.forceCallFromMesherReplayer&&this.mesherLogReader)return;if(this.viewDistance===-1)throw new Error("viewDistance not set");let i=this.getDistance(e);if(!this.workers.length||i[0]>this.viewDistance||i[1]>this.viewDistance)return;if(!t){this._dispatchDirtyImmediate(e,t,r);return}let s=16,o=this.getSectionHeight(),a=`${Math.floor(e.x/s)*s},${Math.floor(e.y/o)*o},${Math.floor(e.z/s)*s}`,v=(this.sectionDirtyCount.get(a)??0)+1;this.sectionDirtyCount.set(a,v),v<=R0.GEOMETRY_THROTTLE_THRESHOLD?(this._dispatchDirtyImmediate(e,t,r),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)},R0.GEOMETRY_THROTTLE_DELAY))):(this.sectionDirtyPendingArgs.set(a,{pos:e,value:t,useChangeWorker:r}),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)},R0.GEOMETRY_THROTTLE_DELAY)))}_dispatchDirtyImmediate(e,t,r){var v;this.reactiveState.world.mesherWork=!0;let i=16,s=this.getSectionHeight(),o=`${Math.floor(e.x/i)*i},${Math.floor(e.y/s)*s},${Math.floor(e.z/i)*i}`;this.renderUpdateEmitter.emit("dirty",e,t);let a=this.getWorkerNumber(e,r&&(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:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}):((v=this.toWorkerMessagesQueue)[a]??(v[a]=[]),this.toWorkerMessagesQueue[a].push({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}),this.dispatchMessages())}dispatchMessages(){this.queueAwaited||(this.queueAwaited=!0,setTimeout(()=>{for(let e in this.toWorkerMessagesQueue){let t=this.workers[Number(e)],r=this.toWorkerMessagesQueue[e];t.postMessage(r);for(let i of r)this.logWorkerWork(`-> ${e} dispatchMessages ${i.type} ${JSON.stringify({x:i.x,y:i.y,z:i.z,value:i.value})}`)}this.toWorkerMessagesQueue={},this.queueAwaited=!1}))}async waitForChunksToRender(){return new Promise((e,t)=>{if([...this.sectionsWaiting].length===0){e();return}let r=()=>{this.sectionsWaiting.size===0&&(this.renderUpdateEmitter.removeListener("update",r),e())};this.renderUpdateEmitter.on("update",r)})}async waitForChunkToLoad(e){return new Promise((t,r)=>{let s=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`;if(this.loadedChunks[s]){t();return}let o=()=>{this.loadedChunks[s]&&(this.renderUpdateEmitter.removeListener("update",o),t())};this.renderUpdateEmitter.on("update",o)})}destroy(){for(let e of this.valtioUnsubs)e();this.valtioUnsubs=[];for(let e of this.heightmapDebounceTimers.values())clearTimeout(e);this.heightmapDebounceTimers.clear();for(let e of this.sectionDirtyTimers.values())clearTimeout(e);this.sectionDirtyTimers.clear(),this.sectionDirtyCount.clear(),this.sectionDirtyPendingArgs.clear();for(let e of this.workers)e.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(),Ts()}};d(R0,"PHASE_PERF_LOG_INTERVAL",64),d(R0,"GEOMETRY_THROTTLE_THRESHOLD",1),d(R0,"GEOMETRY_THROTTLE_DELAY",100);var p1=R0,n7=(n,e="mesher.js")=>{let t;if(D.env.SINGLE_FILE_BUILD){let r=document.getElementById("mesher-worker-code").textContent,i=new Blob([r],{type:"text/javascript"});t=new Worker(window.URL.createObjectURL(i))}else t=new Worker(e);return t.onmessage=({data:r})=>{n(r)},t.on&&t.on("message",r=>{t.onmessage({data:r})}),t},Ss=!1,Cs=(n,e,t=at,r)=>{let i={version:JSON.parse(JSON.stringify(r.version))};for(let[s,o]of Object.entries(t))i[s]=r[o];"tints"in t&&!i.tints&&!Ss&&(Ss=!0);for(let s of n)s.postMessage({type:"mcData",mcData:i})},Zr=(n,e,t=at,r,i=1e4)=>Promise.all(n.map(s=>new Promise((o,a)=>{let v=setTimeout(()=>{s.removeEventListener("message",l),a(new Error(`mcData transfer timeout (${i}ms)`))},i),l=({data:c})=>{c?.type==="mcDataApplied"&&(clearTimeout(v),s.removeEventListener("message",l),o())};s.addEventListener("message",l),Cs([s],e,t,r)}))).then(()=>{});E();x();k();R();import{Vec3 as s7}from"vec3";import*as r0 from"three";E();x();k();R();function g1(n,e){let t=e/180*Math.PI,r=Math.cos(t),i=Math.sin(t),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]=r,v[o][a]=-i,v[a][o]=+i,v[a][a]=r,v}function Xr(n,e){return e?[n[0]+e[0],n[1]+e[1],n[2]+e[2]]:n}function $r(n,e){return e?[n[0]-e[0],n[1]-e[1],n[2]-e[2]]:n}function Ot(n,e){return n?[n[0][0]*e[0]+n[0][1]*e[1]+n[0][2]*e[2],n[1][0]*e[0]+n[1][1]*e[1]+n[1][2]*e[2],n[2][0]*e[0]+n[2][1]*e[1]+n[2][2]*e[2]]:e}function Bs(n,e){let t=[[0,0,0],[0,0,0],[0,0,0]],r=n[0][0],i=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],u=n[2][2],h=e[0][0],p=e[1][0],g=e[2][0],y=e[0][1],A=e[1][1],b=e[2][1],w=e[0][2],S=e[1][2],C=e[2][2];return t[0][0]=r*h+i*y+s*w,t[1][0]=r*p+i*A+s*S,t[2][0]=r*g+i*b+s*C,t[0][1]=o*h+a*y+v*w,t[1][1]=o*p+a*A+v*S,t[2][1]=o*g+a*b+v*C,t[0][2]=l*h+c*y+u*w,t[1][2]=l*p+c*A+u*S,t[2][2]=l*g+c*b+u*C,t}var ei={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 o7(n,e,t,r,i,s,o,a){let v=new s7(0,0,0);for(let l in n.faces){let c=n.faces[l],{corners:u,mask1:h,mask2:p}=ei[l],g=Ot(r,ei[l].dir);if(c.cullface&&a[l])continue;let y=n.from[0],A=n.from[1],b=n.from[2],w=n.to[0],S=n.to[1],C=n.to[2],M=c.texture,{u:I}=M,{v:B}=M,{su:H}=M,{sv:G}=M,O=Math.floor(t.positions.length/3),j=[1,1,1];c.tintindex!==void 0&&c.tintindex===0&&(j=[.5686274509803921,.7411764705882353,.34901960784313724]);let J=c.rotation||0,q=Math.cos(J*Math.PI/180),$=-Math.sin(J*Math.PI/180),ue=null,le=null;n.rotation&&(ue=g1(n.rotation.axis,n.rotation.angle),le=$r(n.rotation.origin,Ot(ue,n.rotation.origin)));let ce=[],Ee=1;for(let Ie of u){let se=[Ie[0]?w:y,Ie[1]?S:A,Ie[2]?C:b];se=Xr(Ot(ue,se),le),se=Xr(Ot(r,se),i),se=se.map(Je=>Je/16),t.positions.push(se[0],se[1],se[2]),t.normals.push(...g);let Y=(Ie[3]-.5)*q-(Ie[4]-.5)*$+.5,oe=(Ie[3]-.5)*$+(Ie[4]-.5)*q+.5;t.uvs.push(Y*H+I,oe*G+B);let xe=1;e&&(xe=4/4*(15/15),ce.push(3)),t.colors.push(Ee*j[0]*xe,Ee*j[1]*xe,Ee*j[2]*xe)}e&&ce[0]+ce[3]>=ce[1]+ce[2]?t.indices.push(O,O+3,O+2,O,O+1,O+3):t.indices.push(O,O+1,O+2,O+2,O+1,O+3)}}var a7=(n,e,t,r,i=[],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[u,h]of n.entries()){let p=h[i[u]]??h[0];if(!p)continue;let g=null,y=null;for(let b of["x","y","z"])b in p&&(g?g=Bs(g,g1(b,-(p[b]??0))):g=g1(b,-(p[b]??0)));g&&(y=[8,8,8],y=$r(y,Ot(g,y)));let A=p.ao??!0;for(let b of p.elements??[])o7(b,A,l,g,y,e,t,s)}let c=l.positions.length/3;for(let u=0;u<l.t_positions.length/12;u++)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},v7=(...n)=>{let t={geometry:a7(...n)},r=new r0.BufferGeometry;return r.setAttribute("position",new r0.BufferAttribute(t.geometry.positions,3)),r.setAttribute("normal",new r0.BufferAttribute(t.geometry.normals,3)),r.setAttribute("color",new r0.BufferAttribute(t.geometry.colors,3)),r.setAttribute("uv",new r0.BufferAttribute(t.geometry.uvs,2)),r.setIndex(t.geometry.indices),r.name="block-geometry",r},ti=(n,...e)=>{let t=v7(...e),r=new r0.Mesh(t,n);r.position.set(-.5,-.5,-.5);let i=new r0.Group;return i.add(r),i.rotation.set(0,-r0.MathUtils.degToRad(90),0,"ZYX"),globalThis.mesh=i,i},Ps=(n,e)=>{n.position.set(e.x+.5,e.y+.5,e.z+.5)};E();x();k();R();import*as De from"three";var x5=async(n,e)=>{let t;if(!n&&!e){let{canvas:l}=await y0($e);t=new De.CanvasTexture(l)}else{if(n||(n=await H0(e,"skin")),!n)return;let{canvas:l}=await y0(n);t=new De.CanvasTexture(l)}t.magFilter=De.NearestFilter,t.minFilter=De.NearestFilter;let r=!1,s=l7(40,16,r?-2:-3,-2,-2,r?3:4,12,4,64,64),o=new De.MeshStandardMaterial;o.map=t,o.needsUpdate=!0;let a=new De.Mesh(s,o),v=new De.Group;return v.add(a),v};function l7(n,e,t,r,i,s,o,a,v,l,c=!1){let u=t/16,h=r/16,p=i/16,g=(t+s)/16,y=(r+o)/16,A=(i+a)/16;c&&([u,g]=[g,u]);let b=[[u,h,p],[g,h,p],[g,y,p],[u,y,p],[u,h,A],[g,h,A],[g,y,A],[u,y,A]],w=n,S=n+a,C=n+a+s,M=n+a+s+s,I=n+a+s+a,B=n+a+s+a+s,H=e,G=e+a,O=e+a+o,j=[{vi:[5,4,0,1],uv:[S,H,C,G],n:[0,-1,0]},{vi:[2,3,7,6],uv:[C,G,M,H],n:[0,1,0]},{vi:[0,4,7,3],uv:[w,G,S,O],n:[-1,0,0]},{vi:[1,0,3,2],uv:[S,G,C,O],n:[0,0,-1]},{vi:[5,1,2,6],uv:[C,G,I,O],n:[1,0,0]},{vi:[4,5,6,7],uv:[I,G,B,O],n:[0,0,1]}],J=[],q=[],$=[],ue=[];for(let ce=0;ce<j.length;ce++){let Ee=j[ce],Ie=ce*4,[se,Y,oe,xe]=Ee.uv,Je=[[oe/v,1-Y/l],[se/v,1-Y/l],[se/v,1-xe/l],[oe/v,1-xe/l]],Ve=c?[3,2,1,0]:[0,1,2,3],n0=c?-Ee.n[0]:Ee.n[0];for(let _e=0;_e<4;_e++){let f0=b[Ee.vi[Ve[_e]]];J.push(f0[0],f0[1],f0[2]),q.push(Je[_e][0],Je[_e][1]),$.push(n0,Ee.n[1],Ee.n[2])}ue.push(Ie,Ie+1,Ie+2,Ie,Ie+2,Ie+3)}let le=new De.BufferGeometry;return le.setAttribute("position",new De.Float32BufferAttribute(J,3)),le.setAttribute("uv",new De.Float32BufferAttribute(q,2)),le.setAttribute("normal",new De.Float32BufferAttribute($,3)),le.setIndex(ue),le}E();x();k();R();E();x();k();R();import*as Se from"three";E();x();k();R();E();x();k();R();var O0=class n{constructor(e,t,r,i,s="div"){this.parent=e,this.object=t,this.property=r,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(i),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(r)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,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(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),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)}},ri=class extends O0{constructor(e,t,r){super(e,t,r,"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 ii(n){let e,t;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}var c7={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:ii,toHexString:ii},k5={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},d7={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,t=1){let r=k5.fromHexString(n);e[0]=(r>>16&255)/255*t,e[1]=(r>>8&255)/255*t,e[2]=(r&255)/255*t},toHexString([n,e,t],r=1){r=255/r;let i=n*r<<16^e*r<<8^t*r<<0;return k5.toHexString(i)}},u7={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,t=1){let r=k5.fromHexString(n);e.r=(r>>16&255)/255*t,e.g=(r>>8&255)/255*t,e.b=(r&255)/255*t},toHexString({r:n,g:e,b:t},r=1){r=255/r;let i=n*r<<16^e*r<<8^t*r<<0;return k5.toHexString(i)}},f7=[c7,k5,d7,u7];function h7(n){return f7.find(e=>e.match(n))}var ni=class extends O0{constructor(e,t,r,i){super(e,t,r,"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=h7(this.initialValue),this._rgbScale=i,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=ii(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(e){if(this._format.isPrimitive){let t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),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}},R5=class extends O0{constructor(e,t,r){super(e,t,r,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",i=>{i.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},si=class extends O0{constructor(e,t,r,i,s,o){super(e,t,r,"number"),this._initInput(),this.min(i),this.max(s);let a=o!==void 0;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.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 t=()=>{let w=parseFloat(this.$input.value);isNaN(w)||(this._stepExplicit&&(w=this._snap(w)),this.setValue(this._clamp(w)))},r=w=>{let S=parseFloat(this.$input.value);isNaN(S)||(this._snapClampSetValue(S+w),this.$input.value=this.getValue())},i=w=>{w.key==="Enter"&&this.$input.blur(),w.code==="ArrowUp"&&(w.preventDefault(),r(this._step*this._arrowKeyMultiplier(w))),w.code==="ArrowDown"&&(w.preventDefault(),r(this._step*this._arrowKeyMultiplier(w)*-1))},s=w=>{this._inputFocused&&(w.preventDefault(),r(this._step*this._normalizeMouseWheel(w)))},o=!1,a,v,l,c,u,h=5,p=w=>{a=w.clientX,v=l=w.clientY,o=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",y)},g=w=>{if(o){let S=w.clientX-a,C=w.clientY-v;Math.abs(C)>h?(w.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(S)>h&&y()}if(!o){let S=w.clientY-l;u-=S*this._step*this._arrowKeyMultiplier(w),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}l=w.clientY},y=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",y)},A=()=>{this._inputFocused=!0},b=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",t),this.$input.addEventListener("keydown",i),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",p),this.$input.addEventListener("focus",A),this.$input.addEventListener("blur",b)}_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 e=(b,w,S,C,M)=>(b-w)/(S-w)*(M-C)+C,t=b=>{let w=this.$slider.getBoundingClientRect(),S=e(b,w.left,w.right,this._min,this._max);this._snapClampSetValue(S)},r=b=>{this._setDraggingStyle(!0),t(b.clientX),window.addEventListener("mousemove",i),window.addEventListener("mouseup",s)},i=b=>{t(b.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",s)},o=!1,a,v,l=b=>{b.preventDefault(),this._setDraggingStyle(!0),t(b.touches[0].clientX),o=!1},c=b=>{b.touches.length>1||(this._hasScrollBar?(a=b.touches[0].clientX,v=b.touches[0].clientY,o=!0):l(b),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",h))},u=b=>{if(o){let w=b.touches[0].clientX-a,S=b.touches[0].clientY-v;Math.abs(w)>Math.abs(S)?l(b):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",h))}else b.preventDefault(),t(b.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",h)},p=this._callOnFinishChange.bind(this),g=400,y,A=b=>{if(Math.abs(b.deltaX)<Math.abs(b.deltaY)&&this._hasScrollBar)return;b.preventDefault();let S=this._normalizeMouseWheel(b)*this._step;this._snapClampSetValue(this.getValue()+S),this.$input.value=this.getValue(),clearTimeout(y),y=setTimeout(p,g)};this.$slider.addEventListener("mousedown",r),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",A,{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${t}`,e)}_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(e){let{deltaX:t,deltaY:r}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,r=-e.wheelDelta/120,r*=this._stepExplicit?1:10),t+-r}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){let t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},oi=class extends O0{constructor(e,t,r,i){super(e,t,r,"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(i)?i:Object.values(i),this._names=Array.isArray(i)?i:Object.keys(i),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 e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=t===-1?e:this._names[t],this}},ai=class extends O0{constructor(e,t,r){super(e,t,r,"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",i=>{i.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}},m7=`.lil-gui {
|
|
289
289
|
font-family: var(--font-family);
|
|
290
290
|
font-size: var(--font-size);
|
|
291
291
|
line-height: 1;
|
|
@@ -716,11 +716,11 @@ void main() {
|
|
|
716
716
|
@font-face {
|
|
717
717
|
font-family: "lil-gui";
|
|
718
718
|
src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB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Ptp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");
|
|
719
|
-
}`;function A7(n){let e=document.createElement("style");e.innerHTML=n;let t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}var zs=!1,di=class n{constructor({parent:e,autoPlace:t=e===void 0,container:r,width:i,title:s="Controls",closeFolders:o=!1,injectStyles:v=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.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"),a&&this.domElement.classList.add("allow-touch-styles"),!zs&&v&&(A7(w7),zs=!0),r?r.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),i&&this.domElement.style.setProperty("--width",i+"px"),this._closeFolders=o}add(e,t,r,i,s){if(Object(r)===r)return new li(this,e,t,r);switch(typeof e[t]){case"number":return new vi(this,e,t,r,i,s);case"boolean":return new si(this,e,t);case"string":return new ci(this,e,t);case"function":return new M5(this,e,t)}}addColor(e,t,r=1){return new ai(this,e,t,r)}addFolder(e){let t=new n({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(r=>{r instanceof M5||r._name in e.controllers&&r.load(e.controllers[r._name])}),t&&e.folders&&this.folders.forEach(r=>{r._title in e.folders&&r.load(e.folders[r._title])}),this}save(e=!0){let t={controllers:{},folders:{}};return this.controllers.forEach(r=>{if(!(r instanceof M5)){if(r._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${r._name}"`);t.controllers[r._name]=r.save()}}),e&&this.folders.forEach(r=>{if(r._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${r._title}"`);t.folders[r._title]=r.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");let r=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",r))};this.$children.addEventListener("transitionend",r);let i=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=i+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(r=>r.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}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(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}},ui=di;var T0=class{constructor(e,t,r,i){d(this,"gui",null);d(this,"storageKey","");d(this,"target");d(this,"params",[]);d(this,"paramsMeta",{});d(this,"_visible",!1);d(this,"initialValues",{});d(this,"initialized",!1);if(!le){this.gui=new ui,this.storageKey=`debug_params_${e}`,this.target=t,this.paramsMeta=i??{},this.params=r??Object.keys(t);for(let s of this.params)this.initialValues[s]=t[s];this.gui.domElement.style.display="none"}}activate(){return le?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return le?!1:this._visible}set visible(e){le||!this.gui||(this._visible=e,this.gui.domElement.style.display=e?"block":"none",this.saveVisibility())}loadSavedValues(){if(!le)try{let e=localStorage.getItem(this.storageKey);if(e){let t=JSON.parse(e);for(let r of this.params)if(r in t){let i=t[r];i!==null&&(this.target[r]=i)}}}catch{}}saveValues(e=!1){if(!le)try{let t={};for(let r of this.params)t[r]=this.target[r];e?localStorage.removeItem(this.storageKey):localStorage.setItem(this.storageKey,JSON.stringify(t))}catch{}}saveVisibility(){if(!le)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch{}}setupControls(){if(!(le||!this.gui)){this.gui.add(this,"visible").name("Show Controls"),this.gui.add({resetAll:()=>{if(this.gui){for(let e of this.params)this.target[e]=this.initialValues[e];this.saveValues(!0),this.gui.destroy(),this.gui=new ui,this.setupControls()}}},"resetAll").name("Reset All Parameters");for(let e of this.params){let t=this.target[e],r=this.paramsMeta[e]??{};if(typeof t=="number"){let i=r.min??t-Math.abs(t*2),s=r.max??t+Math.abs(t*2),o=r.step??Math.abs(t)/100;this.gui.add(this.target,e,i,s,o).onChange(()=>this.saveValues())}else if(typeof t=="boolean")this.gui.add(this.target,e).onChange(()=>this.saveValues());else if(typeof t=="string"&&["x","y","z"].includes(e)){let i=r.min??-10,s=r.max??10,o=r.step??.1;this.gui.add(this.target,e,i,s,o).onChange(()=>this.saveValues())}else Array.isArray(t)&&this.gui.add(this.target,e,t).onChange(()=>this.saveValues())}}}save(){le||(this.saveValues(),this.saveVisibility())}destroy(){le||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};E();x();k();R();E();x();k();R();var w1=class{constructor(){d(this,"currentAnimation",null);d(this,"isAnimating",!1);d(this,"cancelRequested",!1);d(this,"completionCallbacks",[]);d(this,"currentCancelCallback",null)}async startAnimation(e,t){return this.isAnimating&&await this.cancelCurrentAnimation(),new Promise(r=>{this.isAnimating=!0,this.cancelRequested=!1,this.currentCancelCallback=t??null,this.currentAnimation=e(),this.completionCallbacks.push(()=>{this.isAnimating=!1,this.currentAnimation=null,r()})})}async cancelCurrentAnimation(){if(this.isAnimating){if(this.currentCancelCallback){let e=this.currentCancelCallback;this.currentCancelCallback=null,e()}return new Promise(e=>{this.cancelRequested=!0,this.completionCallbacks.push(()=>{e()})})}}animationCycleFinish(){this.cancelRequested&&this.forceFinish()}forceFinish(e=!0){if(!this.isAnimating)return;if(this.currentAnimation){for(let r of this.currentAnimation.getAll())r.stop();this.currentAnimation.removeAll(),this.currentAnimation=null}this.isAnimating=!1,this.cancelRequested=!1;let t=[...this.completionCallbacks];if(this.completionCallbacks=[],e)for(let r of t)r()}update(){this.currentAnimation&&this.currentAnimation.update()}get isActive(){return this.isAnimating}get shouldCancel(){return this.cancelRequested}};var E7={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},dt=class{constructor(e,t,r){this.getState=e;this.setState=t;d(this,"animationController",new w1);d(this,"defaultState");d(this,"speeds");d(this,"currentStateName","");d(this,"transitioningToStateName","");this.speeds={...E7},r&&Object.assign(this.speeds,r),this.defaultState=this.getState()}calculateDuration(e){let t=0,r=this.getState();for(let[i,s]of Object.entries(e)){let o=r[i],v=Math.abs(s-o),a=this.getPropertySpeed(i),l=v/a*1e3;t=Math.max(t,l)}return Math.min(Math.max(t,200),2e3)}getPropertySpeed(e){return e in this.speeds?this.speeds[e]:e.toLowerCase().includes("rotation")?this.speeds.rotation:e.toLowerCase().includes("scale")?this.speeds.scale:e.toLowerCase()==="x"||e.toLowerCase()==="y"||e.toLowerCase()==="z"?this.speeds[e]:this.speeds.default}startTransition(e,t,r,i=He.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=t??"";let o=this.getState(),v=this.calculateDuration(e);this.animationController.startAnimation(()=>{let a=new Bt;return new De(o,a).to(e,v).easing(i).onUpdate(l=>{for(let c of Object.keys(l))this.setState(c,l[c])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",r?.()}).start(),a},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(e,t,r,i){this.startTransition(e,t,r,He.Linear.None,i)}getCurrentValue(e){return this.getState()[e]}get isTransitioning(){return this.animationController.isActive}};E();x();k();R();import{subscribeKey as x7}from"valtio/utils";function A1(n,e,t,r,i){let s=0,o,v=async()=>{let a=++s,l=await n(e[t]);a===s?(o&&i?.(o),r(l),o=l):i?.(l)};return v(),x7(e,t,v)}E();x();k();R();var Ls=Math.PI/180;function E1(n){let{walkDist:e,prevWalkDist:t,bob:r,prevBob:i,partialTick:s}=n,o=e-t,v=-(e+o*s),a=i+(r-i)*s,l=Math.sin(v*Math.PI),c=Math.cos(v*Math.PI);return{position:{x:l*a*.5,y:-Math.abs(c*a)},rotation:{x:Math.abs(Math.cos(v*Math.PI-.2)*a)*5*Ls,z:l*a*3*Ls}}}E();x();k();R();var x1=n=>({"minecraft:display_context":"firstperson","minecraft:use_duration":n.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!n.playerStateReactive.itemUsageTicks}),R7=()=>({"minecraft:display_context":"firstperson"}),Ft=(n,e)=>{if(!e)return"empty";if(e.type==="hand")return"hand";let t=e.name??(e.id!==void 0?`#${e.id}`:"unknown");if(!n.resourcesManager.currentResources)return`${e.type}:${t}`;let r=n.getItemRenderData({...e.fullItem,itemId:e.id},R7());return`${e.type}:${t}:${r.modelName}`};var Ye=new Ce.Matrix4,Us=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function k7(n,e){let t=new Ce.Matrix4,r=1,i=Math.sqrt(n),s=-.3*Math.sin(i*Math.PI),o=.4*Math.sin(i*2*Math.PI),v=-.4*Math.sin(n*Math.PI);return t.multiply(Ye.makeTranslation(r*(s+.64),o-.6+e*-.6,v-.72)),t.multiply(Ye.makeRotationY(r*45*Math.PI/180)),t.multiply(Ye.makeRotationY(r*Math.sin(i*Math.PI)*70*Math.PI/180)),t.multiply(Ye.makeRotationZ(r*Math.sin(n*n*Math.PI)*-20*Math.PI/180)),t.multiply(Ye.makeTranslation(r*-1,3.6,3.5)),t.multiply(Ye.makeRotationZ(r*120*Math.PI/180)),t.multiply(Ye.makeRotationX(200*Math.PI/180)),t.multiply(Ye.makeRotationY(r*-135*Math.PI/180)),t.multiply(Ye.makeTranslation(r*5.6,0,0)),t.multiply(Ye.makeTranslation(r*-5/16,2/16,0)),t}function T7(n,e){let t=new Ce.Matrix4,r=1,i=Math.sqrt(n),s=-.4*Math.sin(i*Math.PI),o=.2*Math.sin(i*2*Math.PI),v=-.2*Math.sin(n*Math.PI);t.multiply(Ye.makeTranslation(r*s,o,v)),t.multiply(Ye.makeTranslation(r*.56,-.52+e*-.6,-.72));let a=Math.sin(n*n*Math.PI),l=Math.sin(i*Math.PI);return t.multiply(Ye.makeRotationY(r*(45+a*-20)*Math.PI/180)),t.multiply(Ye.makeRotationZ(r*l*-20*Math.PI/180)),t.multiply(Ye.makeRotationX(l*-80*Math.PI/180)),t.multiply(Ye.makeRotationY(r*-45*Math.PI/180)),t}var C5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new Ce.Mesh);d(this,"armTransformGroup",new Ce.Group);d(this,"camera",new Ce.PerspectiveCamera(70,1,.05,100));d(this,"equipProgress",0);d(this,"stopUpdate",!1);d(this,"lastHeldItem");d(this,"lastHeldItemRenderKey");d(this,"currentDisplayType","hand");d(this,"isSwinging",!1);d(this,"nextIterStopCallbacks");d(this,"idleAnimator");d(this,"ready",!1);d(this,"lastUpdate",0);d(this,"xBob",0);d(this,"yBob",0);d(this,"lastBobUpdateTime",0);d(this,"lastBobWalkDist",0);d(this,"lastBobTickTime",0);d(this,"playerHand");d(this,"offHandDisplay",!1);d(this,"offHandModeLegacy",!1);d(this,"swingAnimator");d(this,"config");d(this,"disposed",!1);d(this,"unsubs",[]);d(this,"lastItemModelName");d(this,"switchRequest",0);this.initCameraGroup(),this.swingAnimator=new fi,this.unsubs.push(this.worldRenderer.onReactivePlayerStateUpdated("heldItemMain",()=>{this.offHand||this.updateItem()},!1),this.worldRenderer.onReactivePlayerStateUpdated("heldItemOff",()=>{this.offHand&&this.updateItem()},!1)),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||T5().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=A1(async()=>T5(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",i=>{i&&(this.playerHand=i,this.updateItem())},i=>{ke(i,!0)});this.unsubs.push(r)})}dispose(){this.disposed=!0,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,ke(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&ke(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(ke(this.playerHand,!0),this.playerHand=void 0),this.ready=!1}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new Ce.Mesh,this.armTransformGroup=new Ce.Group,this.armTransformGroup.matrixAutoUpdate=!1,this.cameraGroup.add(this.armTransformGroup)}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,r,i){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 Ce.Scene;o.add(this.cameraGroup);let v=t.getSize(new Ce.Vector2),a=v.height>v.width;a?this.camera.aspect!==1&&(this.camera.aspect=1,this.camera.updateProjectionMatrix()):this.camera.aspect!==e.aspect&&(this.camera.aspect=e.aspect,this.camera.updateProjectionMatrix()),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let{offHandDisplay:l}=this;if(l&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),a){let c=Math.min(v.width,v.height);l?t.setViewport(0,0,c,c):t.setViewport(v.width-c,0,c,c)}t.render(o,this.camera),a&&t.setViewport(0,0,v.width,v.height),l&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new dt(()=>({progress:this.equipProgress}),(i,s)=>{i==="progress"&&(this.equipProgress=s)},{progress:4})});let t=e==="disappeared"?1:0,r=!1;return new Promise(i=>{this.blockSwapAnimation.switcher.transitionTo({progress:t},e,()=>{r||i(!0)},()=>{r=!0,i(!1)})})}isDifferentItem(e){return this.lastHeldItemRenderKey!==Ft(this.worldRenderer,e)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this,t=performance.now(),r=this.worldRenderer.cameraShake.getBaseRotation(),i=r.pitch,s=r.yaw;if(this.lastBobUpdateTime===0)this.xBob=i,this.yBob=s;else{let f=Math.min((t-this.lastBobUpdateTime)/1e3,.1),p=1-Math.pow(.5,f*28),g=1-Math.pow(.5,f*36);this.xBob+=(i-this.xBob)*p,this.yBob+=Us(s-this.yBob)*g}this.lastBobUpdateTime=t;let o=(i-this.xBob)*-.05,v=Us(s-this.yBob)*-.035;if(this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let f=this.worldRenderer.playerStateReactive;f.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=t,this.lastBobWalkDist=f.walkDist);let p=Math.min((t-this.lastBobTickTime)/50,1),g=1.8,y=E1({walkDist:f.walkDist*g,prevWalkDist:f.prevWalkDist*g,bob:f.bob,prevBob:f.prevBob,partialTick:p});this.cameraGroup.position.x+=y.position.x,this.cameraGroup.position.y+=y.position.y,this.cameraGroup.rotation.z+=y.rotation.z,this.cameraGroup.rotation.x+=y.rotation.x}this.cameraGroup.rotation.x+=o,this.cameraGroup.rotation.y+=v;let l=this.currentDisplayType,c=this.swingAnimator?.getSwingProgress()??0,u;l==="hand"?u=k7(c,this.equipProgress):u=T7(c,this.equipProgress),this.armTransformGroup.matrix.copy(u),this.armTransformGroup.matrixWorldNeedsUpdate=!0}async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let r=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},x1(this.worldRenderer),!1,this.lastItemModelName);if(r){let{mesh:i,isBlock:s,modelName:o}=r;s?(t=i,e.type="block"):(t=i,e.type="item"),this.lastItemModelName=o}}else t=this.playerHand;if(t){if(e.type==="item"||e.type==="block"){let r=new Ce.Group;r.name="displayTransform",e.type==="item"?(r.position.set(1.13/16,3.2/16,1.13/16),r.rotation.set(0,Ce.MathUtils.degToRad(-90),Ce.MathUtils.degToRad(25),"XYZ"),r.scale.set(.68,.68,.68)):(r.rotation.set(0,Ce.MathUtils.degToRad(45),0,"XYZ"),r.scale.set(.4,.4,.4)),r.add(t),t=r}return t.name="holdingBlock",{model:t,type:e.type}}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.currentDisplayType="hand";let r=this.swingAnimator;r?.stopSwing(),r&&(r.type="hand"),this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.currentDisplayType=t.type,this.armTransformGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(e){let t=Ft(this.worldRenderer,e),r=this.lastHeldItemRenderKey!==t;if(this.lastHeldItem=e,!r)return;this.lastHeldItemRenderKey=t,this.lastItemModelName=void 0;let i=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock.removeFromParent(),this.holdingBlock!==this.playerHand&&ke(this.holdingBlock,!1),this.holdingBlock=void 0}if(!e){this.currentDisplayType="hand";let a=this.swingAnimator;a?.stopSwing(),a&&(a.type="hand"),this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(i!==this.switchRequest)return;let o=await this.createItemModel(e);if(!o||i!==this.switchRequest)return;this.holdingBlock=o.model,this.currentDisplayType=o.type,this.armTransformGroup.add(this.holdingBlock),s&&await this.playBlockSwapAnimation("appeared");let v=this.swingAnimator;v&&(v.type=o.type),this.idleAnimator=void 0}};var fi=class{constructor(){d(this,"animationTimer",0);d(this,"lastTime",0);d(this,"isAnimating",!1);d(this,"stopRequested",!1);d(this,"swingProgress",0);d(this,"type","hand");d(this,"debugParams",{animationTime:250,animationStage:0});d(this,"debugGui");this.debugGui=new T0("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 e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let r=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(r>=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=r}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}},Gs=(n,e,t,r,i)=>{let s=r.transformModel(e,{name:t,properties:{}});return ni(n,[[s]],void 0,"plains",i)};E();x();k();R();import*as ue from"three";import{subscribeKey as O3}from"valtio/utils";E();x();k();R();import*as Le from"three";E();x();k();R();import Li from"prismarine-nbt";import*as N from"three";E();x();k();R();E();x();k();R();import{BoxGeometry as Qe,DoubleSide as yi,FrontSide as Ws,Group as l0,Mesh as We,MeshStandardMaterial as B5,Vector2 as R1}from"three";function _i(n,e,t,r,i,s,o,v){let a=(B,H,G,O)=>[new R1(B/o,1-O/v),new R1(G/o,1-O/v),new R1(G/o,1-H/v),new R1(B/o,1-H/v)],l=a(e+s,t,e+r+s,t+s),c=a(e+r+s,t,e+r*2+s,t+s),u=a(e,t+s,e+s,t+s+i),f=a(e+s,t+s,e+r+s,t+s+i),p=a(e+r+s,t+s,e+r+s*2,t+i+s),g=a(e+r+s*2,t+s,e+r*2+s*2,t+i+s),y=n.attributes.uv,A=[p[3],p[2],p[0],p[1]],b=[u[3],u[2],u[0],u[1]],_=[l[3],l[2],l[0],l[1]],S=[c[0],c[1],c[3],c[2]],C=[f[3],f[2],f[0],f[1]],M=[g[3],g[2],g[0],g[1]],P=[];for(let B of[A,b,_,S,C,M])for(let H of B)P.push(H.x,H.y);y.set(new Float32Array(P)),y.needsUpdate=!0}function v0(n,e,t,r,i,s){_i(n,e,t,r,i,s,64,64)}function hi(n,e,t,r,i,s){_i(n,e,t,r,i,s,64,32)}var M0=class extends l0{constructor(e,t){super(),Object.defineProperty(this,"innerLayer",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"outerLayer",{enumerable:!0,configurable:!0,writable:!0,value:t}),e.name="inner",t.name="outer"}},mi=class extends l0{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 B5({side:Ws}),this.layer2Material=new B5({side:yi,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 e=new Qe(8,8,8);v0(e,0,0,8,8,8);let t=new We(e,this.layer1Material),r=new Qe(9,9,9);v0(r,32,0,8,8,8);let i=new We(r,this.layer2Material);this.head=new M0(t,i),this.head.name="head",this.head.add(t,i),t.position.y=4,i.position.y=4,this.add(this.head);let s=new Qe(8,12,4);v0(s,16,16,8,12,4);let o=new We(s,this.layer1Material),v=new Qe(8.5,12.5,4.5);v0(v,16,32,8,12,4);let a=new We(v,this.layer2Material);this.body=new M0(o,a),this.body.name="body",this.body.add(o,a),this.body.position.y=-6,this.add(this.body);let l=new Qe,c=new We(l,this.layer1MaterialBiased);this.modelListeners.push(()=>{c.scale.x=this.slim?3:4,c.scale.y=12,c.scale.z=4,v0(l,40,16,this.slim?3:4,12,4)});let u=new Qe,f=new We(u,this.layer2MaterialBiased);this.modelListeners.push(()=>{f.scale.x=this.slim?3.5:4.5,f.scale.y=12.5,f.scale.z=4.5,v0(u,40,32,this.slim?3:4,12,4)});let p=new l0;p.add(c,f),this.modelListeners.push(()=>{p.position.x=this.slim?-.5:-1}),p.position.y=-4,this.rightArm=new M0(c,f),this.rightArm.name="rightArm",this.rightArm.add(p),this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.add(this.rightArm);let g=new Qe,y=new We(g,this.layer1MaterialBiased);this.modelListeners.push(()=>{y.scale.x=this.slim?3:4,y.scale.y=12,y.scale.z=4,v0(g,32,48,this.slim?3:4,12,4)});let A=new Qe,b=new We(A,this.layer2MaterialBiased);this.modelListeners.push(()=>{b.scale.x=this.slim?3.5:4.5,b.scale.y=12.5,b.scale.z=4.5,v0(A,48,48,this.slim?3:4,12,4)});let _=new l0;_.add(y,b),this.modelListeners.push(()=>{_.position.x=this.slim?.5:1}),_.position.y=-4,this.leftArm=new M0(y,b),this.leftArm.name="leftArm",this.leftArm.add(_),this.leftArm.position.x=5,this.leftArm.position.y=-2,this.add(this.leftArm);let S=new Qe(4,12,4);v0(S,0,16,4,12,4);let C=new We(S,this.layer1MaterialBiased),M=new Qe(4.5,12.5,4.5);v0(M,0,32,4,12,4);let P=new We(M,this.layer2MaterialBiased),B=new l0;B.add(C,P),B.position.y=-6,this.rightLeg=new M0(C,P),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 H=new Qe(4,12,4);v0(H,16,48,4,12,4);let G=new We(H,this.layer1MaterialBiased),O=new Qe(4.5,12.5,4.5);v0(O,0,48,4,12,4);let j=new We(O,this.layer2MaterialBiased),J=new l0;J.add(G,j),J.position.y=-6,this.leftLeg=new M0(G,j),this.leftLeg.name="leftLeg",this.leftLeg.add(J),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(e){this._map=e,this.layer1Material.map=e,this.layer1Material.needsUpdate=!0,this.layer1MaterialBiased.map=e,this.layer1MaterialBiased.needsUpdate=!0,this.layer2Material.map=e,this.layer2Material.needsUpdate=!0,this.layer2MaterialBiased.map=e,this.layer2MaterialBiased.needsUpdate=!0}get modelType(){return this.slim?"slim":"default"}set modelType(e){this.slim=e==="slim",this.modelListeners.forEach(t=>t())}getBodyParts(){return this.children.filter(e=>e instanceof M0)}setInnerLayerVisible(e){this.getBodyParts().forEach(t=>t.innerLayer.visible=e)}setOuterLayerVisible(e){this.getBodyParts().forEach(t=>t.outerLayer.visible=e)}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}},pi=class extends l0{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 B5({side:yi,transparent:!0,alphaTest:1e-5});let e=new Qe(10,16,1);hi(e,0,0,10,16,1),this.cape=new We(e,this.material),this.cape.position.y=-8,this.cape.position.z=.5,this.add(this.cape)}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},gi=class extends l0{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 B5({side:yi,transparent:!0,alphaTest:1e-5});let e=new Qe(12,22,4);hi(e,22,0,10,20,2);let t=new We(e,this.material);t.position.x=-5,t.position.y=-10,t.position.z=-1,this.leftWing=new l0,this.leftWing.add(t),this.add(this.leftWing);let r=new Qe(12,22,4);hi(r,22,0,10,20,2);let i=new We(r,this.material);i.scale.x=-1,i.position.x=5,i.position.y=-10,i.position.z=-1,this.rightWing=new l0,this.rightWing.add(i),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(e){this.material.map=e,this.material.needsUpdate=!0}},bi=class extends l0{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 B5({side:Ws});let e=new Qe(8,8,4/3);_i(e,0,0,6,6,1,14,7),this.rightEar=new We(e,this.material),this.rightEar.name="rightEar",this.rightEar.position.x=-6,this.add(this.rightEar),this.leftEar=new We(e,this.material),this.leftEar.name="leftEar",this.leftEar.position.x=6,this.add(this.leftEar)}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},Vs=10.8*Math.PI/180,zt=class extends l0{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 mi,this.skin.name="skin",this.skin.position.y=8,this.add(this.skin),this.cape=new pi,this.cape.name="cape",this.cape.position.y=8,this.cape.position.z=-2,this.cape.rotation.x=Vs,this.cape.rotation.y=Math.PI,this.add(this.cape),this.elytra=new gi,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 bi,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(e){this.cape.visible=e==="cape",this.elytra.visible=e==="elytra"}resetJoints(){this.skin.resetJoints(),this.cape.rotation.x=Vs,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()}};E();x();k();R();import{Color as cg,PointLight as dg,EquirectangularReflectionMapping as ug,Group as fg,NearestFilter as hg,PerspectiveCamera as mg,Scene as pg,Texture as gg,Vector2 as bg,WebGLRenderer as yg,AmbientLight as _g,CanvasTexture as wg,WebGLRenderTarget as Ag,FloatType as Eg,DepthTexture as xg,Clock as Rg,Object3D as kg,ColorManagement as Tg}from"three";import{OrbitControls as Sg}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as Bg}from"three/examples/jsm/postprocessing/EffectComposer.js";import"three/examples/jsm/postprocessing/Pass.js";import{RenderPass as Og}from"three/examples/jsm/postprocessing/RenderPass.js";import{ShaderPass as Fg}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as Lg}from"three/examples/jsm/shaders/FXAAShader.js";E();x();k();R();var k1=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(e,t){if(this.paused)return;let r=t*this.speed;this.animate(e,r),this.animationObjects.forEach((i,s)=>{let o=this.progress0.get(s);i(e,this.progress-o,s)}),this.progress+=r}addAnimation(e){let t=this.currentId++;return this.progress0.set(t,this.progress),this.animationObjects.set(t,e),t}removeAnimation(e){e!=null&&(this.animationObjects.delete(e),this.progress0.delete(e))}};E();x();k();R();import{CanvasTexture as Jp,NearestFilter as Zp,Sprite as qp,SpriteMaterial as Xp}from"three";E();x();k();R();var M7=Object.defineProperty,S7=(n,e,t)=>e in n?M7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,_e=(n,e,t)=>(S7(n,typeof e!="symbol"?e+"":e,t),t);function wi(n){let e=[n];if(n.extra&&n.extra.length!==0)for(let t of n.extra)e.push(...wi(t));return e}var q=class{constructor(n,e,t,r,i,s){this.key=n,this.value=e,this.name=t,this.code=r,this.cssForeground=i,this.cssBackground=s}applyToStyle(n){n[this.key]=this.value}matchStyle(n){return n[this.key]===this.value}static fromCode(n){let t="0123456789abcdefklmnor".indexOf(n);if(t)return this.list[t]}toString(){return`${q.CONTROL_STRING}${this.code}`}},we=q;_e(we,"CONTROL_STRING","\xA7");_e(we,"BLACK",new q("color","black","BLACK","0",{color:"#000000"},{color:"#000000"}));_e(we,"DARK_BLUE",new q("color","dark_blue","DARK_BLUE","1",{color:"#0000AA"},{color:"#00002A"}));_e(we,"DARK_GREEN",new q("color","dark_green","DARK_GREEN","2",{color:"#00AA00"},{color:"#002A00"}));_e(we,"DARK_AQUA",new q("color","dark_aqua","DARK_AQUA","3",{color:"#00AAAA"},{color:"#002A2A"}));_e(we,"DARK_RED",new q("color","dark_red","DARK_RED","4",{color:"#AA0000"},{color:"#2A0000"}));_e(we,"DARK_PURPLE",new q("color","dark_purple","DARK_PURPLE","5",{color:"#AA00AA"},{color:"#2A002A"}));_e(we,"GOLD",new q("color","gold","GOLD","6",{color:"#FFAA00"},{color:"#2A2A00"}));_e(we,"GRAY",new q("color","gray","GRAY","7",{color:"#AAAAAA"},{color:"#2A2A2A"}));_e(we,"DARK_GRAY",new q("color","dark_gray","DARK_GRAY","8",{color:"#555555"},{color:"#151515"}));_e(we,"BLUE",new q("color","blue","BLUE","9",{color:"#5555FF"},{color:"#15153F"}));_e(we,"GREEN",new q("color","green","GREEN","a",{color:"#55FF55"},{color:"#153F15"}));_e(we,"AQUA",new q("color","aqua","AQUA","b",{color:"#55FFFF"},{color:"#153F3F"}));_e(we,"RED",new q("color","red","RED","c",{color:"#FF5555"},{color:"#3F1515"}));_e(we,"LIGHT_PURPLE",new q("color","light_purple","LIGHT_PURPLE","d",{color:"#FF55FF"},{color:"#3F153F"}));_e(we,"YELLOW",new q("color","yellow","YELLOW","e",{color:"#FFFF55"},{color:"#3F3F15"}));_e(we,"WHITE",new q("color","white","WHITE","f",{color:"#FFFFFF"},{color:"#3F3F3F"}));_e(we,"OBFUSCATED",new q("obfuscated",!0,"OBFUSCATED","k",{}));_e(we,"BOLD",new q("bold",!0,"BOLD","l",{"font-weight":"bold"}));_e(we,"STRIKETHROUGH",new q("strikethrough",!0,"STRIKETHROUGH","m",{"text-decoration":"line-through"}));_e(we,"UNDERLINE",new q("underlined",!0,"UNDERLINE","n",{"text-decoration":"underline"}));_e(we,"ITALIC",new q("italic",!0,"ITALIC","o",{"font-style":"italic"}));_e(we,"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`${q.CONTROL_STRING}r`}});_e(we,"list",[q.BLACK,q.DARK_BLUE,q.DARK_GREEN,q.DARK_AQUA,q.DARK_RED,q.DARK_PURPLE,q.GOLD,q.GRAY,q.DARK_GRAY,q.BLUE,q.GREEN,q.AQUA,q.RED,q.LIGHT_PURPLE,q.YELLOW,q.WHITE,q.OBFUSCATED,q.BOLD,q.STRIKETHROUGH,q.UNDERLINE,q.ITALIC,q.RESET]);var L5=l5(Ai(),1);ki();var C3=l5(mo(),1);import B3 from"prismarine-chat";E();x();k();R();import*as Ti from"three";E();x();k();R();var Nt=n=>Math.max(0,Math.min(1,n)),po=(n,e,t)=>Math.max(e,Math.min(t,n)),r0=(n,e,t)=>n+(e-n)*t,h8=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function m8(n){let e=n?.elytra;if(!e)return;if(typeof e.updateRightWing=="function"){e.updateRightWing();return}if(typeof e.updateRightWingRotation=="function"){e.updateRightWingRotation();return}let t=e.leftWing,r=e.rightWing;!t?.rotation||!r?.rotation||typeof r.rotation.copy=="function"&&(r.rotation.copy(t.rotation),r.rotation.z*=-1)}var D5=class extends k1{constructor(){super(...arguments);d(this,"switchAnimationCallback");d(this,"isRunning",!1);d(this,"isMoving",!0);d(this,"isCrouched",!1);d(this,"moveAmount",0);d(this,"runAmount",0);d(this,"lookYaw",0);d(this,"lookPitch",0);d(this,"_dt",0);d(this,"_phase",0);d(this,"_idlePhase",0);d(this,"_moveBlend",0);d(this,"_runBlend",0);d(this,"_crouchBlend",0);d(this,"_lookYawBlend",0);d(this,"_lookPitchBlend",0);d(this,"_swingTime",null);d(this,"_swingDuration",.25);d(this,"_defaults",null)}update(t,r){this._dt=r,super.update(t,r)}swingArm(){(this._swingTime===null||this._swingTime>=this._swingDuration/2)&&(this._swingTime=0)}resetLocomotion(){this._moveBlend=0,this._runBlend=0,this._crouchBlend=0,this._phase=0}_captureDefaults(t){let r=t?.skin;this._defaults={playerRot:t?.rotation?.clone?.(),bodyPos:r?.body?.position?.clone?.(),bodyRot:r?.body?.rotation?.clone?.(),leftArmPos:r?.leftArm?.position?.clone?.(),leftArmRot:r?.leftArm?.rotation?.clone?.(),rightArmPos:r?.rightArm?.position?.clone?.(),rightArmRot:r?.rightArm?.rotation?.clone?.(),leftLegPos:r?.leftLeg?.position?.clone?.(),leftLegRot:r?.leftLeg?.rotation?.clone?.(),rightLegPos:r?.rightLeg?.position?.clone?.(),rightLegRot:r?.rightLeg?.rotation?.clone?.(),headPos:r?.head?.position?.clone?.(),headRot:r?.head?.rotation?.clone?.(),capePos:t?.cape?.position?.clone?.(),capeRot:t?.cape?.rotation?.clone?.(),elytraPos:t?.elytra?.position?.clone?.(),elytraRot:t?.elytra?.rotation?.clone?.()}}_applyDefaults(t){let r=this._defaults;if(!r)return;let i=t?.skin,s=t?.cape,o=t?.elytra;r.playerRot&&t?.rotation&&t.rotation.copy(r.playerRot),r.bodyPos&&i?.body?.position&&i.body.position.copy(r.bodyPos),r.bodyRot&&i?.body?.rotation&&i.body.rotation.copy(r.bodyRot),r.leftArmPos&&i?.leftArm?.position&&i.leftArm.position.copy(r.leftArmPos),r.leftArmRot&&i?.leftArm?.rotation&&i.leftArm.rotation.copy(r.leftArmRot),r.rightArmPos&&i?.rightArm?.position&&i.rightArm.position.copy(r.rightArmPos),r.rightArmRot&&i?.rightArm?.rotation&&i.rightArm.rotation.copy(r.rightArmRot),r.leftLegPos&&i?.leftLeg?.position&&i.leftLeg.position.copy(r.leftLegPos),r.leftLegRot&&i?.leftLeg?.rotation&&i.leftLeg.rotation.copy(r.leftLegRot),r.rightLegPos&&i?.rightLeg?.position&&i.rightLeg.position.copy(r.rightLegPos),r.rightLegRot&&i?.rightLeg?.rotation&&i.rightLeg.rotation.copy(r.rightLegRot),r.headPos&&i?.head?.position&&i.head.position.copy(r.headPos),r.headRot&&i?.head?.rotation&&i.head.rotation.copy(r.headRot),r.capePos&&s?.position&&s.position.copy(r.capePos),r.capeRot&&s?.rotation&&s.rotation.copy(r.capeRot),r.elytraPos&&o?.position&&o.position.copy(r.elytraPos),r.elytraRot&&o?.rotation&&o.rotation.copy(r.elytraRot)}animate(t){let r=this._dt||0;this._defaults||this._captureDefaults(t),this._applyDefaults(t);let i=typeof this.moveAmount=="number"?this.moveAmount:this.isMoving?1:0,s=typeof this.runAmount=="number"?this.runAmount:this.isRunning?1:0,o=Nt(i),v=Nt(s),a=this.isCrouched?1:0,l=Math.min(1,r*8),c=Math.min(1,r*6),u=Math.min(1,r*7);this._moveBlend+=(o-this._moveBlend)*l,this._runBlend+=(v-this._runBlend)*c,this._crouchBlend+=(a-this._crouchBlend)*u;let f=Nt(this._moveBlend),p=Nt(this._runBlend),g=Nt(this._crouchBlend),y=r0(8,10,p),A=r0(1,.55,g),b=y*A;this._phase+=r*b*f,this._idlePhase+=r*1.15;let _=this._phase+(p>.5?Math.PI*.5:0);if(this.switchAnimationCallback&&Math.abs(Math.sin(_))<.02){let O=this.switchAnimationCallback;this.switchAnimationCallback=null,O?.()}g8(t,g);let S=80*Math.PI/180,C=75*Math.PI/180,M=po(h8(this.lookYaw||0),-S,S),P=po(this.lookPitch||0,-C,C),B=Math.min(1,r*14);this._lookYawBlend+=(M-this._lookYawBlend)*B,this._lookPitchBlend+=(P-this._lookPitchBlend)*B,t?.skin?.head?.rotation&&(t.skin.head.rotation.y+=this._lookYawBlend,t.skin.head.rotation.x+=this._lookPitchBlend);let H=(1-f)*(1-.25*p);if(H>1e-4&&t?.skin){let G=Math.sin(this._idlePhase);t.skin.body.rotation.x+=G*.02*H,t.skin.head.rotation.x+=-G*.015*H,t.skin.leftArm.rotation.x+=G*.03*H,t.skin.rightArm.rotation.x+=-G*.03*H,t?.cape?.rotation&&(t.cape.rotation.x+=Math.sin(this._idlePhase*.7)*.03*H)}if(f>1e-4&&t?.skin){let G=r0(1,.85,g),O=r0(1,.7,g),j=Math.sin(_)*.5,J=Math.sin(_+Math.PI)*.5,Z=Math.cos(_+Math.PI)*1.3,X=Math.cos(_)*1.3;t.skin.leftLeg.rotation.x+=r0(j,Z,p)*f*G,t.skin.rightLeg.rotation.x+=r0(J,X,p)*f*G;let de=Math.sin(_+Math.PI)*.5,ae=Math.sin(_)*.5,ve=Math.cos(_)*1.5,ge=Math.cos(_+Math.PI)*1.5;t.skin.leftArm.rotation.x+=r0(de,ve,p)*f*O,t.skin.rightArm.rotation.x+=r0(ae,ge,p)*f*O;let Ee=Math.PI*.02,ne=Math.PI*.1,Y=r0(Ee,ne,p),oe=Math.cos(_)*.03+Ee,be=Math.cos(_+Math.PI)*.03-Ee,Ge=Math.cos(_)*.1+ne,Oe=Math.cos(_+Math.PI)*.1-ne;t.skin.leftArm.rotation.z+=(r0(oe,Ge,p)*f+Y*.15*f)*O,t.skin.rightArm.rotation.z+=(r0(be,Oe,p)*f-Y*.15*f)*O,this._defaults?.playerRot&&(t.rotation.z=this._defaults.playerRot.z+Math.cos(_+Math.PI)*.01*p*f);let Xe=r0(Math.PI*.06,Math.PI*.3,p),he=r0(Math.sin(_/1.5)*.06,Math.sin(_*2)*.1,p);t?.cape?.rotation&&(t.cape.rotation.x+=(Xe+he)*f)}if(this._swingTime!==null){this._swingTime+=r;let G=Math.min(this._swingTime/this._swingDuration,1);p8.animate(G,t,f>.2),G>=1&&(this._swingTime=null)}}},p8={animate(n,e,t){if(!e?.skin?.rightArm?.rotation)return;let r=Math.sin(n*Math.PI);if(e.skin.rightArm.rotation.x=-.4537860552*2-2*r*.3,!t){let i=.01*Math.PI+.06;e.skin.rightArm.rotation.z=-r*.403+i,e.skin.body.rotation.y=-r*.06,e.skin.leftArm.rotation.x=-r*.077,e.skin.leftArm.rotation.z=-r*.015+.13-.05,e.skin.leftArm.position.z=r*.3,e.skin.leftArm.position.x=5-r*.05}}};function g8(n,e){let t=n?.skin,r=n?.cape,i=n?.elytra;if(!t||!r)return;let s=Nt(e),o=Math.abs(Math.sin(s*Math.PI/2));if(o<=1e-6)return;t.body.rotation.x+=.4537860552*o,t.body.position.z+=(1.3256181-3.4500310377)*o,t.body.position.y+=-2.103677462*o,r.position.y+=-1.851236166577372*o,r.rotation.x+=.294220265771*o,r.position.z+=(3.786619432-3.4500310377)*o,i?.position&&i.position.copy(r.position),i?.rotation&&i.rotation.copy(r.rotation),i?.rotation&&(i.rotation.x-=10.8*Math.PI/180),i?.leftWing?.rotation&&(i.leftWing.rotation.z=r0(.72,.26179944+.4582006,o)),m8(n),t.head.position.y+=-3.618325234674*o;let v=.1*o,a=(3.618325234674-3.4500310377)*o,l=-2.53943318*o;t.leftArm.position.z+=a,t.rightArm.position.z+=a,t.leftArm.rotation.x+=.410367746202*o,t.rightArm.rotation.x+=.410367746202*o,t.leftArm.rotation.z+=v,t.rightArm.rotation.z+=-v,t.leftArm.position.y+=l,t.rightArm.position.y+=l,t.rightLeg.position.z+=-3.4500310377*o,t.leftLeg.position.z+=-3.4500310377*o}function Mi(n){let e=n.skin,t=[e.layer1Material,e.layer1MaterialBiased,e.layer2Material,e.layer2MaterialBiased];for(let r of t)r.transparent=!0,r.alphaTest=.1,r.depthWrite=!0}E();x();k();R();import*as se from"three";function b8(n,e){if(typeof document<"u"){let t=document.createElement("canvas");return t.width=n,t.height=e,t}return new OffscreenCanvas(n,e)}function y8(n,e){let{depth:t,pixelSize:r}=e;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,v=n.width,a=n.height,l=t/2,c=r??1/Math.max(v,a),u=(B,H)=>{if(B<0||H<0||B>=v||H>=a)return!1;let G=(H*v+B)*4;return o[G+3]>128},f=[],p=[],g=[],y=[],A=0,b=(B,H,G,O,j,J,Z,X)=>(f.push(B,H,G),g.push(O,j),y.push(J,Z,X),A++),_=(B,H,G,O)=>{p.push(B,H,G,B,G,O)},S=(B,H)=>{let G=(B/v-.5)*c*v,O=-(H/a-.5)*c*a;return{x:G,y:O}},C=Array.from({length:a+1},()=>Array.from({length:v+1},()=>null)),M=Array.from({length:a+1},()=>Array.from({length:v+1},()=>null));for(let B=0;B<=a;B++)for(let H=0;H<=v;H++){let{x:G,y:O}=S(H-.5,B-.5),j=H/v,J=B/a,Z=!1,X=[[H-1,B-1],[H,B-1],[H-1,B],[H,B]];for(let[de,ae]of X)if(u(de,ae)){Z=!0;break}Z&&(C[B][H]=b(G,O,l,j,J,0,0,1),M[B][H]=b(G,O,-l,j,J,0,0,-1))}for(let B=0;B<a;B++)for(let H=0;H<v;H++){if(!u(H,B))continue;let G=C[B][H],O=C[B][H+1],j=C[B+1][H+1],J=C[B+1][H],Z=M[B][H],X=M[B][H+1],de=M[B+1][H+1],ae=M[B+1][H];G!==null&&O!==null&&j!==null&&J!==null&&_(G,O,j,J),Z!==null&&X!==null&&de!==null&&ae!==null&&_(X,Z,ae,de)}for(let B=0;B<a;B++)for(let H=0;H<v;H++){if(!u(H,B))continue;let G=(H+.5)/v,O=(B+.5)/a;if(!u(H-1,B)){let j=C[B][H],J=C[B+1][H],Z=M[B][H],X=M[B+1][H];if(j!==null&&J!==null&&Z!==null&&X!==null){let de=b(f[j*3],f[j*3+1],f[j*3+2],G,O,-1,0,0),ae=b(f[J*3],f[J*3+1],f[J*3+2],G,O,-1,0,0),ve=b(f[X*3],f[X*3+1],f[X*3+2],G,O,-1,0,0),ge=b(f[Z*3],f[Z*3+1],f[Z*3+2],G,O,-1,0,0);_(de,ae,ve,ge)}}if(!u(H+1,B)){let j=C[B+1][H+1],J=C[B][H+1],Z=M[B+1][H+1],X=M[B][H+1];if(j!==null&&J!==null&&Z!==null&&X!==null){let de=b(f[j*3],f[j*3+1],f[j*3+2],G,O,1,0,0),ae=b(f[J*3],f[J*3+1],f[J*3+2],G,O,1,0,0),ve=b(f[X*3],f[X*3+1],f[X*3+2],G,O,1,0,0),ge=b(f[Z*3],f[Z*3+1],f[Z*3+2],G,O,1,0,0);_(de,ae,ve,ge)}}if(!u(H,B-1)){let j=C[B][H],J=C[B][H+1],Z=M[B][H],X=M[B][H+1];if(j!==null&&J!==null&&Z!==null&&X!==null){let de=b(f[j*3],f[j*3+1],f[j*3+2],G,O,0,-1,0),ae=b(f[J*3],f[J*3+1],f[J*3+2],G,O,0,-1,0),ve=b(f[X*3],f[X*3+1],f[X*3+2],G,O,0,-1,0),ge=b(f[Z*3],f[Z*3+1],f[Z*3+2],G,O,0,-1,0);_(de,ae,ve,ge)}}if(!u(H,B+1)){let j=C[B+1][H+1],J=C[B+1][H],Z=M[B+1][H+1],X=M[B+1][H];if(j!==null&&J!==null&&Z!==null&&X!==null){let de=b(f[j*3],f[j*3+1],f[j*3+2],G,O,0,1,0),ae=b(f[J*3],f[J*3+1],f[J*3+2],G,O,0,1,0),ve=b(f[X*3],f[X*3+1],f[X*3+2],G,O,0,1,0),ge=b(f[Z*3],f[Z*3+1],f[Z*3+2],G,O,0,1,0);_(de,ae,ve,ge)}}}let P=new se.BufferGeometry;return P.setAttribute("position",new se.Float32BufferAttribute(f,3)),P.setAttribute("uv",new se.Float32BufferAttribute(g,2)),P.setAttribute("normal",new se.Float32BufferAttribute(y,3)),P.setIndex(p),P.computeVertexNormals(),{geometry:P,totalVertices:A,totalTriangles:p.length/3}}function _8(n,e){let{u:t,v:r,sizeX:i,sizeY:s}=e,o=Math.max(1,Math.floor(i*n.image.width)),v=Math.max(1,Math.floor(s*n.image.height)),a=b8(o,v),l=a.getContext("2d");if(!l)throw new Error("Failed to get 2d context for item texture canvas");return l.imageSmoothingEnabled=!1,l.drawImage(n.image,t*n.image.width,r*n.image.height,i*n.image.width,s*n.image.height,0,0,a.width,a.height),a}function go(n,e,t={}){let{faceCamera:r=!1,use3D:i=!0,depth:s=.04}=t,{u:o,v,sizeX:a,sizeY:l}=e;if(r){let y=n.clone();y.flipY=!0,y.offset.set(o,1-v-l),y.repeat.set(a,l),y.needsUpdate=!0,y.magFilter=se.NearestFilter,y.minFilter=se.NearestFilter;let A=new se.SpriteMaterial({map:y,transparent:!0,alphaTest:.1});return{mesh:new se.Sprite(A),itemsTexture:y,cleanup(){y.dispose()}}}if(i)try{let y=_8(n,e),{geometry:A}=y8(y,{depth:s}),b=new se.CanvasTexture(y);b.magFilter=se.NearestFilter,b.minFilter=se.NearestFilter,b.wrapS=b.wrapT=se.ClampToEdgeWrapping,b.flipY=!1,b.needsUpdate=!0;let _=new se.MeshStandardMaterial({map:b,side:se.DoubleSide,transparent:!0,alphaTest:.1});return{mesh:new se.Mesh(A,_),itemsTexture:b,cleanup(){b.dispose(),A.dispose(),_.map&&_.map.dispose(),_.dispose()}}}catch{}let c=n.clone();c.flipY=!0,c.offset.set(o,1-v-l),c.repeat.set(a,l),c.needsUpdate=!0,c.magFilter=se.NearestFilter,c.minFilter=se.NearestFilter;let u=c.clone();u.repeat.x*=-1,u.needsUpdate=!0,u.offset.set(o+a,1-v-l);let f=new se.MeshStandardMaterial({map:c,transparent:!0,alphaTest:.1}),p=new se.MeshStandardMaterial({map:u,transparent:!0,alphaTest:.1});return{mesh:new se.Mesh(new se.BoxGeometry(1,1,0),[new se.MeshBasicMaterial({color:0}),new se.MeshBasicMaterial({color:0}),new se.MeshBasicMaterial({color:0}),new se.MeshBasicMaterial({color:0}),f,p]),itemsTexture:c,itemsTextureFlipped:u,cleanup(){c.dispose(),u.dispose(),f.dispose(),p.dispose()}}}E();x();k();R();import*as te from"three";E();x();k();R();E();x();k();R();import{REVISION as w8}from"three";var bo=parseInt(w8.replace(/\D+/g,""));E();x();k();R();import{Loader as A8,FileLoader as E8,Group as x8,BufferGeometry as yo,Float32BufferAttribute as jt,LineBasicMaterial as Si,Material as _o,PointsMaterial as I1,MeshPhongMaterial as R8,LineSegments as wo,Points as Ci,Mesh as Ao,Vector3 as F5}from"three";var k8=/^[og]\s*(.+)?/,T8=/^mtllib /,M8=/^usemtl /,S8=/^usemap /,Eo=new F5,Bi=new F5,xo=new F5,Ro=new F5,c0=new F5;function C8(){let n={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}let r=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:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,s){let o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);let v={index:this.materials.length,name:i||"",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(a){let l={index:typeof a=="number"?a: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(v),v},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){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),i&&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 i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},r&&r.name&&typeof r.clone=="function"){let i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/3)*3},parseNormalIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/3)*3},parseUVIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/2)*2},addVertex:function(e,t,r){let i=this.vertices,s=this.object.geometry.vertices;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){let i=this.normals,s=this.object.geometry.normals;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,t,r){let i=this.vertices,s=this.object.geometry.normals;Eo.fromArray(i,e),Bi.fromArray(i,t),xo.fromArray(i,r),c0.subVectors(xo,Bi),Ro.subVectors(Eo,Bi),c0.cross(Ro),c0.normalize(),s.push(c0.x,c0.y,c0.z),s.push(c0.x,c0.y,c0.z),s.push(c0.x,c0.y,c0.z)},addColor:function(e,t,r){let i=this.colors,s=this.object.geometry.colors;i[e]!==void 0&&s.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&s.push(i[t+0],i[t+1],i[t+2]),i[r]!==void 0&&s.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,t,r){let i=this.uvs,s=this.object.geometry.uvs;s.push(i[e+0],i[e+1]),s.push(i[t+0],i[t+1]),s.push(i[r+0],i[r+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,i,s,o,v,a,l){let c=this.vertices.length,u=this.parseVertexIndex(e,c),f=this.parseVertexIndex(t,c),p=this.parseVertexIndex(r,c);if(this.addVertex(u,f,p),this.addColor(u,f,p),v!==void 0&&v!==""){let g=this.normals.length;u=this.parseNormalIndex(v,g),f=this.parseNormalIndex(a,g),p=this.parseNormalIndex(l,g),this.addNormal(u,f,p)}else this.addFaceNormal(u,f,p);if(i!==void 0&&i!==""){let g=this.uvs.length;u=this.parseUVIndex(i,g),f=this.parseUVIndex(s,g),p=this.parseUVIndex(o,g),this.addUV(u,f,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let r=0,i=e.length;r<i;r++){let s=this.parseVertexIndex(e[r],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";let r=this.vertices.length,i=this.uvs.length;for(let s=0,o=e.length;s<o;s++)this.addVertexLine(this.parseVertexIndex(e[s],r));for(let s=0,o=t.length;s<o;s++)this.addUVLine(this.parseUVIndex(t[s],i))}};return n.startObject("",!1),n}var Yt=class extends A8{constructor(e){super(e),this.materials=null}load(e,t,r,i){let s=this,o=new E8(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(v){try{t(s.parse(v))}catch(a){i&&i(a),s.manager.itemError(e)}},r,i)}setMaterials(e){return this.materials=e,this}parse(e){let t=new C8;e.indexOf(`\r
|
|
719
|
+
}`;function p7(n){let e=document.createElement("style");e.innerHTML=n;let t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}var Is=!1,vi=class n{constructor({parent:e,autoPlace:t=e===void 0,container:r,width:i,title:s="Controls",closeFolders:o=!1,injectStyles:a=!0,touchStyles:v=!0}={}){if(this.parent=e,this.root=e?e.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"),!Is&&a&&(p7(m7),Is=!0),r?r.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),i&&this.domElement.style.setProperty("--width",i+"px"),this._closeFolders=o}add(e,t,r,i,s){if(Object(r)===r)return new oi(this,e,t,r);switch(typeof e[t]){case"number":return new si(this,e,t,r,i,s);case"boolean":return new ri(this,e,t);case"string":return new ai(this,e,t);case"function":return new R5(this,e,t)}}addColor(e,t,r=1){return new ni(this,e,t,r)}addFolder(e){let t=new n({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(r=>{r instanceof R5||r._name in e.controllers&&r.load(e.controllers[r._name])}),t&&e.folders&&this.folders.forEach(r=>{r._title in e.folders&&r.load(e.folders[r._title])}),this}save(e=!0){let t={controllers:{},folders:{}};return this.controllers.forEach(r=>{if(!(r instanceof R5)){if(r._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${r._name}"`);t.controllers[r._name]=r.save()}}),e&&this.folders.forEach(r=>{if(r._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${r._title}"`);t.folders[r._title]=r.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");let r=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",r))};this.$children.addEventListener("transitionend",r);let i=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=i+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(r=>r.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}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(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}},li=vi;var k0=class{constructor(e,t,r,i){d(this,"gui",null);d(this,"storageKey","");d(this,"target");d(this,"params",[]);d(this,"paramsMeta",{});d(this,"_visible",!1);d(this,"initialValues",{});d(this,"initialized",!1);if(!ae){this.gui=new li,this.storageKey=`debug_params_${e}`,this.target=t,this.paramsMeta=i??{},this.params=r??Object.keys(t);for(let s of this.params)this.initialValues[s]=t[s];this.gui.domElement.style.display="none"}}activate(){return ae?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return ae?!1:this._visible}set visible(e){ae||!this.gui||(this._visible=e,this.gui.domElement.style.display=e?"block":"none",this.saveVisibility())}loadSavedValues(){if(!ae)try{let e=localStorage.getItem(this.storageKey);if(e){let t=JSON.parse(e);for(let r of this.params)if(r in t){let i=t[r];i!==null&&(this.target[r]=i)}}}catch{}}saveValues(e=!1){if(!ae)try{let t={};for(let r of this.params)t[r]=this.target[r];e?localStorage.removeItem(this.storageKey):localStorage.setItem(this.storageKey,JSON.stringify(t))}catch{}}saveVisibility(){if(!ae)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch{}}setupControls(){if(!(ae||!this.gui)){this.gui.add(this,"visible").name("Show Controls"),this.gui.add({resetAll:()=>{if(this.gui){for(let e of this.params)this.target[e]=this.initialValues[e];this.saveValues(!0),this.gui.destroy(),this.gui=new li,this.setupControls()}}},"resetAll").name("Reset All Parameters");for(let e of this.params){let t=this.target[e],r=this.paramsMeta[e]??{};if(typeof t=="number"){let i=r.min??t-Math.abs(t*2),s=r.max??t+Math.abs(t*2),o=r.step??Math.abs(t)/100;this.gui.add(this.target,e,i,s,o).onChange(()=>this.saveValues())}else if(typeof t=="boolean")this.gui.add(this.target,e).onChange(()=>this.saveValues());else if(typeof t=="string"&&["x","y","z"].includes(e)){let i=r.min??-10,s=r.max??10,o=r.step??.1;this.gui.add(this.target,e,i,s,o).onChange(()=>this.saveValues())}else Array.isArray(t)&&this.gui.add(this.target,e,t).onChange(()=>this.saveValues())}}}save(){ae||(this.saveValues(),this.saveVisibility())}destroy(){ae||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};E();x();k();R();E();x();k();R();var b1=class{constructor(){d(this,"currentAnimation",null);d(this,"isAnimating",!1);d(this,"cancelRequested",!1);d(this,"completionCallbacks",[]);d(this,"currentCancelCallback",null)}async startAnimation(e,t){return this.isAnimating&&await this.cancelCurrentAnimation(),new Promise(r=>{this.isAnimating=!0,this.cancelRequested=!1,this.currentCancelCallback=t??null,this.currentAnimation=e(),this.completionCallbacks.push(()=>{this.isAnimating=!1,this.currentAnimation=null,r()})})}async cancelCurrentAnimation(){if(this.isAnimating){if(this.currentCancelCallback){let e=this.currentCancelCallback;this.currentCancelCallback=null,e()}return new Promise(e=>{this.cancelRequested=!0,this.completionCallbacks.push(()=>{e()})})}}animationCycleFinish(){this.cancelRequested&&this.forceFinish()}forceFinish(e=!0){if(!this.isAnimating)return;if(this.currentAnimation){for(let r of this.currentAnimation.getAll())r.stop();this.currentAnimation.removeAll(),this.currentAnimation=null}this.isAnimating=!1,this.cancelRequested=!1;let t=[...this.completionCallbacks];if(this.completionCallbacks=[],e)for(let r of t)r()}update(){this.currentAnimation&&this.currentAnimation.update()}get isActive(){return this.isAnimating}get shouldCancel(){return this.cancelRequested}};var g7={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},ct=class{constructor(e,t,r){this.getState=e;this.setState=t;d(this,"animationController",new b1);d(this,"defaultState");d(this,"speeds");d(this,"currentStateName","");d(this,"transitioningToStateName","");this.speeds={...g7},r&&Object.assign(this.speeds,r),this.defaultState=this.getState()}calculateDuration(e){let t=0,r=this.getState();for(let[i,s]of Object.entries(e)){let o=r[i],a=Math.abs(s-o),v=this.getPropertySpeed(i),l=a/v*1e3;t=Math.max(t,l)}return Math.min(Math.max(t,200),2e3)}getPropertySpeed(e){return e in this.speeds?this.speeds[e]:e.toLowerCase().includes("rotation")?this.speeds.rotation:e.toLowerCase().includes("scale")?this.speeds.scale:e.toLowerCase()==="x"||e.toLowerCase()==="y"||e.toLowerCase()==="z"?this.speeds[e]:this.speeds.default}startTransition(e,t,r,i=He.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=t??"";let o=this.getState(),a=this.calculateDuration(e);this.animationController.startAnimation(()=>{let v=new Ct;return new Oe(o,v).to(e,a).easing(i).onUpdate(l=>{for(let c of Object.keys(l))this.setState(c,l[c])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",r?.()}).start(),v},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(e,t,r,i){this.startTransition(e,t,r,He.Linear.None,i)}getCurrentValue(e){return this.getState()[e]}get isTransitioning(){return this.animationController.isActive}};E();x();k();R();import{subscribeKey as b7}from"valtio/utils";function y1(n,e,t,r,i){let s=0,o,a=async()=>{let v=++s,l=await n(e[t]);v===s?(o&&i?.(o),r(l),o=l):i?.(l)};return a(),b7(e,t,a)}E();x();k();R();var Hs=Math.PI/180;function _1(n){let{walkDist:e,prevWalkDist:t,bob:r,prevBob:i,partialTick:s}=n,o=e-t,a=-(e+o*s),v=i+(r-i)*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*Hs,z:l*v*3*Hs}}}E();x();k();R();var w1=n=>({"minecraft:display_context":"firstperson","minecraft:use_duration":n.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!n.playerStateReactive.itemUsageTicks}),y7=()=>({"minecraft:display_context":"firstperson"}),Dt=(n,e)=>{if(!e)return"empty";if(e.type==="hand")return"hand";let t=e.name??(e.id!==void 0?`#${e.id}`:"unknown");if(!n.resourcesManager.currentResources)return`${e.type}:${t}`;let r=n.getItemRenderData({...e.fullItem,itemId:e.id},y7());return`${e.type}:${t}:${r.modelName}`};var je=new Se.Matrix4,Os=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function _7(n,e){let t=new Se.Matrix4,r=1,i=Math.sqrt(n),s=-.3*Math.sin(i*Math.PI),o=.4*Math.sin(i*2*Math.PI),a=-.4*Math.sin(n*Math.PI);return t.multiply(je.makeTranslation(r*(s+.64),o-.6+e*-.6,a-.72)),t.multiply(je.makeRotationY(r*45*Math.PI/180)),t.multiply(je.makeRotationY(r*Math.sin(i*Math.PI)*70*Math.PI/180)),t.multiply(je.makeRotationZ(r*Math.sin(n*n*Math.PI)*-20*Math.PI/180)),t.multiply(je.makeTranslation(r*-1,3.6,3.5)),t.multiply(je.makeRotationZ(r*120*Math.PI/180)),t.multiply(je.makeRotationX(200*Math.PI/180)),t.multiply(je.makeRotationY(r*-135*Math.PI/180)),t.multiply(je.makeTranslation(r*5.6,0,0)),t.multiply(je.makeTranslation(r*-5/16,2/16,0)),t}function w7(n,e){let t=new Se.Matrix4,r=1,i=Math.sqrt(n),s=-.4*Math.sin(i*Math.PI),o=.2*Math.sin(i*2*Math.PI),a=-.2*Math.sin(n*Math.PI);t.multiply(je.makeTranslation(r*s,o,a)),t.multiply(je.makeTranslation(r*.56,-.52+e*-.6,-.72));let v=Math.sin(n*n*Math.PI),l=Math.sin(i*Math.PI);return t.multiply(je.makeRotationY(r*(45+v*-20)*Math.PI/180)),t.multiply(je.makeRotationZ(r*l*-20*Math.PI/180)),t.multiply(je.makeRotationX(l*-80*Math.PI/180)),t.multiply(je.makeRotationY(r*-45*Math.PI/180)),t}var T5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new Se.Mesh);d(this,"armTransformGroup",new Se.Group);d(this,"camera",new Se.PerspectiveCamera(70,1,.05,100));d(this,"equipProgress",0);d(this,"stopUpdate",!1);d(this,"lastHeldItem");d(this,"lastHeldItemRenderKey");d(this,"currentDisplayType","hand");d(this,"isSwinging",!1);d(this,"nextIterStopCallbacks");d(this,"idleAnimator");d(this,"ready",!1);d(this,"lastUpdate",0);d(this,"xBob",0);d(this,"yBob",0);d(this,"lastBobUpdateTime",0);d(this,"lastBobWalkDist",0);d(this,"lastBobTickTime",0);d(this,"playerHand");d(this,"offHandDisplay",!1);d(this,"offHandModeLegacy",!1);d(this,"swingAnimator");d(this,"config");d(this,"disposed",!1);d(this,"unsubs",[]);d(this,"lastItemModelName");d(this,"switchRequest",0);this.initCameraGroup(),this.swingAnimator=new ci,this.unsubs.push(this.worldRenderer.onReactivePlayerStateUpdated("heldItemMain",()=>{this.offHand||this.updateItem()},!1),this.worldRenderer.onReactivePlayerStateUpdated("heldItemOff",()=>{this.offHand&&this.updateItem()},!1)),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||x5().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=y1(async()=>x5(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",i=>{i&&(this.playerHand=i,this.updateItem())},i=>{Re(i,!0)});this.unsubs.push(r)})}dispose(){this.disposed=!0,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,Re(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&Re(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(Re(this.playerHand,!0),this.playerHand=void 0),this.ready=!1}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new Se.Mesh,this.armTransformGroup=new Se.Group,this.armTransformGroup.matrixAutoUpdate=!1,this.cameraGroup.add(this.armTransformGroup)}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,r,i){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 Se.Scene;o.add(this.cameraGroup);let a=t.getSize(new Se.Vector2),v=a.height>a.width;v?this.camera.aspect!==1&&(this.camera.aspect=1,this.camera.updateProjectionMatrix()):this.camera.aspect!==e.aspect&&(this.camera.aspect=e.aspect,this.camera.updateProjectionMatrix()),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let{offHandDisplay:l}=this;if(l&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),v){let c=Math.min(a.width,a.height);l?t.setViewport(0,0,c,c):t.setViewport(a.width-c,0,c,c)}t.render(o,this.camera),v&&t.setViewport(0,0,a.width,a.height),l&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new ct(()=>({progress:this.equipProgress}),(i,s)=>{i==="progress"&&(this.equipProgress=s)},{progress:4})});let t=e==="disappeared"?1:0,r=!1;return new Promise(i=>{this.blockSwapAnimation.switcher.transitionTo({progress:t},e,()=>{r||i(!0)},()=>{r=!0,i(!1)})})}isDifferentItem(e){return this.lastHeldItemRenderKey!==Dt(this.worldRenderer,e)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this,t=performance.now(),r=this.worldRenderer.cameraShake.getBaseRotation(),i=r.pitch,s=r.yaw;if(this.lastBobUpdateTime===0)this.xBob=i,this.yBob=s;else{let h=Math.min((t-this.lastBobUpdateTime)/1e3,.1),p=1-Math.pow(.5,h*28),g=1-Math.pow(.5,h*36);this.xBob+=(i-this.xBob)*p,this.yBob+=Os(s-this.yBob)*g}this.lastBobUpdateTime=t;let o=(i-this.xBob)*-.05,a=Os(s-this.yBob)*-.035;if(this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let h=this.worldRenderer.playerStateReactive;h.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=t,this.lastBobWalkDist=h.walkDist);let p=Math.min((t-this.lastBobTickTime)/50,1),g=1.8,y=_1({walkDist:h.walkDist*g,prevWalkDist:h.prevWalkDist*g,bob:h.bob,prevBob:h.prevBob,partialTick:p});this.cameraGroup.position.x+=y.position.x,this.cameraGroup.position.y+=y.position.y,this.cameraGroup.rotation.z+=y.rotation.z,this.cameraGroup.rotation.x+=y.rotation.x}this.cameraGroup.rotation.x+=o,this.cameraGroup.rotation.y+=a;let l=this.currentDisplayType,c=this.swingAnimator?.getSwingProgress()??0,u;l==="hand"?u=_7(c,this.equipProgress):u=w7(c,this.equipProgress),this.armTransformGroup.matrix.copy(u),this.armTransformGroup.matrixWorldNeedsUpdate=!0}async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let r=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},w1(this.worldRenderer),!1,this.lastItemModelName);if(r){let{mesh:i,isBlock:s,modelName:o}=r;s?(t=i,e.type="block"):(t=i,e.type="item"),this.lastItemModelName=o}}else t=this.playerHand;if(t){if(e.type==="item"||e.type==="block"){let r=new Se.Group;r.name="displayTransform",e.type==="item"?(r.position.set(1.13/16,3.2/16,1.13/16),r.rotation.set(0,Se.MathUtils.degToRad(-90),Se.MathUtils.degToRad(25),"XYZ"),r.scale.set(.68,.68,.68)):(r.rotation.set(0,Se.MathUtils.degToRad(45),0,"XYZ"),r.scale.set(.4,.4,.4)),r.add(t),t=r}return t.name="holdingBlock",{model:t,type:e.type}}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.currentDisplayType="hand";let r=this.swingAnimator;r?.stopSwing(),r&&(r.type="hand"),this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.currentDisplayType=t.type,this.armTransformGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(e){let t=Dt(this.worldRenderer,e),r=this.lastHeldItemRenderKey!==t;if(this.lastHeldItem=e,!r)return;this.lastHeldItemRenderKey=t,this.lastItemModelName=void 0;let i=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock.removeFromParent(),this.holdingBlock!==this.playerHand&&Re(this.holdingBlock,!1),this.holdingBlock=void 0}if(!e){this.currentDisplayType="hand";let v=this.swingAnimator;v?.stopSwing(),v&&(v.type="hand"),this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(i!==this.switchRequest)return;let o=await this.createItemModel(e);if(!o||i!==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 ci=class{constructor(){d(this,"animationTimer",0);d(this,"lastTime",0);d(this,"isAnimating",!1);d(this,"stopRequested",!1);d(this,"swingProgress",0);d(this,"type","hand");d(this,"debugParams",{animationTime:250,animationStage:0});d(this,"debugGui");this.debugGui=new k0("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 e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let r=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(r>=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=r}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}},Ds=(n,e,t,r,i)=>{let s=r.transformModel(e,{name:t,properties:{}});return ti(n,[[s]],void 0,"plains",i)};E();x();k();R();import*as de from"three";import{subscribeKey as S3}from"valtio/utils";E();x();k();R();import*as ze from"three";E();x();k();R();import Hi from"prismarine-nbt";import*as W from"three";E();x();k();R();E();x();k();R();import{BoxGeometry as Ye,DoubleSide as pi,FrontSide as zs,Group as v0,Mesh as Ge,MeshStandardMaterial as M5,Vector2 as A1}from"three";function gi(n,e,t,r,i,s,o,a){let v=(B,H,G,O)=>[new A1(B/o,1-O/a),new A1(G/o,1-O/a),new A1(G/o,1-H/a),new A1(B/o,1-H/a)],l=v(e+s,t,e+r+s,t+s),c=v(e+r+s,t,e+r*2+s,t+s),u=v(e,t+s,e+s,t+s+i),h=v(e+s,t+s,e+r+s,t+s+i),p=v(e+r+s,t+s,e+r+s*2,t+i+s),g=v(e+r+s*2,t+s,e+r*2+s*2,t+i+s),y=n.attributes.uv,A=[p[3],p[2],p[0],p[1]],b=[u[3],u[2],u[0],u[1]],w=[l[3],l[2],l[0],l[1]],S=[c[0],c[1],c[3],c[2]],C=[h[3],h[2],h[0],h[1]],M=[g[3],g[2],g[0],g[1]],I=[];for(let B of[A,b,w,S,C,M])for(let H of B)I.push(H.x,H.y);y.set(new Float32Array(I)),y.needsUpdate=!0}function a0(n,e,t,r,i,s){gi(n,e,t,r,i,s,64,64)}function di(n,e,t,r,i,s){gi(n,e,t,r,i,s,64,32)}var T0=class extends v0{constructor(e,t){super(),Object.defineProperty(this,"innerLayer",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"outerLayer",{enumerable:!0,configurable:!0,writable:!0,value:t}),e.name="inner",t.name="outer"}},ui=class extends v0{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 M5({side:zs}),this.layer2Material=new M5({side:pi,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 e=new Ye(8,8,8);a0(e,0,0,8,8,8);let t=new Ge(e,this.layer1Material),r=new Ye(9,9,9);a0(r,32,0,8,8,8);let i=new Ge(r,this.layer2Material);this.head=new T0(t,i),this.head.name="head",this.head.add(t,i),t.position.y=4,i.position.y=4,this.add(this.head);let s=new Ye(8,12,4);a0(s,16,16,8,12,4);let o=new Ge(s,this.layer1Material),a=new Ye(8.5,12.5,4.5);a0(a,16,32,8,12,4);let v=new Ge(a,this.layer2Material);this.body=new T0(o,v),this.body.name="body",this.body.add(o,v),this.body.position.y=-6,this.add(this.body);let l=new Ye,c=new Ge(l,this.layer1MaterialBiased);this.modelListeners.push(()=>{c.scale.x=this.slim?3:4,c.scale.y=12,c.scale.z=4,a0(l,40,16,this.slim?3:4,12,4)});let u=new Ye,h=new Ge(u,this.layer2MaterialBiased);this.modelListeners.push(()=>{h.scale.x=this.slim?3.5:4.5,h.scale.y=12.5,h.scale.z=4.5,a0(u,40,32,this.slim?3:4,12,4)});let p=new v0;p.add(c,h),this.modelListeners.push(()=>{p.position.x=this.slim?-.5:-1}),p.position.y=-4,this.rightArm=new T0(c,h),this.rightArm.name="rightArm",this.rightArm.add(p),this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.add(this.rightArm);let g=new Ye,y=new Ge(g,this.layer1MaterialBiased);this.modelListeners.push(()=>{y.scale.x=this.slim?3:4,y.scale.y=12,y.scale.z=4,a0(g,32,48,this.slim?3:4,12,4)});let A=new Ye,b=new Ge(A,this.layer2MaterialBiased);this.modelListeners.push(()=>{b.scale.x=this.slim?3.5:4.5,b.scale.y=12.5,b.scale.z=4.5,a0(A,48,48,this.slim?3:4,12,4)});let w=new v0;w.add(y,b),this.modelListeners.push(()=>{w.position.x=this.slim?.5:1}),w.position.y=-4,this.leftArm=new T0(y,b),this.leftArm.name="leftArm",this.leftArm.add(w),this.leftArm.position.x=5,this.leftArm.position.y=-2,this.add(this.leftArm);let S=new Ye(4,12,4);a0(S,0,16,4,12,4);let C=new Ge(S,this.layer1MaterialBiased),M=new Ye(4.5,12.5,4.5);a0(M,0,32,4,12,4);let I=new Ge(M,this.layer2MaterialBiased),B=new v0;B.add(C,I),B.position.y=-6,this.rightLeg=new T0(C,I),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 H=new Ye(4,12,4);a0(H,16,48,4,12,4);let G=new Ge(H,this.layer1MaterialBiased),O=new Ye(4.5,12.5,4.5);a0(O,0,48,4,12,4);let j=new Ge(O,this.layer2MaterialBiased),J=new v0;J.add(G,j),J.position.y=-6,this.leftLeg=new T0(G,j),this.leftLeg.name="leftLeg",this.leftLeg.add(J),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(e){this._map=e,this.layer1Material.map=e,this.layer1Material.needsUpdate=!0,this.layer1MaterialBiased.map=e,this.layer1MaterialBiased.needsUpdate=!0,this.layer2Material.map=e,this.layer2Material.needsUpdate=!0,this.layer2MaterialBiased.map=e,this.layer2MaterialBiased.needsUpdate=!0}get modelType(){return this.slim?"slim":"default"}set modelType(e){this.slim=e==="slim",this.modelListeners.forEach(t=>t())}getBodyParts(){return this.children.filter(e=>e instanceof T0)}setInnerLayerVisible(e){this.getBodyParts().forEach(t=>t.innerLayer.visible=e)}setOuterLayerVisible(e){this.getBodyParts().forEach(t=>t.outerLayer.visible=e)}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}},fi=class extends v0{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 M5({side:pi,transparent:!0,alphaTest:1e-5});let e=new Ye(10,16,1);di(e,0,0,10,16,1),this.cape=new Ge(e,this.material),this.cape.position.y=-8,this.cape.position.z=.5,this.add(this.cape)}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},hi=class extends v0{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 M5({side:pi,transparent:!0,alphaTest:1e-5});let e=new Ye(12,22,4);di(e,22,0,10,20,2);let t=new Ge(e,this.material);t.position.x=-5,t.position.y=-10,t.position.z=-1,this.leftWing=new v0,this.leftWing.add(t),this.add(this.leftWing);let r=new Ye(12,22,4);di(r,22,0,10,20,2);let i=new Ge(r,this.material);i.scale.x=-1,i.position.x=5,i.position.y=-10,i.position.z=-1,this.rightWing=new v0,this.rightWing.add(i),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(e){this.material.map=e,this.material.needsUpdate=!0}},mi=class extends v0{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 M5({side:zs});let e=new Ye(8,8,4/3);gi(e,0,0,6,6,1,14,7),this.rightEar=new Ge(e,this.material),this.rightEar.name="rightEar",this.rightEar.position.x=-6,this.add(this.rightEar),this.leftEar=new Ge(e,this.material),this.leftEar.name="leftEar",this.leftEar.position.x=6,this.add(this.leftEar)}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},Fs=10.8*Math.PI/180,Ft=class extends v0{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 fi,this.cape.name="cape",this.cape.position.y=8,this.cape.position.z=-2,this.cape.rotation.x=Fs,this.cape.rotation.y=Math.PI,this.add(this.cape),this.elytra=new hi,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 mi,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(e){this.cape.visible=e==="cape",this.elytra.visible=e==="elytra"}resetJoints(){this.skin.resetJoints(),this.cape.rotation.x=Fs,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()}};E();x();k();R();import{Color as sg,PointLight as og,EquirectangularReflectionMapping as ag,Group as vg,NearestFilter as lg,PerspectiveCamera as cg,Scene as dg,Texture as ug,Vector2 as fg,WebGLRenderer as hg,AmbientLight as mg,CanvasTexture as pg,WebGLRenderTarget as gg,FloatType as bg,DepthTexture as yg,Clock as _g,Object3D as wg,ColorManagement as Ag}from"three";import{OrbitControls as xg}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as kg}from"three/examples/jsm/postprocessing/EffectComposer.js";import"three/examples/jsm/postprocessing/Pass.js";import{RenderPass as Cg}from"three/examples/jsm/postprocessing/RenderPass.js";import{ShaderPass as Pg}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as Hg}from"three/examples/jsm/shaders/FXAAShader.js";E();x();k();R();var E1=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(e,t){if(this.paused)return;let r=t*this.speed;this.animate(e,r),this.animationObjects.forEach((i,s)=>{let o=this.progress0.get(s);i(e,this.progress-o,s)}),this.progress+=r}addAnimation(e){let t=this.currentId++;return this.progress0.set(t,this.progress),this.animationObjects.set(t,e),t}removeAnimation(e){e!=null&&(this.animationObjects.delete(e),this.progress0.delete(e))}};E();x();k();R();import{CanvasTexture as Wp,NearestFilter as jp,Sprite as Yp,SpriteMaterial as Qp}from"three";E();x();k();R();var A7=Object.defineProperty,E7=(n,e,t)=>e in n?A7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ge=(n,e,t)=>(E7(n,typeof e!="symbol"?e+"":e,t),t);function bi(n){let e=[n];if(n.extra&&n.extra.length!==0)for(let t of n.extra)e.push(...bi(t));return e}var Z=class{constructor(n,e,t,r,i,s){this.key=n,this.value=e,this.name=t,this.code=r,this.cssForeground=i,this.cssBackground=s}applyToStyle(n){n[this.key]=this.value}matchStyle(n){return n[this.key]===this.value}static fromCode(n){let t="0123456789abcdefklmnor".indexOf(n);if(t)return this.list[t]}toString(){return`${Z.CONTROL_STRING}${this.code}`}},be=Z;ge(be,"CONTROL_STRING","\xA7");ge(be,"BLACK",new Z("color","black","BLACK","0",{color:"#000000"},{color:"#000000"}));ge(be,"DARK_BLUE",new Z("color","dark_blue","DARK_BLUE","1",{color:"#0000AA"},{color:"#00002A"}));ge(be,"DARK_GREEN",new Z("color","dark_green","DARK_GREEN","2",{color:"#00AA00"},{color:"#002A00"}));ge(be,"DARK_AQUA",new Z("color","dark_aqua","DARK_AQUA","3",{color:"#00AAAA"},{color:"#002A2A"}));ge(be,"DARK_RED",new Z("color","dark_red","DARK_RED","4",{color:"#AA0000"},{color:"#2A0000"}));ge(be,"DARK_PURPLE",new Z("color","dark_purple","DARK_PURPLE","5",{color:"#AA00AA"},{color:"#2A002A"}));ge(be,"GOLD",new Z("color","gold","GOLD","6",{color:"#FFAA00"},{color:"#2A2A00"}));ge(be,"GRAY",new Z("color","gray","GRAY","7",{color:"#AAAAAA"},{color:"#2A2A2A"}));ge(be,"DARK_GRAY",new Z("color","dark_gray","DARK_GRAY","8",{color:"#555555"},{color:"#151515"}));ge(be,"BLUE",new Z("color","blue","BLUE","9",{color:"#5555FF"},{color:"#15153F"}));ge(be,"GREEN",new Z("color","green","GREEN","a",{color:"#55FF55"},{color:"#153F15"}));ge(be,"AQUA",new Z("color","aqua","AQUA","b",{color:"#55FFFF"},{color:"#153F3F"}));ge(be,"RED",new Z("color","red","RED","c",{color:"#FF5555"},{color:"#3F1515"}));ge(be,"LIGHT_PURPLE",new Z("color","light_purple","LIGHT_PURPLE","d",{color:"#FF55FF"},{color:"#3F153F"}));ge(be,"YELLOW",new Z("color","yellow","YELLOW","e",{color:"#FFFF55"},{color:"#3F3F15"}));ge(be,"WHITE",new Z("color","white","WHITE","f",{color:"#FFFFFF"},{color:"#3F3F3F"}));ge(be,"OBFUSCATED",new Z("obfuscated",!0,"OBFUSCATED","k",{}));ge(be,"BOLD",new Z("bold",!0,"BOLD","l",{"font-weight":"bold"}));ge(be,"STRIKETHROUGH",new Z("strikethrough",!0,"STRIKETHROUGH","m",{"text-decoration":"line-through"}));ge(be,"UNDERLINE",new Z("underlined",!0,"UNDERLINE","n",{"text-decoration":"underline"}));ge(be,"ITALIC",new Z("italic",!0,"ITALIC","o",{"font-style":"italic"}));ge(be,"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`}});ge(be,"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 D5=o5(yi(),1);Ei();var x3=o5(lo(),1);import R3 from"prismarine-chat";E();x();k();R();import*as xi from"three";E();x();k();R();var v8=n=>Math.max(0,Math.min(1,n)),l8=(n,e,t)=>n+(e-n)*t;function c8(n){let e=n?.elytra;if(!e)return;if(typeof e.updateRightWing=="function"){e.updateRightWing();return}if(typeof e.updateRightWingRotation=="function"){e.updateRightWingRotation();return}let t=e.leftWing,r=e.rightWing;!t?.rotation||!r?.rotation||typeof r.rotation.copy=="function"&&(r.rotation.copy(t.rotation),r.rotation.z*=-1)}var I5=class extends E1{constructor(){super(...arguments);d(this,"switchAnimationCallback");d(this,"isRunning",!1);d(this,"isMoving",!0);d(this,"isCrouched",!1);d(this,"_dt",0);d(this,"_phase",0);d(this,"_moveBlend",0);d(this,"_swingTime",null);d(this,"_swingDuration",.25);d(this,"_defaults",null)}update(t,r){this._dt=r,super.update(t,r)}swingArm(){(this._swingTime===null||this._swingTime>=this._swingDuration/2)&&(this._swingTime=0)}_captureDefaults(t){this._defaults={bodyPos:t.skin.body.position.clone(),bodyRot:t.skin.body.rotation.clone(),leftArmPos:t.skin.leftArm.position.clone(),leftArmRot:t.skin.leftArm.rotation.clone(),rightArmPos:t.skin.rightArm.position.clone(),rightArmRot:t.skin.rightArm.rotation.clone(),leftLegPos:t.skin.leftLeg.position.clone(),leftLegRot:t.skin.leftLeg.rotation.clone(),rightLegPos:t.skin.rightLeg.position.clone(),rightLegRot:t.skin.rightLeg.rotation.clone(),headPos:t.skin.head.position.clone(),headRot:t.skin.head.rotation.clone(),capePos:t.cape.position.clone(),capeRot:t.cape.rotation.clone(),elytraPos:t.elytra.position.clone(),elytraRot:t.elytra.rotation.clone()}}_applyDefaults(t){let r=this._defaults;r&&(t.skin.body.position.copy(r.bodyPos),t.skin.body.rotation.copy(r.bodyRot),t.skin.leftArm.position.copy(r.leftArmPos),t.skin.leftArm.rotation.copy(r.leftArmRot),t.skin.rightArm.position.copy(r.rightArmPos),t.skin.rightArm.rotation.copy(r.rightArmRot),t.skin.leftLeg.position.copy(r.leftLegPos),t.skin.leftLeg.rotation.copy(r.leftLegRot),t.skin.rightLeg.position.copy(r.rightLegPos),t.skin.rightLeg.rotation.copy(r.rightLegRot),t.skin.head.position.copy(r.headPos),t.skin.head.rotation.copy(r.headRot),t.cape.position.copy(r.capePos),t.cape.rotation.copy(r.capeRot),t.elytra.position.copy(r.elytraPos),t.elytra.rotation.copy(r.elytraRot))}animate(t){let r=this._dt||0;this._defaults||this._captureDefaults(t),this._applyDefaults(t);let i=this.isMoving?1:0,s=Math.min(1,r*20);this._moveBlend+=(i-this._moveBlend)*s;let o=this.isRunning?10:8;this._phase+=r*o*this._moveBlend;let a=this._phase+(this.isRunning?Math.PI*.5:0),v=!1;u8(t,this.isCrouched?1:0);let l=this.isRunning?Math.cos(a):Math.sin(a);if(Math.abs(l)<.02&&this.switchAnimationCallback&&(v=!0),this.isRunning?(t.skin.leftLeg.rotation.x=Math.cos(a+Math.PI)*1.3,t.skin.rightLeg.rotation.x=Math.cos(a)*1.3):(t.skin.leftLeg.rotation.x=Math.sin(a)*.5,t.skin.rightLeg.rotation.x=Math.sin(a+Math.PI)*.5),this.isRunning){t.skin.leftArm.rotation.x=Math.cos(a)*1.5,t.skin.rightArm.rotation.x=Math.cos(a+Math.PI)*1.5;let c=Math.PI*.1;t.skin.leftArm.rotation.z=Math.cos(a)*.1+c,t.skin.rightArm.rotation.z=Math.cos(a+Math.PI)*.1-c}else{t.skin.leftArm.rotation.x=Math.sin(a+Math.PI)*.5,t.skin.rightArm.rotation.x=Math.sin(a)*.5;let c=Math.PI*.02;t.skin.leftArm.rotation.z=Math.cos(a)*.03+c,t.skin.rightArm.rotation.z=Math.cos(a+Math.PI)*.03-c}if(this._swingTime!==null){this._swingTime+=r;let c=Math.min(this._swingTime/this._swingDuration,1);d8.animate(c,t,this.isMoving),c>=1&&(this._swingTime=null)}if(this.isRunning&&(t.rotation.z=Math.cos(a+Math.PI)*.01),this.isRunning){let c=Math.PI*.3;t.cape.rotation.x=Math.sin(a*2)*.1+c}else{let c=Math.PI*.06;t.cape.rotation.x=Math.sin(a/1.5)*.06+c}if(v){let c=this.switchAnimationCallback;this.switchAnimationCallback=null,c?.()}}},d8={animate(n,e,t){if(!e?.skin?.rightArm?.rotation)return;let r=Math.sin(n*Math.PI);if(e.skin.rightArm.rotation.x=-.4537860552*2-2*r*.3,!t){let i=.01*Math.PI+.06;e.skin.rightArm.rotation.z=-r*.403+i,e.skin.body.rotation.y=-r*.06,e.skin.leftArm.rotation.x=-r*.077,e.skin.leftArm.rotation.z=-r*.015+.13-.05,e.skin.leftArm.position.z=r*.3,e.skin.leftArm.position.x=5-r*.05}}};function u8(n,e){let t=n?.skin,r=n?.cape,i=n?.elytra;if(!t||!r)return;let s=v8(e),o=Math.abs(Math.sin(s*Math.PI/2));if(o<=1e-6)return;t.body.rotation.x+=.4537860552*o,t.body.position.z+=(1.3256181-3.4500310377)*o,t.body.position.y+=-2.103677462*o,r.position.y+=-1.851236166577372*o,r.rotation.x+=.294220265771*o,r.position.z+=(3.786619432-3.4500310377)*o,i?.position&&i.position.copy(r.position),i?.rotation&&i.rotation.copy(r.rotation),i?.rotation&&(i.rotation.x-=10.8*Math.PI/180),i?.leftWing?.rotation&&(i.leftWing.rotation.z=l8(.72,.26179944+.4582006,o)),c8(n),t.head.position.y+=-3.618325234674*o;let a=.1*o,v=(3.618325234674-3.4500310377)*o,l=-2.53943318*o;t.leftArm.position.z+=v,t.rightArm.position.z+=v,t.leftArm.rotation.x+=.410367746202*o,t.rightArm.rotation.x+=.410367746202*o,t.leftArm.rotation.z+=a,t.rightArm.rotation.z+=-a,t.leftArm.position.y+=l,t.rightArm.position.y+=l,t.rightLeg.position.z+=-3.4500310377*o,t.leftLeg.position.z+=-3.4500310377*o}function Ri(n){let e=n.skin,t=[e.layer1Material,e.layer1MaterialBiased,e.layer2Material,e.layer2MaterialBiased];for(let r of t)r.transparent=!0,r.alphaTest=.1,r.depthWrite=!0}E();x();k();R();import*as ne from"three";function f8(n,e){if(typeof document<"u"){let t=document.createElement("canvas");return t.width=n,t.height=e,t}return new OffscreenCanvas(n,e)}function h8(n,e){let{depth:t,pixelSize:r}=e;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=t/2,c=r??1/Math.max(a,v),u=(B,H)=>{if(B<0||H<0||B>=a||H>=v)return!1;let G=(H*a+B)*4;return o[G+3]>128},h=[],p=[],g=[],y=[],A=0,b=(B,H,G,O,j,J,q,$)=>(h.push(B,H,G),g.push(O,j),y.push(J,q,$),A++),w=(B,H,G,O)=>{p.push(B,H,G,B,G,O)},S=(B,H)=>{let G=(B/a-.5)*c*a,O=-(H/v-.5)*c*v;return{x:G,y:O}},C=Array.from({length:v+1},()=>Array.from({length:a+1},()=>null)),M=Array.from({length:v+1},()=>Array.from({length:a+1},()=>null));for(let B=0;B<=v;B++)for(let H=0;H<=a;H++){let{x:G,y:O}=S(H-.5,B-.5),j=H/a,J=B/v,q=!1,$=[[H-1,B-1],[H,B-1],[H-1,B],[H,B]];for(let[ue,le]of $)if(u(ue,le)){q=!0;break}q&&(C[B][H]=b(G,O,l,j,J,0,0,1),M[B][H]=b(G,O,-l,j,J,0,0,-1))}for(let B=0;B<v;B++)for(let H=0;H<a;H++){if(!u(H,B))continue;let G=C[B][H],O=C[B][H+1],j=C[B+1][H+1],J=C[B+1][H],q=M[B][H],$=M[B][H+1],ue=M[B+1][H+1],le=M[B+1][H];G!==null&&O!==null&&j!==null&&J!==null&&w(G,O,j,J),q!==null&&$!==null&&ue!==null&&le!==null&&w($,q,le,ue)}for(let B=0;B<v;B++)for(let H=0;H<a;H++){if(!u(H,B))continue;let G=(H+.5)/a,O=(B+.5)/v;if(!u(H-1,B)){let j=C[B][H],J=C[B+1][H],q=M[B][H],$=M[B+1][H];if(j!==null&&J!==null&&q!==null&&$!==null){let ue=b(h[j*3],h[j*3+1],h[j*3+2],G,O,-1,0,0),le=b(h[J*3],h[J*3+1],h[J*3+2],G,O,-1,0,0),ce=b(h[$*3],h[$*3+1],h[$*3+2],G,O,-1,0,0),Ee=b(h[q*3],h[q*3+1],h[q*3+2],G,O,-1,0,0);w(ue,le,ce,Ee)}}if(!u(H+1,B)){let j=C[B+1][H+1],J=C[B][H+1],q=M[B+1][H+1],$=M[B][H+1];if(j!==null&&J!==null&&q!==null&&$!==null){let ue=b(h[j*3],h[j*3+1],h[j*3+2],G,O,1,0,0),le=b(h[J*3],h[J*3+1],h[J*3+2],G,O,1,0,0),ce=b(h[$*3],h[$*3+1],h[$*3+2],G,O,1,0,0),Ee=b(h[q*3],h[q*3+1],h[q*3+2],G,O,1,0,0);w(ue,le,ce,Ee)}}if(!u(H,B-1)){let j=C[B][H],J=C[B][H+1],q=M[B][H],$=M[B][H+1];if(j!==null&&J!==null&&q!==null&&$!==null){let ue=b(h[j*3],h[j*3+1],h[j*3+2],G,O,0,-1,0),le=b(h[J*3],h[J*3+1],h[J*3+2],G,O,0,-1,0),ce=b(h[$*3],h[$*3+1],h[$*3+2],G,O,0,-1,0),Ee=b(h[q*3],h[q*3+1],h[q*3+2],G,O,0,-1,0);w(ue,le,ce,Ee)}}if(!u(H,B+1)){let j=C[B+1][H+1],J=C[B+1][H],q=M[B+1][H+1],$=M[B+1][H];if(j!==null&&J!==null&&q!==null&&$!==null){let ue=b(h[j*3],h[j*3+1],h[j*3+2],G,O,0,1,0),le=b(h[J*3],h[J*3+1],h[J*3+2],G,O,0,1,0),ce=b(h[$*3],h[$*3+1],h[$*3+2],G,O,0,1,0),Ee=b(h[q*3],h[q*3+1],h[q*3+2],G,O,0,1,0);w(ue,le,ce,Ee)}}}let I=new ne.BufferGeometry;return I.setAttribute("position",new ne.Float32BufferAttribute(h,3)),I.setAttribute("uv",new ne.Float32BufferAttribute(g,2)),I.setAttribute("normal",new ne.Float32BufferAttribute(y,3)),I.setIndex(p),I.computeVertexNormals(),{geometry:I,totalVertices:A,totalTriangles:p.length/3}}function m8(n,e){let{u:t,v:r,sizeX:i,sizeY:s}=e,o=Math.max(1,Math.floor(i*n.image.width)),a=Math.max(1,Math.floor(s*n.image.height)),v=f8(o,a),l=v.getContext("2d");if(!l)throw new Error("Failed to get 2d context for item texture canvas");return l.imageSmoothingEnabled=!1,l.drawImage(n.image,t*n.image.width,r*n.image.height,i*n.image.width,s*n.image.height,0,0,v.width,v.height),v}function co(n,e,t={}){let{faceCamera:r=!1,use3D:i=!0,depth:s=.04}=t,{u:o,v:a,sizeX:v,sizeY:l}=e;if(r){let y=n.clone();y.flipY=!0,y.offset.set(o,1-a-l),y.repeat.set(v,l),y.needsUpdate=!0,y.magFilter=ne.NearestFilter,y.minFilter=ne.NearestFilter;let A=new ne.SpriteMaterial({map:y,transparent:!0,alphaTest:.1});return{mesh:new ne.Sprite(A),itemsTexture:y,cleanup(){y.dispose()}}}if(i)try{let y=m8(n,e),{geometry:A}=h8(y,{depth:s}),b=new ne.CanvasTexture(y);b.magFilter=ne.NearestFilter,b.minFilter=ne.NearestFilter,b.wrapS=b.wrapT=ne.ClampToEdgeWrapping,b.flipY=!1,b.needsUpdate=!0;let w=new ne.MeshStandardMaterial({map:b,side:ne.DoubleSide,transparent:!0,alphaTest:.1});return{mesh:new ne.Mesh(A,w),itemsTexture:b,cleanup(){b.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=ne.NearestFilter,c.minFilter=ne.NearestFilter;let u=c.clone();u.repeat.x*=-1,u.needsUpdate=!0,u.offset.set(o+v,1-a-l);let h=new ne.MeshStandardMaterial({map:c,transparent:!0,alphaTest:.1}),p=new ne.MeshStandardMaterial({map:u,transparent:!0,alphaTest:.1});return{mesh:new ne.Mesh(new ne.BoxGeometry(1,1,0),[new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),h,p]),itemsTexture:c,itemsTextureFlipped:u,cleanup(){c.dispose(),u.dispose(),h.dispose(),p.dispose()}}}E();x();k();R();import*as te from"three";E();x();k();R();E();x();k();R();import{REVISION as p8}from"three";var uo=parseInt(p8.replace(/\D+/g,""));E();x();k();R();import{Loader as g8,FileLoader as b8,Group as y8,BufferGeometry as fo,Float32BufferAttribute as Nt,LineBasicMaterial as ki,Material as ho,PointsMaterial as C1,MeshPhongMaterial as _8,LineSegments as mo,Points as Ti,Mesh as po,Vector3 as H5}from"three";var w8=/^[og]\s*(.+)?/,A8=/^mtllib /,E8=/^usemtl /,x8=/^usemap /,go=new H5,Mi=new H5,bo=new H5,yo=new H5,l0=new H5;function R8(){let n={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}let r=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:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,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:i||"",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(i){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),i&&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 i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},r&&r.name&&typeof r.clone=="function"){let i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/3)*3},parseNormalIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/3)*3},parseUVIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/2)*2},addVertex:function(e,t,r){let i=this.vertices,s=this.object.geometry.vertices;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){let i=this.normals,s=this.object.geometry.normals;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,t,r){let i=this.vertices,s=this.object.geometry.normals;go.fromArray(i,e),Mi.fromArray(i,t),bo.fromArray(i,r),l0.subVectors(bo,Mi),yo.subVectors(go,Mi),l0.cross(yo),l0.normalize(),s.push(l0.x,l0.y,l0.z),s.push(l0.x,l0.y,l0.z),s.push(l0.x,l0.y,l0.z)},addColor:function(e,t,r){let i=this.colors,s=this.object.geometry.colors;i[e]!==void 0&&s.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&s.push(i[t+0],i[t+1],i[t+2]),i[r]!==void 0&&s.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,t,r){let i=this.uvs,s=this.object.geometry.uvs;s.push(i[e+0],i[e+1]),s.push(i[t+0],i[t+1]),s.push(i[r+0],i[r+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,i,s,o,a,v,l){let c=this.vertices.length,u=this.parseVertexIndex(e,c),h=this.parseVertexIndex(t,c),p=this.parseVertexIndex(r,c);if(this.addVertex(u,h,p),this.addColor(u,h,p),a!==void 0&&a!==""){let g=this.normals.length;u=this.parseNormalIndex(a,g),h=this.parseNormalIndex(v,g),p=this.parseNormalIndex(l,g),this.addNormal(u,h,p)}else this.addFaceNormal(u,h,p);if(i!==void 0&&i!==""){let g=this.uvs.length;u=this.parseUVIndex(i,g),h=this.parseUVIndex(s,g),p=this.parseUVIndex(o,g),this.addUV(u,h,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let r=0,i=e.length;r<i;r++){let s=this.parseVertexIndex(e[r],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";let r=this.vertices.length,i=this.uvs.length;for(let s=0,o=e.length;s<o;s++)this.addVertexLine(this.parseVertexIndex(e[s],r));for(let s=0,o=t.length;s<o;s++)this.addUVLine(this.parseUVIndex(t[s],i))}};return n.startObject("",!1),n}var Wt=class extends g8{constructor(e){super(e),this.materials=null}load(e,t,r,i){let s=this,o=new b8(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(a))}catch(v){i&&i(v),s.manager.itemError(e)}},r,i)}setMaterials(e){return this.materials=e,this}parse(e){let t=new R8;e.indexOf(`\r
|
|
720
720
|
`)!==-1&&(e=e.replace(/\r\n/g,`
|
|
721
721
|
`)),e.indexOf(`\\
|
|
722
722
|
`)!==-1&&(e=e.replace(/\\\n/g,""));let r=e.split(`
|
|
723
|
-
`),i="",s="",o=0,
|
|
723
|
+
`),i="",s="",o=0,a=[],v=typeof"".trimLeft=="function";for(let u=0,h=r.length;u<h;u++)if(i=r[u],i=v?i.trimLeft():i.trim(),o=i.length,o!==0&&(s=i.charAt(0),s!=="#")){if(s==="v"){let p=i.split(/\s+/);switch(p[0]){case"v":t.vertices.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),p.length>=7?t.colors.push(parseFloat(p[4]),parseFloat(p[5]),parseFloat(p[6])):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]));break;case"vt":t.uvs.push(parseFloat(p[1]),parseFloat(p[2]));break}}else if(s==="f"){let g=i.substr(1).trim().split(/\s+/),y=[];for(let b=0,w=g.length;b<w;b++){let S=g[b];if(S.length>0){let C=S.split("/");y.push(C)}}let A=y[0];for(let b=1,w=y.length-1;b<w;b++){let S=y[b],C=y[b+1];t.addFace(A[0],S[0],C[0],A[1],S[1],C[1],A[2],S[2],C[2])}}else if(s==="l"){let p=i.substring(1).trim().split(" "),g=[],y=[];if(i.indexOf("/")===-1)g=p;else for(let A=0,b=p.length;A<b;A++){let w=p[A].split("/");w[0]!==""&&g.push(w[0]),w[1]!==""&&y.push(w[1])}t.addLineGeometry(g,y)}else if(s==="p"){let g=i.substr(1).trim().split(" ");t.addPointGeometry(g)}else if((a=w8.exec(i))!==null){let p=(" "+a[0].substr(1).trim()).substr(1);t.startObject(p)}else if(E8.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(A8.test(i))t.materialLibraries.push(i.substring(7).trim());else if(!x8.test(i)){if(s==="s"){if(a=i.split(" "),a.length>1){let g=a[1].trim().toLowerCase();t.object.smooth=g!=="0"&&g!=="off"}else t.object.smooth=!0;let p=t.object.currentMaterial();p&&(p.smooth=t.object.smooth)}else if(i==="\0")continue}}t.finalize();let l=new y8;if(l.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let u=0,h=t.objects.length;u<h;u++){let p=t.objects[u],g=p.geometry,y=p.materials,A=g.type==="Line",b=g.type==="Points",w=!1;if(g.vertices.length===0)continue;let S=new fo;S.setAttribute("position",new Nt(g.vertices,3)),g.normals.length>0&&S.setAttribute("normal",new Nt(g.normals,3)),g.colors.length>0&&(w=!0,S.setAttribute("color",new Nt(g.colors,3))),g.hasUVIndices===!0&&S.setAttribute("uv",new Nt(g.uvs,2));let C=[];for(let I=0,B=y.length;I<B;I++){let H=y[I],G=H.name+"_"+H.smooth+"_"+w,O=t.materials[G];if(this.materials!==null){if(O=this.materials.create(H.name),A&&O&&!(O instanceof ki)){let j=new ki;ho.prototype.copy.call(j,O),j.color.copy(O.color),O=j}else if(b&&O&&!(O instanceof C1)){let j=new C1({size:10,sizeAttenuation:!1});ho.prototype.copy.call(j,O),j.color.copy(O.color),j.map=O.map,O=j}}O===void 0&&(A?O=new ki:b?O=new C1({size:1,sizeAttenuation:!1}):O=new _8,O.name=H.name,O.flatShading=!H.smooth,O.vertexColors=w,t.materials[G]=O),C.push(O)}let M;if(C.length>1){for(let I=0,B=y.length;I<B;I++){let H=y[I];S.addGroup(H.groupStart,H.groupCount,I)}A?M=new mo(S,C):b?M=new Ti(S,C):M=new po(S,C)}else A?M=new mo(S,C[0]):b?M=new Ti(S,C[0]):M=new po(S,C[0]);M.name=p.name,l.add(M)}else if(t.vertices.length>0){let u=new C1({size:1,sizeAttenuation:!1}),h=new fo;h.setAttribute("position",new Nt(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(h.setAttribute("color",new Nt(t.colors,3)),u.vertexColors=!0);let p=new Ti(h,u);l.add(p)}return l}};E();x();k();R();import{InstancedBufferGeometry as k8,Float32BufferAttribute as _o,InstancedInterleavedBuffer as wo,InterleavedBufferAttribute as B1,WireframeGeometry as T8,Box3 as Eo,Sphere as M8,Vector3 as S8}from"three";var Ao=new Eo,P1=new S8,ft=class extends k8{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new _o(e,3)),this.setAttribute("uv",new _o(t,2))}applyMatrix4(e){let t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let r=new wo(t,6,1);return this.setAttribute("instanceStart",new B1(r,3,0)),this.setAttribute("instanceEnd",new B1(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let r;e instanceof Float32Array?r=e:Array.isArray(e)&&(r=new Float32Array(e));let i=new wo(r,t*2,1);return this.setAttribute("instanceColorStart",new B1(i,t,0)),this.setAttribute("instanceColorEnd",new B1(i,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new T8(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Eo);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Ao.setFromBufferAttribute(t),this.boundingBox.union(Ao))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new M8),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0;for(let s=0,o=e.count;s<o;s++)P1.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(P1)),P1.fromBufferAttribute(t,s),i=Math.max(i,r.distanceToSquared(P1));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)}}toJSON(){}applyMatrix(e){return this.applyMatrix4(e)}};E();x();k();R();import{Mesh as P8,InstancedInterleavedBuffer as I8,InterleavedBufferAttribute as ko,Vector3 as So,Vector4 as H8}from"three";E();x();k();R();import{ShaderMaterial as C8,UniformsUtils as xo,UniformsLib as Ro,Vector2 as B8}from"three";var ht=class extends C8{constructor(e){super({type:"LineMaterial",uniforms:xo.clone(xo.merge([Ro.common,Ro.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new B8(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
|
|
724
724
|
#include <common>
|
|
725
725
|
#include <fog_pars_vertex>
|
|
726
726
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1123,12 +1123,12 @@ void main() {
|
|
|
1123
1123
|
gl_FragColor = diffuseColor;
|
|
1124
1124
|
|
|
1125
1125
|
#include <tonemapping_fragment>
|
|
1126
|
-
#include <${
|
|
1126
|
+
#include <${uo>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
1127
1127
|
#include <fog_fragment>
|
|
1128
1128
|
#include <premultiplied_alpha_fragment>
|
|
1129
1129
|
|
|
1130
1130
|
}
|
|
1131
|
-
`,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(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}};var Io=new Oo,Ho=new Oo,Pi=new L8,z5=class extends F8{constructor(e=new ht,t=new mt({color:Math.random()*16777215})){super(e,t),this.isWireframe=!0,this.type="Wireframe"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let o=0,v=0,a=t.count;o<a;o++,v+=2)Io.fromBufferAttribute(t,o),Ho.fromBufferAttribute(r,o),i[v]=v===0?0:i[v-1],i[v+1]=i[v]+Io.distanceTo(Ho);let s=new z8(i,2,1);return e.setAttribute("instanceDistanceStart",new Po(s,1,0)),e.setAttribute("instanceDistanceEnd",new Po(s,1,1)),this}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Pi),this.material.uniforms.resolution.value.set(Pi.z,Pi.w))}};import{GLTFLoader as R4}from"three/examples/jsm/loaders/GLTFLoader.js";import k4 from"mc-assets/dist/other-textures/latest/entity/zombie/husk.png";import{Vec3 as D1}from"vec3";import T4 from"mc-assets/dist/other-textures/latest/entity/cat/ocelot.png";import M4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/arrow.png";import S4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/spectral_arrow.png";import C4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/tipped_arrow.png";var Do={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}};E();x();k();R();var Qt={};$5(Qt,{allay:()=>Fo,arrow:()=>a3,axolotl:()=>zo,blaze:()=>Lo,boat:()=>y3,camel:()=>Uo,cat:()=>Go,chicken:()=>Vo,cod:()=>Wo,creeper:()=>No,dolphin:()=>jo,ender_dragon:()=>Yo,enderman:()=>Qo,endermite:()=>Ko,fox:()=>Jo,frog:()=>Zo,ghast:()=>qo,goat:()=>Xo,guardian:()=>$o,horse:()=>e3,llama:()=>t3,minecart:()=>r3,parrot:()=>i3,piglin:()=>n3,pillager:()=>s3,rabbit:()=>o3,shulker:()=>v3,sniffer:()=>l3,spider:()=>c3,tadpole:()=>d3,turtle:()=>u3,vex:()=>f3,villager:()=>h3,warden:()=>m3,witch:()=>p3,wolf:()=>g3,zombie_villager:()=>b3});E();x();k();R();var Fo=`# Made in Blockbench 4.9.4
|
|
1131
|
+
`,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(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}};var To=new So,Mo=new So,Si=new H8,O5=class extends P8{constructor(e=new ft,t=new ht({color:Math.random()*16777215})){super(e,t),this.isWireframe=!0,this.type="Wireframe"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let o=0,a=0,v=t.count;o<v;o++,a+=2)To.fromBufferAttribute(t,o),Mo.fromBufferAttribute(r,o),i[a]=a===0?0:i[a-1],i[a+1]=i[a]+To.distanceTo(Mo);let s=new I8(i,2,1);return e.setAttribute("instanceDistanceStart",new ko(s,1,0)),e.setAttribute("instanceDistanceEnd",new ko(s,1,1)),this}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Si),this.material.uniforms.resolution.value.set(Si.z,Si.w))}};import{GLTFLoader as _4}from"three/examples/jsm/loaders/GLTFLoader.js";import w4 from"mc-assets/dist/other-textures/latest/entity/zombie/husk.png";import{Vec3 as I1}from"vec3";import A4 from"mc-assets/dist/other-textures/latest/entity/cat/ocelot.png";import E4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/arrow.png";import x4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/spectral_arrow.png";import R4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/tipped_arrow.png";var Co={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}};E();x();k();R();var jt={};q5(jt,{allay:()=>Bo,arrow:()=>t3,axolotl:()=>Po,blaze:()=>Io,boat:()=>f3,camel:()=>Ho,cat:()=>Oo,chicken:()=>Do,cod:()=>Fo,creeper:()=>zo,dolphin:()=>Lo,ender_dragon:()=>Uo,enderman:()=>Go,endermite:()=>Vo,fox:()=>No,frog:()=>Wo,ghast:()=>jo,goat:()=>Yo,guardian:()=>Qo,horse:()=>Ko,llama:()=>Jo,minecart:()=>qo,parrot:()=>Zo,piglin:()=>Xo,pillager:()=>$o,rabbit:()=>e3,shulker:()=>r3,sniffer:()=>i3,spider:()=>n3,tadpole:()=>s3,turtle:()=>o3,vex:()=>a3,villager:()=>v3,warden:()=>l3,witch:()=>c3,wolf:()=>d3,zombie_villager:()=>u3});E();x();k();R();var Bo=`# Made in Blockbench 4.9.4
|
|
1132
1132
|
mtllib materials.mtl
|
|
1133
1133
|
|
|
1134
1134
|
o head
|
|
@@ -1452,7 +1452,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
|
|
|
1452
1452
|
f 56/156/39 51/155/39 49/154/39 54/153/39
|
|
1453
1453
|
f 55/160/40 56/159/40 54/158/40 53/157/40
|
|
1454
1454
|
f 54/164/41 49/163/41 50/162/41 53/161/41
|
|
1455
|
-
f 55/168/42 52/167/42 51/166/42 56/165/42`;var
|
|
1455
|
+
f 55/168/42 52/167/42 51/166/42 56/165/42`;var Po=`# Made in Blockbench 4.9.4
|
|
1456
1456
|
mtllib materials.mtl
|
|
1457
1457
|
|
|
1458
1458
|
o body
|
|
@@ -1960,7 +1960,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
1960
1960
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
1961
1961
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
1962
1962
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
1963
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
1963
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var Io=`# Made in Blockbench 4.9.4
|
|
1964
1964
|
mtllib materials.mtl
|
|
1965
1965
|
|
|
1966
1966
|
o upperBodyParts0
|
|
@@ -2560,7 +2560,7 @@ f 99/296/74 100/295/74 98/294/74 97/293/74
|
|
|
2560
2560
|
f 104/300/75 99/299/75 97/298/75 102/297/75
|
|
2561
2561
|
f 103/304/76 104/303/76 102/302/76 101/301/76
|
|
2562
2562
|
f 102/308/77 97/307/77 98/306/77 101/305/77
|
|
2563
|
-
f 103/312/78 100/311/78 99/310/78 104/309/78`;var
|
|
2563
|
+
f 103/312/78 100/311/78 99/310/78 104/309/78`;var Ho=`# Made in Blockbench 4.9.4
|
|
2564
2564
|
mtllib materials.mtl
|
|
2565
2565
|
|
|
2566
2566
|
o body
|
|
@@ -3620,7 +3620,7 @@ f 179/536/134 180/535/134 178/534/134 177/533/134
|
|
|
3620
3620
|
f 184/540/135 179/539/135 177/538/135 182/537/135
|
|
3621
3621
|
f 183/544/136 184/543/136 182/542/136 181/541/136
|
|
3622
3622
|
f 182/548/137 177/547/137 178/546/137 181/545/137
|
|
3623
|
-
f 183/552/138 180/551/138 179/550/138 184/549/138`;var
|
|
3623
|
+
f 183/552/138 180/551/138 179/550/138 184/549/138`;var Oo=`# Made in Blockbench 4.9.4
|
|
3624
3624
|
mtllib materials.mtl
|
|
3625
3625
|
|
|
3626
3626
|
o body
|
|
@@ -4128,7 +4128,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
4128
4128
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
4129
4129
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
4130
4130
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
4131
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
4131
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var Do=`# Made in Blockbench 4.9.4
|
|
4132
4132
|
mtllib materials.mtl
|
|
4133
4133
|
|
|
4134
4134
|
o body
|
|
@@ -4498,7 +4498,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
4498
4498
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
4499
4499
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
4500
4500
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
4501
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
4501
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var Fo=`# Made in Blockbench 4.9.4
|
|
4502
4502
|
mtllib materials.mtl
|
|
4503
4503
|
|
|
4504
4504
|
o body
|
|
@@ -4868,7 +4868,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
4868
4868
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
4869
4869
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
4870
4870
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
4871
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
4871
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var zo=`# Made in Blockbench 4.9.4
|
|
4872
4872
|
mtllib materials.mtl
|
|
4873
4873
|
|
|
4874
4874
|
o Body
|
|
@@ -5146,7 +5146,7 @@ f 43/128/32 44/127/32 42/126/32 41/125/32
|
|
|
5146
5146
|
f 48/132/33 43/131/33 41/130/33 46/129/33
|
|
5147
5147
|
f 47/136/34 48/135/34 46/134/34 45/133/34
|
|
5148
5148
|
f 46/140/35 41/139/35 42/138/35 45/137/35
|
|
5149
|
-
f 47/144/36 44/143/36 43/142/36 48/141/36`;var
|
|
5149
|
+
f 47/144/36 44/143/36 43/142/36 48/141/36`;var Lo=`# Made in Blockbench 4.9.4
|
|
5150
5150
|
mtllib materials.mtl
|
|
5151
5151
|
|
|
5152
5152
|
o body
|
|
@@ -5516,7 +5516,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
5516
5516
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
5517
5517
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
5518
5518
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
5519
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
5519
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var Uo=`# Made in Blockbench 4.9.4
|
|
5520
5520
|
mtllib materials.mtl
|
|
5521
5521
|
|
|
5522
5522
|
o neck
|
|
@@ -8508,7 +8508,7 @@ f 515/1544/386 516/1543/386 514/1542/386 513/1541/386
|
|
|
8508
8508
|
f 520/1548/387 515/1547/387 513/1546/387 518/1545/387
|
|
8509
8509
|
f 519/1552/388 520/1551/388 518/1550/388 517/1549/388
|
|
8510
8510
|
f 518/1556/389 513/1555/389 514/1554/389 517/1553/389
|
|
8511
|
-
f 519/1560/390 516/1559/390 515/1558/390 520/1557/390`;var
|
|
8511
|
+
f 519/1560/390 516/1559/390 515/1558/390 520/1557/390`;var Go=`# Made in Blockbench 4.9.4
|
|
8512
8512
|
mtllib materials.mtl
|
|
8513
8513
|
|
|
8514
8514
|
o Head
|
|
@@ -8832,7 +8832,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
|
|
|
8832
8832
|
f 56/156/39 51/155/39 49/154/39 54/153/39
|
|
8833
8833
|
f 55/160/40 56/159/40 54/158/40 53/157/40
|
|
8834
8834
|
f 54/164/41 49/163/41 50/162/41 53/161/41
|
|
8835
|
-
f 55/168/42 52/167/42 51/166/42 56/165/42`;var
|
|
8835
|
+
f 55/168/42 52/167/42 51/166/42 56/165/42`;var Vo=`# Made in Blockbench 4.9.4
|
|
8836
8836
|
mtllib materials.mtl
|
|
8837
8837
|
|
|
8838
8838
|
o section_2
|
|
@@ -9018,7 +9018,7 @@ f 27/80/20 28/79/20 26/78/20 25/77/20
|
|
|
9018
9018
|
f 32/84/21 27/83/21 25/82/21 30/81/21
|
|
9019
9019
|
f 31/88/22 32/87/22 30/86/22 29/85/22
|
|
9020
9020
|
f 30/92/23 25/91/23 26/90/23 29/89/23
|
|
9021
|
-
f 31/96/24 28/95/24 27/94/24 32/93/24`;var
|
|
9021
|
+
f 31/96/24 28/95/24 27/94/24 32/93/24`;var No=`# Made in Blockbench 4.9.4
|
|
9022
9022
|
mtllib materials.mtl
|
|
9023
9023
|
|
|
9024
9024
|
o body
|
|
@@ -9480,7 +9480,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
|
|
|
9480
9480
|
f 80/228/57 75/227/57 73/226/57 78/225/57
|
|
9481
9481
|
f 79/232/58 80/231/58 78/230/58 77/229/58
|
|
9482
9482
|
f 78/236/59 73/235/59 74/234/59 77/233/59
|
|
9483
|
-
f 79/240/60 76/239/60 75/238/60 80/237/60`;var
|
|
9483
|
+
f 79/240/60 76/239/60 75/238/60 80/237/60`;var Wo=`# Made in Blockbench 4.9.4
|
|
9484
9484
|
mtllib materials.mtl
|
|
9485
9485
|
|
|
9486
9486
|
o body
|
|
@@ -10218,7 +10218,7 @@ f 123/368/92 124/367/92 122/366/92 121/365/92
|
|
|
10218
10218
|
f 128/372/93 123/371/93 121/370/93 126/369/93
|
|
10219
10219
|
f 127/376/94 128/375/94 126/374/94 125/373/94
|
|
10220
10220
|
f 126/380/95 121/379/95 122/378/95 125/377/95
|
|
10221
|
-
f 127/384/96 124/383/96 123/382/96 128/381/96`;var
|
|
10221
|
+
f 127/384/96 124/383/96 123/382/96 128/381/96`;var jo=`# Made in Blockbench 4.9.4
|
|
10222
10222
|
mtllib materials.mtl
|
|
10223
10223
|
|
|
10224
10224
|
o body
|
|
@@ -10680,7 +10680,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
|
|
|
10680
10680
|
f 80/228/57 75/227/57 73/226/57 78/225/57
|
|
10681
10681
|
f 79/232/58 80/231/58 78/230/58 77/229/58
|
|
10682
10682
|
f 78/236/59 73/235/59 74/234/59 77/233/59
|
|
10683
|
-
f 79/240/60 76/239/60 75/238/60 80/237/60`;var
|
|
10683
|
+
f 79/240/60 76/239/60 75/238/60 80/237/60`;var Yo=`# Made in Blockbench 4.9.4
|
|
10684
10684
|
mtllib materials.mtl
|
|
10685
10685
|
|
|
10686
10686
|
o left_back_leg
|
|
@@ -11280,7 +11280,7 @@ f 99/296/74 100/295/74 98/294/74 97/293/74
|
|
|
11280
11280
|
f 104/300/75 99/299/75 97/298/75 102/297/75
|
|
11281
11281
|
f 103/304/76 104/303/76 102/302/76 101/301/76
|
|
11282
11282
|
f 102/308/77 97/307/77 98/306/77 101/305/77
|
|
11283
|
-
f 103/312/78 100/311/78 99/310/78 104/309/78`;var
|
|
11283
|
+
f 103/312/78 100/311/78 99/310/78 104/309/78`;var Qo=`# Made in Blockbench 4.9.4
|
|
11284
11284
|
mtllib materials.mtl
|
|
11285
11285
|
|
|
11286
11286
|
o head
|
|
@@ -12294,7 +12294,7 @@ f 171/512/128 172/511/128 170/510/128 169/509/128
|
|
|
12294
12294
|
f 176/516/129 171/515/129 169/514/129 174/513/129
|
|
12295
12295
|
f 175/520/130 176/519/130 174/518/130 173/517/130
|
|
12296
12296
|
f 174/524/131 169/523/131 170/522/131 173/521/131
|
|
12297
|
-
f 175/528/132 172/527/132 171/526/132 176/525/132`;var
|
|
12297
|
+
f 175/528/132 172/527/132 171/526/132 176/525/132`;var Ko=`# Made in Blockbench 4.9.4
|
|
12298
12298
|
mtllib materials.mtl
|
|
12299
12299
|
|
|
12300
12300
|
o Body
|
|
@@ -13354,7 +13354,7 @@ f 179/536/134 180/535/134 178/534/134 177/533/134
|
|
|
13354
13354
|
f 184/540/135 179/539/135 177/538/135 182/537/135
|
|
13355
13355
|
f 183/544/136 184/543/136 182/542/136 181/541/136
|
|
13356
13356
|
f 182/548/137 177/547/137 178/546/137 181/545/137
|
|
13357
|
-
f 183/552/138 180/551/138 179/550/138 184/549/138`;var
|
|
13357
|
+
f 183/552/138 180/551/138 179/550/138 184/549/138`;var Jo=`# Made in Blockbench 4.9.4
|
|
13358
13358
|
mtllib materials.mtl
|
|
13359
13359
|
|
|
13360
13360
|
o head
|
|
@@ -13862,7 +13862,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
13862
13862
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
13863
13863
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
13864
13864
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
13865
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
13865
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var qo=`# Made in Blockbench 4.9.4
|
|
13866
13866
|
mtllib materials.mtl
|
|
13867
13867
|
|
|
13868
13868
|
o bottom
|
|
@@ -14094,7 +14094,7 @@ f 35/104/26 36/103/26 34/102/26 33/101/26
|
|
|
14094
14094
|
f 40/108/27 35/107/27 33/106/27 38/105/27
|
|
14095
14095
|
f 39/112/28 40/111/28 38/110/28 37/109/28
|
|
14096
14096
|
f 38/116/29 33/115/29 34/114/29 37/113/29
|
|
14097
|
-
f 39/120/30 36/119/30 35/118/30 40/117/30`;var
|
|
14097
|
+
f 39/120/30 36/119/30 35/118/30 40/117/30`;var Zo=`# Made in Blockbench 4.9.4
|
|
14098
14098
|
mtllib materials.mtl
|
|
14099
14099
|
|
|
14100
14100
|
o body
|
|
@@ -14602,7 +14602,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
14602
14602
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
14603
14603
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
14604
14604
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
14605
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
14605
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var Xo=`# Made in Blockbench 4.9.4
|
|
14606
14606
|
mtllib materials.mtl
|
|
14607
14607
|
|
|
14608
14608
|
o Body
|
|
@@ -15340,7 +15340,7 @@ f 123/368/92 124/367/92 122/366/92 121/365/92
|
|
|
15340
15340
|
f 128/372/93 123/371/93 121/370/93 126/369/93
|
|
15341
15341
|
f 127/376/94 128/375/94 126/374/94 125/373/94
|
|
15342
15342
|
f 126/380/95 121/379/95 122/378/95 125/377/95
|
|
15343
|
-
f 127/384/96 124/383/96 123/382/96 128/381/96`;var
|
|
15343
|
+
f 127/384/96 124/383/96 123/382/96 128/381/96`;var $o=`# Made in Blockbench 4.9.4
|
|
15344
15344
|
mtllib materials.mtl
|
|
15345
15345
|
|
|
15346
15346
|
o Body
|
|
@@ -15710,7 +15710,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
15710
15710
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
15711
15711
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
15712
15712
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
15713
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
15713
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var e3=`# Made in Blockbench 4.9.4
|
|
15714
15714
|
mtllib materials.mtl
|
|
15715
15715
|
|
|
15716
15716
|
o rearFootLeft
|
|
@@ -16264,7 +16264,7 @@ f 91/272/68 92/271/68 90/270/68 89/269/68
|
|
|
16264
16264
|
f 96/276/69 91/275/69 89/274/69 94/273/69
|
|
16265
16265
|
f 95/280/70 96/279/70 94/278/70 93/277/70
|
|
16266
16266
|
f 94/284/71 89/283/71 90/282/71 93/281/71
|
|
16267
|
-
f 95/288/72 92/287/72 91/286/72 96/285/72`;var
|
|
16267
|
+
f 95/288/72 92/287/72 91/286/72 96/285/72`;var t3=`# Aspose.3D Wavefront OBJ Exporter
|
|
16268
16268
|
# Copyright 2004-2024 Aspose Pty Ltd.
|
|
16269
16269
|
# File created: 02/12/2025 20:01:28
|
|
16270
16270
|
|
|
@@ -16324,7 +16324,7 @@ f 5/8/5 6/4/6 8/3/7 7/5/8
|
|
|
16324
16324
|
f 9/11/9 10/7/10 12/6/11 11/12/12
|
|
16325
16325
|
#3 polygons
|
|
16326
16326
|
|
|
16327
|
-
`;var
|
|
16327
|
+
`;var r3=`# Made in Blockbench 4.9.4
|
|
16328
16328
|
mtllib materials.mtl
|
|
16329
16329
|
|
|
16330
16330
|
o base
|
|
@@ -16464,7 +16464,7 @@ f 19/56/14 20/55/14 18/54/14 17/53/14
|
|
|
16464
16464
|
f 24/60/15 19/59/15 17/58/15 22/57/15
|
|
16465
16465
|
f 23/64/16 24/63/16 22/62/16 21/61/16
|
|
16466
16466
|
f 22/68/17 17/67/17 18/66/17 21/65/17
|
|
16467
|
-
f 23/72/18 20/71/18 19/70/18 24/69/18`;var
|
|
16467
|
+
f 23/72/18 20/71/18 19/70/18 24/69/18`;var i3=`# Made in Blockbench 4.9.4
|
|
16468
16468
|
mtllib materials.mtl
|
|
16469
16469
|
|
|
16470
16470
|
o body
|
|
@@ -17156,7 +17156,7 @@ f 115/344/86 116/343/86 114/342/86 113/341/86
|
|
|
17156
17156
|
f 120/348/87 115/347/87 113/346/87 118/345/87
|
|
17157
17157
|
f 119/352/88 120/351/88 118/350/88 117/349/88
|
|
17158
17158
|
f 118/356/89 113/355/89 114/354/89 117/353/89
|
|
17159
|
-
f 119/360/90 116/359/90 115/358/90 120/357/90`;var
|
|
17159
|
+
f 119/360/90 116/359/90 115/358/90 120/357/90`;var n3=`# Made in Blockbench 4.9.4
|
|
17160
17160
|
mtllib materials.mtl
|
|
17161
17161
|
|
|
17162
17162
|
o head
|
|
@@ -17664,7 +17664,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
17664
17664
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
17665
17665
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
17666
17666
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
17667
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
17667
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var s3=`# Made in Blockbench 4.9.4
|
|
17668
17668
|
mtllib materials.mtl
|
|
17669
17669
|
|
|
17670
17670
|
o body
|
|
@@ -17758,7 +17758,7 @@ f 11/32/8 12/31/8 10/30/8 9/29/8
|
|
|
17758
17758
|
f 16/36/9 11/35/9 9/34/9 14/33/9
|
|
17759
17759
|
f 15/40/10 16/39/10 14/38/10 13/37/10
|
|
17760
17760
|
f 14/44/11 9/43/11 10/42/11 13/41/11
|
|
17761
|
-
f 15/48/12 12/47/12 11/46/12 16/45/12`;var
|
|
17761
|
+
f 15/48/12 12/47/12 11/46/12 16/45/12`;var o3=`# Made in Blockbench 4.9.4
|
|
17762
17762
|
mtllib materials.mtl
|
|
17763
17763
|
|
|
17764
17764
|
o body
|
|
@@ -18128,7 +18128,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
|
|
|
18128
18128
|
f 64/180/45 59/179/45 57/178/45 62/177/45
|
|
18129
18129
|
f 63/184/46 64/183/46 62/182/46 61/181/46
|
|
18130
18130
|
f 62/188/47 57/187/47 58/186/47 61/185/47
|
|
18131
|
-
f 63/192/48 60/191/48 59/190/48 64/189/48`;var
|
|
18131
|
+
f 63/192/48 60/191/48 59/190/48 64/189/48`;var a3=`# Made in Blockbench 4.9.4
|
|
18132
18132
|
mtllib materials.mtl
|
|
18133
18133
|
|
|
18134
18134
|
o body
|
|
@@ -18452,7 +18452,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
|
|
|
18452
18452
|
f 56/156/39 51/155/39 49/154/39 54/153/39
|
|
18453
18453
|
f 55/160/40 56/159/40 54/158/40 53/157/40
|
|
18454
18454
|
f 54/164/41 49/163/41 50/162/41 53/161/41
|
|
18455
|
-
f 55/168/42 52/167/42 51/166/42 56/165/42`;var
|
|
18455
|
+
f 55/168/42 52/167/42 51/166/42 56/165/42`;var v3=`# Made in Blockbench 4.9.4
|
|
18456
18456
|
mtllib materials.mtl
|
|
18457
18457
|
|
|
18458
18458
|
o body
|
|
@@ -18960,7 +18960,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
18960
18960
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
18961
18961
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
18962
18962
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
18963
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
18963
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var l3=`# Made in Blockbench 4.9.4
|
|
18964
18964
|
mtllib materials.mtl
|
|
18965
18965
|
|
|
18966
18966
|
o body
|
|
@@ -19422,7 +19422,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
|
|
|
19422
19422
|
f 80/228/57 75/227/57 73/226/57 78/225/57
|
|
19423
19423
|
f 79/232/58 80/231/58 78/230/58 77/229/58
|
|
19424
19424
|
f 78/236/59 73/235/59 74/234/59 77/233/59
|
|
19425
|
-
f 79/240/60 76/239/60 75/238/60 80/237/60`;var
|
|
19425
|
+
f 79/240/60 76/239/60 75/238/60 80/237/60`;var c3=`# Made in Blockbench 4.9.4
|
|
19426
19426
|
mtllib materials.mtl
|
|
19427
19427
|
|
|
19428
19428
|
o head
|
|
@@ -20068,7 +20068,7 @@ f 107/320/80 108/319/80 106/318/80 105/317/80
|
|
|
20068
20068
|
f 112/324/81 107/323/81 105/322/81 110/321/81
|
|
20069
20069
|
f 111/328/82 112/327/82 110/326/82 109/325/82
|
|
20070
20070
|
f 110/332/83 105/331/83 106/330/83 109/329/83
|
|
20071
|
-
f 111/336/84 108/335/84 107/334/84 112/333/84`;var
|
|
20071
|
+
f 111/336/84 108/335/84 107/334/84 112/333/84`;var d3=`# Made in Blockbench 4.9.4
|
|
20072
20072
|
mtllib materials.mtl
|
|
20073
20073
|
|
|
20074
20074
|
o head
|
|
@@ -20576,7 +20576,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
|
|
|
20576
20576
|
f 88/252/63 83/251/63 81/250/63 86/249/63
|
|
20577
20577
|
f 87/256/64 88/255/64 86/254/64 85/253/64
|
|
20578
20578
|
f 86/260/65 81/259/65 82/258/65 85/257/65
|
|
20579
|
-
f 87/264/66 84/263/66 83/262/66 88/261/66`;var
|
|
20579
|
+
f 87/264/66 84/263/66 83/262/66 88/261/66`;var u3=`# Made in Blockbench 4.9.4
|
|
20580
20580
|
mtllib materials.mtl
|
|
20581
20581
|
|
|
20582
20582
|
o Body
|
|
@@ -21038,7 +21038,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
|
|
|
21038
21038
|
f 80/228/57 75/227/57 73/226/57 78/225/57
|
|
21039
21039
|
f 79/232/58 80/231/58 78/230/58 77/229/58
|
|
21040
21040
|
f 78/236/59 73/235/59 74/234/59 77/233/59
|
|
21041
|
-
f 79/240/60 76/239/60 75/238/60 80/237/60`;var
|
|
21041
|
+
f 79/240/60 76/239/60 75/238/60 80/237/60`;var f3=`# Made in Blockbench 4.9.4
|
|
21042
21042
|
mtllib materials.mtl
|
|
21043
21043
|
|
|
21044
21044
|
o bottom
|
|
@@ -21454,9 +21454,9 @@ f 67/200/50 68/199/50 66/198/50 65/197/50
|
|
|
21454
21454
|
f 72/204/51 67/203/51 65/202/51 70/201/51
|
|
21455
21455
|
f 71/208/52 72/207/52 70/206/52 69/205/52
|
|
21456
21456
|
f 70/212/53 65/211/53 66/210/53 69/209/53
|
|
21457
|
-
f 71/216/54 68/215/54 67/214/54 72/213/54`;var Ii={allay:"data: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",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/5bX12iryuobMzIPCwnTooHTVlXreihzJgmWHh1e6ZkWtVTKiWTplXEOhPjiESzOXQyKNNQ1rOSR6JiF2Kw08OS5TKxpgIwo6GgwhHhyEOBusAAAAAnRSTlMABHH+CSEAAAKgSURBVHja7ZZxU9swDMXDWAMSRspwYiDQ7/81pyd5Vzzf3Oz4t78GRU2kF9m5Hm8y7h8sMM34zMQrcKZj3BvTRHMVoHVVJwRm41n1eSDwYFSB2QW0AoG4psY0JgRAK5BeiV7TWCD2wLt7AXkhehE1Du1BL6CPKT0quL4HgMgFxIBAy6xt3hICsYniHBRIzET+6Ij1jxg3/NUyXxEwiK0wiITZBJC3And3d10uzCzKjOkNOzGrX6wKJoUVpiTJQ5MbVseyqpX9SEQWmHUV+4obhI8LQCd5aHJDBALCRLIaQuRfWSRhBK51M7bKQ5MbqwpLjAyB5Kmw6AoFToZAgNCE0OQQMIXEGHkFtU3UUsUU9XX6DnlocgNNql4HvEuRAzWO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UB0IRgQ26FnndclAdkFKwdAdiH44YyQSD6JpSK70NjNa9DciTlnpBtFAe2UB8YwXcF9CTCxggErD8RvADLgkXiZRjzsMkK7jJcFVuN/5l7nm3icRCFjL4fJRdkuXPfngCi54uxP1hEzonQX4v7sRMLnMefhfpIwXrAFhXyw4P7/kgmYSeJwxJwAAAAASUVORK5CYII=",vex:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAMFBMVEUAAABthJtgeY9Ta4H////z+Pzg6fHG2eqivNWUrMOGn7eCl6t5kqp6j6RthJtgcoMKluMvAAAABHRSTlMAoKCgEjok+wAAAPlJREFUeNq1yL1Kw1AAhuE3hxYrRYm5gmivQL0Hwa1LnAtCFpdOjuKY4KBjfnYhIUPWEnIBhgxZRSjHC8hp3KWxkg5ndfD5pu8FDqNAKQkwKXIE9Fuj3zCQjECYDCaPs4tOQP9pDME4B1MAbIwTgJEwv2yixPcCPw2igGkcljlZ3YfP33WSJTB9yhG25HaJPLUBtkCdvl5fpVlVVRy3ntdQZW+eX6e77UIcNqAke0eq+JCgGvam4apoUGqtHtC067K9Q1O+l2WMJl9RvPAnl7+0L5Ao9NBB16GxZpZloTGFeWYC47l7DzrXcUF3sHTQjW9YoHMW4zn/5QeNK1xt8XQSVQAAAABJRU5ErkJggg==",villager:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAbFBMVEX///++iGy3gnKze2J6enpra2thYWFUVFRUU1NISElMODM9LSkAAAD///++iGy3gnKUj4m1e2eze2KBfXl/e3eja01vbWqQXkNjYmAAlhFUU1N1Ry93QjVcQjpISElMODM9LSkzJBEjIyMjGBTjk4HHAAAADXRSTlMAAAAAAAAAAAAAAAAA7Uh4SAAAAn9JREFUeNrtlN1ymzAQRm3cuG5C9oMFJIW0idu+/zt2/wieiTNAk0ufgdEKs0cryWJXB0RguUEO1/Xzc871Irs3AViTQdnYLgAzGfmPkFnT9V4tiAI+IyC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ASUVORK5CYII="};E();x();k();R();import*as ze from"three";var Hi=class{constructor(e,t){this.object=e;this.animations=t;d(this,"clock",new ze.Clock);d(this,"animatedObjects",new Set);d(this,"state")}createAnimationState(){let e=new ze.AnimationMixer(this.object),t=new Map;for(let r of this.animations)t.set(r.name,e.clipAction(r));return this.state={mixer:e,animations:this.animations,actions:t,speed:1,loop:!0},this.object.traverse(r=>{if(r instanceof ze.Mesh||r instanceof ze.Line||r instanceof ze.Points||r instanceof ze.Sprite){let i=r.onBeforeRender;r.onBeforeRender=(s,o,v,a,l,c)=>{let u=this.clock.getDelta();e.update(u),i?.(s,o,v,a,l,c)}}}),this.animatedObjects.add(this.object),this.state}playAnimation(e,t,r){let i=this.state.actions.get(e);if(!i)return!1;this.state.mixer.stopAllAction();let s=t??this.state.loop;return i.setLoop(s?ze.LoopRepeat:ze.LoopOnce,1/0),i.clampWhenFinished=!s,r===void 0?i.timeScale=this.state.speed:i.timeScale=r,i.reset().fadeIn(.1).play(),!0}updateAnimationParams(e,t){e!==void 0&&(this.state.speed=e),t!==void 0&&(this.state.loop=t);for(let r of this.state.actions.values())e!==void 0&&(r.timeScale=e),t!==void 0&&(r.setLoop(t?ze.LoopRepeat:ze.LoopOnce,1/0),r.clampWhenFinished=!t)}stopAnimations(){this.state.mixer.stopAllAction()}getDelta(){return this.clock.getDelta()}};function _3(n,e){let t=new Hi(n,e);return t.createAnimationState(),t}function B4(n){return"parts"in n&&Array.isArray(n.parts)?n.parts:[n]}var P4={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 w3(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function I4(n,e,t,r,i=!1,s=64,o=64,v=!1,a=[]){let l=new te.Euler(0,0,0);r.rotation&&(l.x=-r.rotation[0]*Math.PI/180,l.y=-r.rotation[1]*Math.PI/180,l.z=-r.rotation[2]*Math.PI/180);for(let{dir:c,corners:u,u0:f,v0:p,u1:g,v1:y}of Object.values(P4)){let A=Math.floor(n.positions.length/3),b=c[0]!==0,_=[];for(let S of u){let C,M;i?(C=(r.uv[0]+S[3]*r.size[0])/s,M=(r.uv[1]+S[4]*r.size[1])/o):(C=(r.uv[0]+w3(S[3]?g:f,r.size))/s,M=(r.uv[1]+w3(S[4]?y:p,r.size))/o);let P=b&&v?S[0]^1:S[0],B=S[1],H=b&&v?S[2]^1:S[2],G=r.inflate??0,O=new te.Vector3(r.origin[0]+P*r.size[0]+(P?G:-G),r.origin[1]+B*r.size[1]+(B?G:-G),r.origin[2]+H*r.size[2]+(H?G:-G));O=O.applyEuler(l),O=O.sub(t.position),O=O.applyEuler(t.rotation),O=O.add(t.position),n.positions.push(O.x,O.y,O.z),n.normals.push(c[0],c[1],c[2]),_.push(C,M),n.skinIndices.push(e,0,0,0),n.skinWeights.push(1,0,0,0)}if(v)for(let S=0;S+1<u.length;S+=2){let C=S*2,M=_.slice(C,C+4);_[C]=M[2],_[C+1]=M[b?1:3],_[C+2]=M[0],_[C+3]=M[b?3:1]}n.uvs.push(..._),n.indices.push(A,A+1,A+2,A+2,A+1,A+3)}}function F0(n,e,t,r={},i={}){let s=t.texturewidth??64,o=t.textureheight??64,v,a=e.startsWith("block:"),l=n?.material.map;if(a){if(!n)throw new Error("worldRenderer is required for block textures");let _=e.slice(6),S=n.resourcesManager.currentResources.blocksAtlasJson.textures[_];S&&(s=l?.image.width??s,o=l?.image.height??o,v=[S.u,S.v])}let c={},u={positions:[],normals:[],uvs:[],indices:[],skinIndices:[],skinWeights:[]},f=0;for(let _ of t.bones){let S=new te.Bone;if(_.pivot&&(S.position.x=_.pivot[0],S.position.y=_.pivot[1],S.position.z=_.pivot[2]),_.bind_pose_rotation?(S.rotation.x=-_.bind_pose_rotation[0]*Math.PI/180,S.rotation.y=-_.bind_pose_rotation[1]*Math.PI/180,S.rotation.z=-_.bind_pose_rotation[2]*Math.PI/180):_.rotation&&(S.rotation.x=-_.rotation[0]*Math.PI/180,S.rotation.y=-_.rotation[1]*Math.PI/180,S.rotation.z=-_.rotation[2]*Math.PI/180),r.rotation?.[_.name]&&(S.rotation.x-=(r.rotation[_.name].x??0)*Math.PI/180,S.rotation.y-=(r.rotation[_.name].y??0)*Math.PI/180,S.rotation.z-=(r.rotation[_.name].z??0)*Math.PI/180),S.name=`bone_${_.name}`,c[_.name]=S,_.cubes)for(let C of _.cubes){let M=[];I4(u,f,S,C,a,s,o,_.mirror,M),M.length&&(i.errors??(i.errors=[]),i.errors.push(...M.map(P=>`Bone ${_.name}: ${P}`)))}f++}let p=[];for(let _ of t.bones)_.parent&&c[_.parent]?c[_.parent].add(c[_.name]):p.push(c[_.name]);let g=new te.Skeleton(Object.values(c)),y=new te.BufferGeometry;y.setAttribute("position",new te.Float32BufferAttribute(u.positions,3)),y.setAttribute("normal",new te.Float32BufferAttribute(u.normals,3)),y.setAttribute("uv",new te.Float32BufferAttribute(u.uvs,2)),y.setAttribute("skinIndex",new te.Uint16BufferAttribute(u.skinIndices,4)),y.setAttribute("skinWeight",new te.Float32BufferAttribute(u.skinWeights,4)),y.setIndex(u.indices);let A=new te.MeshLambertMaterial({transparent:!0,alphaTest:.1,side:te.DoubleSide}),b=new te.SkinnedMesh(y,A);if(b.add(...p),b.bind(g),b.scale.set(1/16,1/16,1/16),v){let _=l.clone();_.offset.set(v[0],v[1]),_.needsUpdate=!0,A.map=_}else f1(e,_=>{A.map||(_.magFilter=te.NearestFilter,_.minFilter=te.NearestFilter,_.flipY=!1,_.wrapS=te.RepeatWrapping,_.wrapT=te.RepeatWrapping,A.map=_)},()=>{let _=A.map.image.width;_&&s!==_&&(A.map.repeat.x=s/_);let S=A.map.image.height;S&&o!==S&&(A.map.repeat.y=o/S),A.needsUpdate=!0});return b}var H4=[{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 A3(n){for(let e of H4)if(typeof e.pattern=="string"){if(e.pattern===n)return e.target}else if(e.pattern.test(n))return e.target}var E3=n=>Do[n],x3={zombie:1.85,husk:1.85,arrow:.0025},O4={zombie:new D1(0,1,0),husk:new D1(0,1,0),boat:new D1(0,-1,0),arrow:new D1(0,-.9,0)},S0=class{constructor(e,t,r,i={},s={}){d(this,"mesh");d(this,"animations");d(this,"animationControllers",[]);let o=t,v=A3(t);if(v&&(t=v,s.tempMap=v),i.customModel){let l=B4(i.customModel);this.mesh=new te.Object3D;for(let c=0;c<l.length;c++){let{modelPath:u,modelType:f,metadata:p}=l[c],g=new te.Object3D;switch(g.name=`custom_part_${c}`,f){case"gltf":{new R4().parseAsync(u,"").then(A=>{if(g.add(A.scene),p?.scale){let b=p.scale;g.scale.set(b,b,b)}if(p?.offset){let{x:b=0,y:_=0,z:S=0}=p.offset;g.position.set(b,_,S)}if(p?.texture){let b=Ht(p.texture);g.traverse(_=>{_ instanceof te.Mesh&&(_.material=new te.MeshBasicMaterial({map:b,transparent:!0,alphaTest:.1}))})}if(A.animations?.length){this.animations=[...this.animations??[],...A.animations];let b=_3(g,A.animations);this.animationControllers.push(b);let _=p?.animation,S=p?.animationLoop??!0;_?b.playAnimation(_,S):b.playAnimation(A.animations[0].name,S)}}).catch(A=>{});break}case"obj":{let A=new Yt().parse(u);if(p?.scale){let{scale:b}=p;A.scale.set(b,b,b)}if(p?.offset){let{x:b=0,y:_=0,z:S=0}=p.offset;A.position.set(b,_,S)}if(p?.texture){let b=Ht(p.texture),_=new te.MeshBasicMaterial({map:b,transparent:!0,alphaTest:.1});A.traverse(S=>{S instanceof te.Mesh&&(S.material=_)})}g.add(A);break}case"bedrock":{let y=JSON.parse(u);if(p?.scale&&g.scale.set(p.scale,p.scale,p.scale),p?.offset){let{x:A=0,y:b=0,z:_=0}=p.offset;g.position.set(A,b,_)}for(let[A,b]of Object.entries(y.geometry)){let _=p?.textures?.[A]??y.textures?.[A];if(!_)continue;let S=F0(r,_.endsWith(".png")||_.startsWith("data:image/")||_.startsWith("block:")?_:_+".png",b,i,s);S.name=`geometry_${A}`,g.add(S)}break}}this.mesh.add(g)}s.type=l.length===1?l[0].modelType:"special";return}if(Qt[t]){let l=new Yt,c={zombie_horse:`textures/${e}/entity/horse/horse_zombie.png`,husk:k4,skeleton_horse:`textures/${e}/entity/horse/horse_skeleton.png`,donkey:`textures/${e}/entity/horse/donkey.png`,mule:`textures/${e}/entity/horse/mule.png`,ocelot:T4,arrow:M4,spectral_arrow:S4,tipped_arrow:C4},u=c[o]||c[t];u&&(s.textureMap=!0);let f=u||Ii[t];if(Ii[t]&&(s.isHardcodedTexture=!0),!f)throw new Error(`No texture for ${t}`);let p=Ht(f),g=new te.MeshBasicMaterial({map:p,transparent:!0,alphaTest:.1}),y=l.parse(Qt[t]),A=x3[o]||x3[t];A&&y.scale.set(A,A,A);let b=O4[o];b&&y.position.set(b.x,b.y,b.z),y.traverse(_=>{_ instanceof te.Mesh&&(_.material=g,_.name==="Head layer"&&(_.visible=!1),_.name==="Head"&&i.rotation?.head&&(_.rotation.x-=(i.rotation.head.x??0)*Math.PI/180,_.rotation.y-=(i.rotation.head.y??0)*Math.PI/180,_.rotation.z-=(i.rotation.head.z??0)*Math.PI/180))}),this.mesh=y,s.type="obj";return}let a=E3(t);if(a){this.mesh=new te.Object3D;for(let[l,c]of Object.entries(a.geometry)){let u=i.textures?.[l]??a.textures[l];if(!u)continue;let f=F0(r,u.endsWith(".png")||u.startsWith("data:image/")||u.startsWith("block:")?u:u+".png",c,i,s);f.name=`geometry_${l}`,this.mesh.add(f)}s.type="bedrock"}}playAnimation(e,t=!1){if(!this.animationControllers.length)return;let r=!1;for(let i of this.animationControllers)i.playAnimation(e,t)&&(r=!0)}update(e){}static getStaticData(e){if(e=A3(e)||e,Qt[e])return{boneNames:[]};let t=E3(e);if(!t)throw new Error(`Unknown entity ${e}`);return{boneNames:Object.values(t.geometry).flatMap(r=>r.name)}}};globalThis.EntityMesh=S0;E();x();k();R();import{default as z4}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_1.png";import{default as L4}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_2.png";import{default as U4}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_1.png";import{default as G4}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_2.png";import{default as V4}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_1.png";import{default as W4}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_2.png";import{default as N4}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_1.png";import{default as j4}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_2.png";import{default as Y4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1.png";import{default as Q4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1_overlay.png";import{default as K4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2.png";import{default as J4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2_overlay.png";import{default as Z4}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_1.png";import{default as q4}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_2.png";import{default as X4}from"mc-assets/dist/other-textures/latest/models/armor/turtle_layer_1.png";import{default as k3}from"mc-assets/dist/other-textures/latest/entity/elytra.png";var z0={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 R3={leather_layer_1:Y4,leather_layer_1_overlay:Q4,leather_layer_2:K4,leather_layer_2_overlay:J4,chainmail_layer_1:z4,chainmail_layer_2:L4,iron_layer_1:N4,iron_layer_2:j4,diamond_layer_1:U4,diamond_layer_2:G4,golden_layer_1:V4,golden_layer_2:W4,netherite_layer_1:Z4,netherite_layer_2:q4,turtle_layer_1:X4};var P3=It(e0),$4=120,Oi=n=>n*(Math.PI/180),Di=n=>Math.max(0,Math.min(1,n)),Fi=(n,e,t)=>Math.max(e,Math.min(t,n)),Kt=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function ev(n){return n<0&&(n=4294967295+n+1>>>0),n.toString(16)}function tv(n){if(n===void 0)return;if(parseInt(n,10)===0)return"rgba(0, 0, 0, 0)";let e=ev(parseInt(n,10));return e.length===8?`#${e.slice(2,8)}${e.slice(0,2)}`:`#${e}`}function T3(n,e){return n===void 0?e:n instanceof N.Quaternion?n:Array.isArray(n)?new N.Quaternion(n[0],n[1],n[2],n[3]):new N.Quaternion(n.x,n.y,n.z,n.w)}function w0(n,e){return n===void 0?e??new N.Euler:n instanceof N.Euler?n:n.yaw!==void 0&&n.pitch!==void 0&&n.roll!==void 0?new N.Euler(-Oi(n.pitch),-Oi(n.yaw),Oi(n.roll),"ZYX"):n.x!==void 0&&n.y!==void 0&&n.z!==void 0?new N.Euler(n.z,n.y,n.x,"ZYX"):Array.isArray(n)?new N.Euler(n[0],n[1],n[2]):e??new N.Euler}var F1=Math.PI*2;function rv(n,e){let t=((e-n)%F1+F1)%F1;return t>Math.PI?t-F1:t}function I3({username:n,nameTagBackgroundColor:e="rgba(0, 0, 0, 0.3)",nameTagTextOpacity:t=255},{fontFamily:r="mojangles"},i){let s=je(64,64),o=B3(i),v=s.getContext("2d");if(!v)throw new Error("Could not get 2d context");let a=48,l=5;v.font=`${a}px ${r}`;let c=String(typeof n=="string"?n:new o(n).toString()).split(`
|
|
21458
|
-
`),u=0;for(let p of c){let g=v.measureText(p).width+l*2;g>u&&(u=g)}if(s.width=u,s.height=(a+l)*c.length,v.fillStyle=e,v.fillRect(0,0,s.width,s.height),v.globalAlpha=t/255,!!Kr(n,o,s,a,"white",-l+a))return v.globalAlpha=1,s}globalThis.getUsernameTexture=I3;var L1=(n,e,t,r)=>{for(let a of t.children)a.name==="nametag"&&a.removeFromParent();if(n.username===void 0||n.username===null||(typeof n.username=="string"?n.username:new(B3(r))(n.username).toString()).startsWith("EMPTY"))return;let s=I3(n,e,r);if(!s)return;let o=new N.Texture(s);o.needsUpdate=!0;let v;if(n.nameTagFixed){let a=new N.PlaneGeometry,l=new N.MeshBasicMaterial({map:o});l.transparent=!0,v=new N.Mesh(a,l),v.rotation.set(n.pitch,N.MathUtils.degToRad(n.yaw+180),0),v.position.y+=n.height+.3}else{let a=new N.SpriteMaterial({map:o});v=new N.Sprite(a),v.position.y+=n.height+.6}return v.renderOrder=1e3,v.scale.set(s.width*.005,s.height*.005,1),n.nameTagRotationRight&&v.applyQuaternion(n.nameTagRotationRight),n.nameTagScale&&v.scale.multiply(n.nameTagScale),n.nameTagRotationLeft&&v.applyQuaternion(n.nameTagRotationLeft),n.nameTagTranslation&&v.position.add(n.nameTagTranslation),v.name="nametag",t.add(v),v},M3={},iv=n=>n.charAt(0)===n.charAt(0).toUpperCase();function S3(n){if(n!=null){if(Array.isArray(n))return n;if(typeof n=="object"){let e=n,t=Object.keys(e).filter(r=>/^\d+$/.test(r)).map(Number).sort((r,i)=>r-i);if(t.length&&t[0]===0&&t.every((r,i)=>r===i))return t.map(r=>e[String(r)])}}}function nv(n,e,t,r,i){if(e.name)try{let l=(iv(e.name)?Ri(e.name):e.name).toLowerCase(),c=new S0("1.16.4",l,t,i);if(c.mesh)return L1(e,r,c.mesh,t.version),c.mesh}catch(l){reportError?.(l)}if(!n||!(0,C3.isEntityAttackable)(n,e))return;let s=new N.BoxGeometry(e.width,e.height,e.width);s.translate(0,e.height/2,0);let o=new N.MeshBasicMaterial({color:16711935}),v=new N.Mesh(s,o);return(M3[e.name]=(M3[e.name]||0)+1)<6&&L1({username:e.name,height:e.height},r,v,t.version),v}var U1=class{constructor(e,t){this.worldRenderer=e;this.mcData=t;d(this,"entities",{});d(this,"playerEntity",null);d(this,"entitiesOptions",{fontFamily:"mojangles"});d(this,"debugMode");d(this,"onSkinUpdate");d(this,"clock",new N.Clock);d(this,"currentlyRendering",!0);d(this,"cachedMapsImages",{});d(this,"itemFrameMaps",{});d(this,"pendingModelOverrides",new Map);d(this,"motionCache",new Map);d(this,"_wasThirdPerson",!1);d(this,"_tpBodyYaw",0);d(this,"_tpHasBodyYaw",!1);d(this,"uuidPerSkinUrlsCache",{});d(this,"currentSkinUrls",{});d(this,"loadedSkinEntityIds",new Set);d(this,"playerPerAnimation",{});this.debugMode="none",this.onSkinUpdate=()=>{},this.watchResourcesUpdates()}updateAutoWalkFlags(e,t,r,i){if(!t.playerObject?.animation)return;let s=t.playerObject.animation;if(r<=0)return;let o=i??t.position,v=this.motionCache.get(e);if(!v){this.motionCache.set(e,{pos:o.clone(),speed:0}),s.isMoving=!1,s.isRunning=!1,s.moveAmount=0,s.runAmount=0;return}let a=o.x-v.pos.x,l=o.z-v.pos.z;v.pos.copy(o);let c=Math.hypot(a,l)/Math.max(r,1e-6),u=1-Math.exp(-r*12);v.speed+=(c-v.speed)*u;let f=v.speed,p=(C,M,P)=>{let B=Di((P-C)/(M-C));return B*B*(3-2*B)},g=.08,y=.6,A=4.3,b=5.6,_=p(g,y,f),S=p(A,b,f);s.moveAmount=_,s.runAmount=S,s.isMoving=_>.15,s.isRunning=S>.55}getLocalSneak(){let e=this.worldRenderer.playerStateReactive;return e?.movementState==="SNEAKING"||e?.movementState==="CROUCHING"||!!e?.isSneaking||!!e?.sneaking||!!e?.isCrouching||!!e?.crouching||!!e?.controls?.sneak||!!e?.controlState?.sneak}updateThirdPersonHeadAndBody(e,t){let r=e.playerObject?.animation,i=this.worldRenderer.cameraShake.getBaseRotation(),s=i.yaw,o=i.pitch,v=Di(r?.moveAmount??(r?.isMoving?1:0)),a=Di(r?.runAmount??(r?.isRunning?1:0)),l=v>.15;if(this._tpHasBodyYaw||(this._tpHasBodyYaw=!0,this._tpBodyYaw=s),l){let g=1-Math.exp(-t*(18+10*a));this._tpBodyYaw=this._tpBodyYaw+Kt(s-this._tpBodyYaw)*g,e.rotation.set(0,this._tpBodyYaw,0);let y=(25-8*a)*Math.PI/180,A=Fi(Kt(s-this._tpBodyYaw),-y,y);r&&"lookYaw"in r&&(r.lookYaw=A),r&&"lookPitch"in r&&(r.lookPitch=-o);return}let c=85*Math.PI/180,u=55*Math.PI/180,f=Kt(s-this._tpBodyYaw);f=Fi(f,-c,c);let p=Math.abs(f)-u;if(p>0){let g=p/(c-u),y=s-Math.sign(f)*u,A=1-Math.exp(-t*(6+10*g));this._tpBodyYaw=this._tpBodyYaw+Kt(y-this._tpBodyYaw)*A,f=Kt(s-this._tpBodyYaw),f=Fi(f,-c,c)}else{let g=1-Math.exp(-t*5);this._tpBodyYaw=this._tpBodyYaw+Kt(s-this._tpBodyYaw)*(g*.15)}e.rotation.set(0,this._tpBodyYaw,0),r&&"lookYaw"in r&&(r.lookYaw=f),r&&"lookPitch"in r&&(r.lookPitch=-o)}get entitiesByName(){let e={};for(let t of Object.values(this.entities))t.realName&&(e[t.realName]=e[t.realName]||[],e[t.realName].push(t));return e}get entitiesRenderingCount(){return Object.values(this.entities).filter(e=>e.visible).length}getDebugString(){let e=Object.keys(this.entities).length,t=this.entitiesRenderingCount,r=Object.values(this.entities).filter(s=>s.playerObject),i=r.filter(s=>s.visible);return`${t}/${e} ${i.length}/${r.length}`}handlePlayerEntity(e){if(!this.playerEntity){let t=new N.Group;t.originalEntity={...e,name:"player"};let r=new N.Group,i=this.setupPlayerObject(e,r,{});t.playerObject=i,t.add(r),t.name="player_entity",this.playerEntity=t,this.worldRenderer.scene.add(t),this.updatePlayerSkin(e.id,e.username,e.uuid??void 0,e0)}this.playerEntity.originalEntity={...e,name:"player"},e.position&&(this.worldRenderer.sceneOrigin.getWorldPosition(this.playerEntity)||this.worldRenderer.sceneOrigin.track(this.playerEntity),this.playerEntity.position.set(e.position.x,e.position.y,e.position.z)),e.yaw!==void 0&&(this.playerEntity.rotation.y=e.yaw),this.updateEntityEquipment(this.playerEntity,e)}clear(){for(let e of Object.values(this.entities))this.worldRenderer.sceneOrigin.removeAndUntrack(e),ke(e);this.entities={},this.currentSkinUrls={},this.motionCache.clear(),this._wasThirdPerson=!1,this._tpHasBodyYaw=!1,this.playerEntity&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.playerEntity),ke(this.playerEntity),this.playerEntity=null)}reloadEntities(){for(let e of Object.values(this.entities))this.update({...e.originalEntity,delete:!0},{}),this.update(e.originalEntity,{})}watchResourcesUpdates(){this.worldRenderer.resourcesManager.on("assetsTexturesUpdated",()=>this.reloadEntities()),this.worldRenderer.resourcesManager.on("assetsInventoryReady",()=>this.reloadEntities())}setDebugMode(e,t=null){this.debugMode=e;for(let r of t?[t]:Object.values(this.entities)){let i=r.children.find(s=>s.name==="debug");i.visible=!1,this.debugMode==="basic"&&(i.visible=!0)}}setRendering(e,t=null){this.currentlyRendering=e;for(let r of t?[t]:Object.values(this.entities))e?this.worldRenderer.scene.children.includes(r)||this.worldRenderer.scene.add(r):this.worldRenderer.scene.remove(r)}playEntityModelAnimation(e,t,r=!1){let i=this.entities[e];i&&i.traverse(s=>{s instanceof S0&&s.playAnimation(t,r)})}render(){let e=this.worldRenderer.worldRendererConfig.renderEntities;e!==this.currentlyRendering&&this.setRendering(e);let t=this.clock.getDelta(),r=Math.min(t,1/30),i=this.worldRenderer.viewerChunkPosition,s=10*10,o=this.worldRenderer.playerStateUtils.isThirdPerson();if(o!==this._wasThirdPerson){this._wasThirdPerson=o;let v=String(this.playerEntity?.originalEntity.id??"player_entity");this.motionCache.delete(v);let a=this.playerEntity?.playerObject?.animation;a?.resetLocomotion&&a.resetLocomotion(),this._tpHasBodyYaw=!1}for(let[v,a]of[...Object.entries(this.entities),["player_entity",this.playerEntity]]){if(!a)continue;let l=v==="player_entity",c=String(l?this.playerEntity?.originalEntity.id??"player_entity":v);if(l)if(a.visible=o,o){let f=this.worldRenderer.playerStateReactive.eyeHeight;a.position.set(this.worldRenderer.cameraWorldPos.x,this.worldRenderer.cameraWorldPos.y-f,this.worldRenderer.cameraWorldPos.z);let p=this.worldRenderer.playerStateReactive.position;if(p&&typeof p.x=="number")this.updateAutoWalkFlags(c,a,t,new N.Vector3(p.x,p.y,p.z));else{let g=this.worldRenderer.sceneOrigin.getWorldPosition(a);this.updateAutoWalkFlags(c,a,t,g?new N.Vector3(g.x,g.y,g.z):a.position)}this.updateThirdPersonHeadAndBody(a,r)}else{let f=this.worldRenderer.sceneOrigin.getWorldPosition(a);this.updateAutoWalkFlags(c,a,t,f?new N.Vector3(f.x,f.y,f.z):a.position)}else{let f=this.worldRenderer.sceneOrigin.getWorldPosition(a);this.updateAutoWalkFlags(c,a,t,f?new N.Vector3(f.x,f.y,f.z):a.position)}let{playerObject:u}=a;if(u?.animation){let f=u.animation,g=(Number(a.originalEntity?.metadata?.[0]??0)&2)!==0,y=this.getLocalSneak();"isCrouched"in f&&(f.isCrouched=l?y:g),u.animation.update(u,r)}if(a.traverse(f=>{f instanceof S0&&f.update(r)}),!l&&i&&a.position){let f=a.position.x-i.x,p=a.position.y-i.y,g=a.position.z-i.z,y=f*f+p*p+g*g;a.visible=!!(y<s||this.worldRenderer.shouldObjectVisible(a)),this.maybeRenderPlayerSkin(v)}a.visible&&this.syncArmorPositions(a)}}syncArmorPositions(e){e.playerObject&&e.traverse(t=>{if(!t.name.startsWith("geometry_armor_"))return;let{skin:r}=e.playerObject;switch(t.name){case"geometry_armor_head":t.children[0]?.children[0]&&t.children[0].children[0].rotation.set(-r.head.rotation.x,r.head.rotation.y,r.head.rotation.z,r.head.rotation.order);break;case"geometry_armor_legs":t.children[0]&&(t.children[0].children[2]&&t.children[0].children[2].rotation.set(-r.leftLeg.rotation.x,r.leftLeg.rotation.y,r.leftLeg.rotation.z,r.leftLeg.rotation.order),t.children[0].children[1]&&t.children[0].children[1].rotation.set(-r.rightLeg.rotation.x,r.rightLeg.rotation.y,r.rightLeg.rotation.z,r.rightLeg.rotation.order));break;case"geometry_armor_feet":t.children[0]&&(t.children[0].children[0]&&t.children[0].children[0].rotation.set(-r.rightLeg.rotation.x,r.rightLeg.rotation.y,r.rightLeg.rotation.z,r.rightLeg.rotation.order),t.children[0].children[1]&&t.children[0].children[1].rotation.set(-r.leftLeg.rotation.x,r.leftLeg.rotation.y,-r.leftLeg.rotation.z,r.leftLeg.rotation.order));break}})}getPlayerObject(e){return this.playerEntity?.originalEntity.id===e?this.playerEntity?.playerObject:this.entities[e]?.playerObject}isCanvasBlank(e){return!e.getContext("2d")?.getImageData(0,0,e.width,e.height).data.some(t=>t!==0)}async updatePlayerSkin(e,t,r,i,s=void 0){i!==e0&&this.loadedSkinEntityIds.add(String(e)),r&&((typeof i=="string"||typeof s=="string")&&(this.uuidPerSkinUrlsCache[r]={}),typeof i=="string"&&(this.uuidPerSkinUrlsCache[r].skinUrl=i),typeof s=="string"&&(this.uuidPerSkinUrlsCache[r].capeUrl=s),i===!0&&(i=this.uuidPerSkinUrlsCache[r]?.skinUrl??i),s??(s=this.uuidPerSkinUrlsCache[r]?.capeUrl));let v=this.getPlayerObject(e);if(!v)return;if(i===!0){if(!t)return;let l=await O0(t,"skin");if(!this.getPlayerObject(e)||!l)return;i=l}if(typeof i!="string")throw new Error("Invalid skin url");if(this.currentSkinUrls[String(e)]===i){if(s){if(s===!0&&t){let l=await O0(t,"cape");if(!this.getPlayerObject(e)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(e,s)}return}i!==e0&&(this.currentSkinUrls[String(e)]=i);let a=this.worldRenderer.worldRendererConfig.renderEars||t==="deadmau5";this.loadAndApplySkin(e,i,a).then(async()=>{if(s){if(s===!0&&t){let l=await O0(t,"cape");if(!this.getPlayerObject(e)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(e,s)}}),v.cape.visible=!1,s||(v.backEquipment=null,v.elytra.map=null,v.cape.map&&v.cape.map.dispose(),v.cape.map=null)}async loadAndApplySkin(e,t,r){let i=this.getPlayerObject(e);if(i)try{let s;if(i=this.getPlayerObject(e),!i)return;let o,v;if(t===e0){let l=await _0(e0);s=l.image,o=new N.CanvasTexture(l.canvas),v=l.canvas}else{let{canvas:l,image:c}=await _0(t);s=c,o=new N.CanvasTexture(l),v=l}o.magFilter=N.NearestFilter,o.minFilter=N.NearestFilter,o.needsUpdate=!0,i.skin.map=o,i.skin.modelType=Gr(v),i.skin.isCustom=t!==e0,Mi(i);let a;if(s?r&&(a=je(64,64),Vr(a,s),r=!this.isCanvasBlank(a)):r=!1,r){let l=new N.CanvasTexture(a);l.magFilter=N.NearestFilter,l.minFilter=N.NearestFilter,l.needsUpdate=!0,i.ears.map=l,i.ears.visible=!0}else i.ears.map=null,i.ears.visible=!1;this.onSkinUpdate?.()}catch{}}async loadAndApplyCape(e,t){let r=this.getPlayerObject(e);if(r)try{let{canvas:i,image:s}=await _0(t);if(r=this.getPlayerObject(e),!r)return;Ur(i,s);let o=new N.CanvasTexture(i);o.magFilter=N.NearestFilter,o.minFilter=N.NearestFilter,o.needsUpdate=!0,r.cape.map=o,r.cape.visible=!0,r.elytra.map=o,this.onSkinUpdate?.(),r.backEquipment||(r.backEquipment="cape")}catch{}}debugSwingArm(){let e=Object.values(this.entities).find(r=>r.playerObject?.animation);if(!e||!e.playerObject?.animation)return;let t=e.playerObject.animation;t.swingArm&&t.swingArm()}playAnimation(e,t){let r=String(e);if(t!=="oneSwing"){if(this.playerPerAnimation[r]===t)return;this.playerPerAnimation[r]=t}if(e==="player_entity"&&this.playerEntity?.playerObject){let{playerObject:s}=this.playerEntity;if(t==="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=t==="walking"||t==="running"||t==="crouchWalking",o.isRunning=t==="running",o.isCrouched=t==="crouch"||t==="crouchWalking")});return}let i=this.getPlayerObject(e);if(i){if(t==="oneSwing"){i.animation&&i.animation.swingArm&&i.animation.swingArm();return}i.animation&&i.animation.switchAnimationCallback!==void 0&&(i.animation.switchAnimationCallback=()=>{let s=i.animation;s&&(s.isMoving=t==="walking"||t==="running"||t==="crouchWalking",s.isRunning=t==="running",s.isCrouched=t==="crouch"||t==="crouchWalking")});return}if(this.playerEntity?.playerObject){let{playerObject:s}=this.playerEntity;if(t==="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=t==="walking"||t==="running"||t==="crouchWalking",o.isRunning=t==="running",o.isCrouched=t==="crouch"||t==="crouchWalking")})}}parseEntityLabel(e){if(e)try{if(e.type==="string")return e.value;let t=typeof e=="string"?L5.default.simplify(L5.default.parse(e)):Li.simplify(e);return wi(t).map(this.textFromComponent).join("")}catch{return e}}textFromComponent(e){return typeof e=="string"?e:e.text??""}getItemMesh(e,t,r=!1,i){!e.nbt&&e.nbtData&&(e.nbt=e.nbtData);let s=this.worldRenderer.getItemRenderData(e,t);if(!(i&&i===s?.modelName)){if(s&&"resolvedModel"in s){let o=Gs(this.worldRenderer.material,s.resolvedModel,s.modelName,this.worldRenderer.resourcesManager.currentResources.worldBlockProvider,this.worldRenderer.resourcesManager.currentResources.mcData),v=1;t["minecraft:display_context"]==="ground"?v=.5:t["minecraft:display_context"]==="thirdperson"&&(v=6),o.scale.set(v,v,v);let a=new N.Group;return a.add(o),{mesh:a,isBlock:!0,modelName:s.modelName}}if(s){let o=s.renderInfo?.texture==="blocks"?this.worldRenderer.material.map:this.worldRenderer.itemsTexture,{u:v,v:a,su:l,sv:c}=s,p=go(o,{u:v,v:a,sizeX:l??1,sizeY:c??1},{faceCamera:r,use3D:!r}),g=1;return t["minecraft:display_context"]==="ground"?g=.5:t["minecraft:display_context"]==="thirdperson"&&(g=6),p.mesh.scale.set(g,g,g),{mesh:p.mesh,isBlock:!1,modelName:s.modelName,cleanup:p.cleanup}}}}setVisible(e,t){t?e.scale.set(1,1,1):e.scale.set(0,0,0)}update(e,t){let r=e.name==="player";(e.name==="zombie_villager"||e.name==="husk")&&(t.texture=`textures/1.16.4/entity/${e.name==="zombie_villager"?"zombie_villager/zombie_villager.png":`zombie/${e.name}.png`}`),e.name==="glow_item_frame"&&(t.textures||(t.textures=[]),t.textures.background="block:glow_item_frame");let i=this.entities[e.id],s=!i;if(e.delete){if(!i)return;i.userData._posTween?.stop(),i.userData._rotTween?.stop(),i.additionalCleanup&&i.additionalCleanup(),i.traverse(g=>{g.additionalCleanup&&g.additionalCleanup()}),this.onRemoveEntity(e),this.worldRenderer.sceneOrigin.removeAndUntrack(i),ke(i),delete this.entities[e.id];return}let o;if(i===void 0){this.beforeEntityAdded(e);let g=new N.Group;if(g.originalEntity=e,e.name==="item"||e.name==="tnt"||e.name==="falling_block"||e.name==="snowball"||e.name==="egg"||e.name==="ender_pearl"||e.name==="experience_bottle"||e.name==="splash_potion"||e.name==="lingering_potion"){let b=e.name==="tnt"||e.type==="projectile"?{name:e.name}:e.name==="falling_block"?{blockState:e.objectData}:S3(e.metadata)?.find(_=>typeof _=="object"&&_?.itemCount);if(b){let _=this.getItemMesh(b,{"minecraft:display_context":"ground"},e.type==="projectile");if(_){if(o=_.mesh,e.name==="item"||e.type==="projectile"?(o.scale.set(.5,.5,.5),o.position.set(0,e.name==="item"?.2:.1,0)):(o.scale.set(2,2,2),o.position.set(0,.5,0)),e.name==="item"){let S=new N.Clock;o.onBeforeRender=()=>{let C=S.getDelta();o.rotation.y+=C}}g.additionalCleanup=()=>{_.cleanup&&_.cleanup()}}}}else if(r){let b=new N.Group,_=this.setupPlayerObject(e,b,t);if(g.playerObject=_,o=b,e.username){let S=L1(e,{fontFamily:"mojangles"},b,this.worldRenderer.version);S&&(S.position.y=_.position.y+_.scale.y*16+3,S.scale.multiplyScalar(12))}}else o=nv(this.mcData,e,this.worldRenderer,this.entitiesOptions,{...t,customModel:e.customModel});if(!o)return;o.name="mesh";let y=e.pos??e.position;this.worldRenderer.sceneOrigin.track(g),g.position.set(y.x,y.y,y.z);let A=new N.BoxHelper(o,e.type==="hostile"?16711680:e.type==="mob"?65280:e.type==="player"?255:16753920);A.name="debug",g.add(o),g.add(A),A.visible=!1,this.worldRenderer.scene.add(g),i=g,i.name="entity",i.realName=e.name,this.entities[e.id]=i,r&&this.updatePlayerSkin(e.id,e.username,t?.texture?e.uuid:void 0,t?.texture||e0),this.setDebugMode(this.debugMode,g),this.setRendering(this.currentlyRendering,g),this.afterAddEntity(e)}else o=i.children.find(g=>g.name==="mesh");this.updateEntityEquipment(i,e);let v=H3(e,this.mcData),l=(S3(e.metadata)?.[0]??e.metadata?.[0]??0)&32||this.worldRenderer.playerStateReactive.cameraSpectatingEntity===e.id&&this.worldRenderer.playerStateUtils.isSpectator();for(let g of o.children??[])g.name!=="nametag"&&(g.visible=!l);v.baby?i.scale.set(.5,.5,.5):i.scale.set(1,1,1);let c=z1("text_display",e,this.mcData),u=c?.text||v.custom_name_visible&&v.custom_name;if(e.name!=="player"&&u){let g=c&&(c.billboard_render_constraints==="fixed"||!c.billboard_render_constraints),y=c&&!(parseInt(c.style_flags,10)&4)?tv(c.background_color):void 0,A;if(c?.text_opacity){let b=parseInt(c?.text_opacity,10);A=b>0?b:256-b}L1({...e,username:typeof u=="string"?L5.default.simplify(L5.default.parse(u)):Li.simplify(u),nameTagBackgroundColor:y,nameTagTextOpacity:A,nameTagFixed:g,nameTagScale:c?.scale,nameTagTranslation:c&&(c.translation||new N.Vector3(0,0,0)),nameTagRotationLeft:T3(c?.left_rotation),nameTagRotationRight:T3(c?.right_rotation)},this.entitiesOptions,o,this.worldRenderer.version)}let f=z1("armor_stand",e,this.mcData);if(f){let g=(parseInt(f.client_flags,10)&1)!==0,y=(parseInt(f.client_flags,10)&4)!==0,A=(parseInt(f.client_flags,10)&8)===0,b=(parseInt(f.client_flags,10)&16)!==0;o.castShadow=!b,o.receiveShadow=!b,g?i.scale.set(.5,.5,.5):i.scale.set(1,1,1),i.traverse(_=>{switch(_.name){case"bone_baseplate":this.setVisible(_,A),_.rotation.y=-i.rotation.y;break;case"bone_head":f.head_pose&&_.setRotationFromEuler(w0(f.head_pose));break;case"bone_body":f.body_pose&&_.setRotationFromEuler(w0(f.body_pose));break;case"bone_rightarm":_.parent?.name!=="bone_armor"&&this.setVisible(_,y),f.left_arm_pose?_.setRotationFromEuler(w0(f.left_arm_pose)):_.setRotationFromEuler(w0({yaw:-10,pitch:-10,roll:0}));break;case"bone_leftarm":_.parent?.name!=="bone_armor"&&this.setVisible(_,y),f.right_arm_pose?_.setRotationFromEuler(w0(f.right_arm_pose)):_.setRotationFromEuler(w0({yaw:10,pitch:-10,roll:0}));break;case"bone_rightleg":f.left_leg_pose?_.setRotationFromEuler(w0(f.left_leg_pose)):_.setRotationFromEuler(w0({yaw:-1,pitch:-1,roll:0}));break;case"bone_leftleg":f.right_leg_pose?_.setRotationFromEuler(w0(f.right_leg_pose)):_.setRotationFromEuler(w0({yaw:1,pitch:1,roll:0}));break}})}let p=z1("item_frame",e,this.mcData);if(p||(p=z1("glow_item_frame",e,this.mcData)),p){let g=p?.item??e.metadata?.[8];if(o.scale.set(1,1,1),o.position.set(0,0,-.5),i.rotation.x=-e.pitch,i.children.find(y=>{if(y.name.startsWith("map_")){ke(y);let A=parseInt(y.name.split("_")[1],10);return this.itemFrameMaps[A]=this.itemFrameMaps[A]?.filter(b=>b!==y),y instanceof N.Mesh&&y.material?.map?.dispose(),!0}else if(y.name==="item")return ke(y),!0;return!1})?.removeFromParent(),g&&(g.itemId??g.blockId??0)!==0){let y=p.rotation??0,A=g.nbtData?.value?.map?.value??g.components?.find(b=>b.type==="map_id")?.data;if(A)o.scale.set(16/12,16/12,1),this.addMapModel(i,A,y);else{let b=this.getItemMesh(g,{"minecraft:display_context":"fixed"});b&&(b.mesh.position.set(0,0,-.05),b.isBlock?b.mesh.scale.set(.25,.25,.25):b.mesh.scale.set(.5,.5,.5),b.mesh.rotateY(Math.PI),b.mesh.rotateZ(-y*Math.PI/4),b.mesh.name="item",i.add(b.mesh))}}}e.username!==void 0&&(i.username=e.username),this.updateNameTagVisibility(i),this.updateEntityPosition(e,s,t)}updateEntityPosition(e,t,r){let i=this.entities[e.id];if(!i)return;let s=t?0:$4;if(e.position){let v=this.worldRenderer.sceneOrigin.getWorldPosition(i)??{x:e.position.x,y:e.position.y,z:e.position.z};i.userData._tweenTarget||(i.userData._tweenTarget={x:v.x,y:v.y,z:v.z}),i.userData._posTween?.stop(),i.userData._posTween=new De(i.userData._tweenTarget).to({x:e.position.x,y:e.position.y,z:e.position.z},s).onUpdate(()=>{i.position.set(i.userData._tweenTarget.x,i.userData._tweenTarget.y,i.userData._tweenTarget.z)}).start()}let o;if(i.playerObject&&r?.rotation?.head){let v=r.rotation.head.y,a=typeof v=="number"&&Number.isFinite(v)?v:e.yaw;typeof a=="number"&&Number.isFinite(a)&&(o=a)}else typeof e.yaw=="number"&&Number.isFinite(e.yaw)&&(o=e.yaw);if(typeof o=="number"&&Number.isFinite(o)){let v=rv(i.rotation.y,o);i.userData._rotTween?.stop(),i.userData._rotTween=new De(i.rotation).to({y:i.rotation.y+v},s).start()}if(i?.playerObject&&r?.rotation?.head){let{playerObject:v}=i;v.skin.head.rotation.y=0;let a=r.rotation.head.x;v.skin.head.rotation.x=typeof a=="number"&&Number.isFinite(a)?-a:0}}afterAddEntity(e){}beforeEntityAdded(e){let t=this.pendingModelOverrides.get(e.id.toString());if(t){let{parts:r}=t;e.customModel=r.length===1?r[0]:{parts:r},this.pendingModelOverrides.delete(e.id.toString())}}maybeRenderPlayerSkin(e){let t=this.entities[e];if(e==="player_entity"&&(t=this.playerEntity,e=this.playerEntity?.originalEntity.id),!t||!t.playerObject||!t.visible)return;let r=128,i=this.worldRenderer.getCameraPosition(),s=this.worldRenderer.sceneOrigin.getWorldPosition(t),v=(s?new N.Vector3(s.x,s.y,s.z):t.position.clone().add(new N.Vector3(this.worldRenderer.sceneOrigin.x,this.worldRenderer.sceneOrigin.y,this.worldRenderer.sceneOrigin.z))).distanceTo(i);if(v<r&&v<this.worldRenderer.viewDistance*16){if(this.loadedSkinEntityIds.has(String(e)))return;this.updatePlayerSkin(e,t.playerObject.realUsername,t.playerObject.realPlayerUuid,!0,!0)}}onRemoveEntity(e){this.loadedSkinEntityIds.delete(e.id.toString()),delete this.currentSkinUrls[e.id.toString()],this.motionCache.delete(e.id.toString())}updateMap(e,t){this.cachedMapsImages[e]=t;let r=this.itemFrameMaps[e];if(r&&(r=r.filter(i=>i.parent),this.itemFrameMaps[e]=r,r))for(let i of r)i.material.map=this.loadMap(t),i.material.needsUpdate=!0,i.visible=!0}updateNameTagVisibility(e){let t=this.worldRenderer.playerStateReactive.team,r=e.originalEntity.team,i=r?.nameTagVisibility||"always",s=i==="always"||i==="hideForOwnTeam"&&r?.team!==t?.team||i==="hideForOtherTeams"&&(r?.team===t?.team||t===void 0);e.traverse(o=>{o.name==="nametag"&&(o.visible=s)})}addMapModel(e,t,r){let i=this.cachedMapsImages?.[t],s=null;i&&(s=this.loadMap(i));let o={transparent:!0,alphaTest:.1};s&&(o.map=s);let v=new N.MeshLambertMaterial(o),a=new N.Mesh(new N.PlaneGeometry(1,1),v);a.rotation.set(0,Math.PI,0),e.add(a);let l=!0;e.traverseVisible(c=>{c.name==="geometry_frame"&&(l=!1)}),l?a.position.set(0,0,.499):a.position.set(0,0,.437),a.rotateZ(Math.PI*2-r*Math.PI/2),a.name=`map_${t}`,s||(a.visible=!1),this.itemFrameMaps[t]||(this.itemFrameMaps[t]=[]),this.itemFrameMaps[t].push(a)}loadMap(e){let t=Ht(e);return t.needsUpdate=!0,t}addItemModel(e,t,r,i=!1){let s=`bone_${t}item`,o=`custom_item_${t}`;if(e.traverse(a=>{a.name===o&&(a.removeFromParent(),a.additionalCleanup&&a.additionalCleanup())}),!r)return;let v=this.getItemMesh(r,{"minecraft:display_context":"thirdperson"});v?.mesh&&e.traverse(a=>{if(a.name.toLowerCase()===s||a.name===`${t}Arm`){let l=new N.Object3D;l.additionalCleanup=()=>{v.cleanup&&v.cleanup()};let c=v.mesh;l.rotation.z=-Math.PI/16,v.isBlock?l.rotation.y=Math.PI/4:(c.rotation.z=-Math.PI/4,l.rotation.y=Math.PI/2,l.scale.multiplyScalar(2)),i&&(l.position.y=-8,l.position.z=5,l.position.x=t==="left"?1:-1,l.rotation.x=Math.PI),l.add(c),l.name=o,a.add(l)}})}handleDamageEvent(e,t){let r=this.entities[e]?.children.find(i=>i.name==="mesh");r&&r.traverse(i=>{if(i instanceof N.Mesh&&i.material.clone){i.material.clone().dispose(),i.material=i.material.clone();let o=i.material.color.clone();i.material.color.set(16711680),new De(i.material.color).to(o,500).start()}})}raycastSceneDebug(){let e=new N.Raycaster;return e.setFromCamera(new N.Vector2(0,0),this.worldRenderer.camera),e.intersectObjects(this.worldRenderer.scene.children)[0]?.object}updateEntityModel(e,t,r,i){let s=Array.isArray(t)?t:[{modelPath:t,modelType:r,metadata:i}];this.pendingModelOverrides.set(e,{parts:s});let o=this.entities[e];o&&(this.update({...o.originalEntity,delete:!0},{}),this.update(o.originalEntity,{}))}setupPlayerObject(e,t,r){let i=new zt;i.realPlayerUuid=e.uuid??"",i.realUsername=e.username??"",i.position.set(0,16,0),Mi(i),t.add(i);let s=1/16;return t.scale.set(s,s,s),t.rotation.set(0,Math.PI,0),i.animation=new D5,i.animation.isMoving=!1,i}updateEntityEquipment(e,t){if(!e||!t.equipment)return;let r=t.type==="player";if(this.addItemModel(e,r?"right":"left",t.equipment[0],r),this.addItemModel(e,r?"left":"right",t.equipment[1],r),U5(this.worldRenderer,e,"feet",t.equipment[2]),U5(this.worldRenderer,e,"legs",t.equipment[3],2),U5(this.worldRenderer,e,"chest",t.equipment[4]),U5(this.worldRenderer,e,"head",t.equipment[5]),r&&e.playerObject){let{playerObject:i}=e;i.backEquipment=t.equipment.some(s=>s?.name==="elytra")?"elytra":"cape",i.backEquipment==="elytra"&&this.loadAndApplyCape(t.id,k3),i.cape.map===null&&(i.cape.visible=!1)}}};function H3(n,e){let t=e?.entitiesByName[n.name];return new Proxy({},{get(r,i,s){if(typeof i!="string"||!t)return;let o=t.metadataKeys?.indexOf(i);return n.metadata?.[o??-1]}})}function z1(n,e,t){if(e.name===n)return H3(e,t)}function U5(n,e,t,r,i=1,s=!1){if(!r){zi(e,t);return}let o=r.name.split("_"),v,a=t==="head"&&r.name==="player_head";if(a)if(zi(e,t),r.nbt){let g=Li.simplify(r.nbt);try{let y;if(g.SkullOwner?y=g.SkullOwner.Properties.textures[0]?.Value:y=g["minecraft:profile"]?.Properties?.find(A=>A.name==="textures")?.value,y){v=JSON.parse(z.from(y,"base64").toString()).textures?.SKIN?.url;let{skinTexturesProxy:b}=n.worldRendererConfig;b&&(v=v?.replace("http://textures.minecraft.net/",b).replace("https://textures.minecraft.net/",b))}}catch{}}else v=e0;let l=o[0];if(!v){let g=`${l}_layer_${i}${s?"_overlay":""}`;v=n.resourcesManager.currentResources.customTextures.armor?.textures[g]?.src??R3[g]}if(!v||!z0[t]){zi(e,t);return}let c=`geometry_armor_${t}${s?"_overlay":""}`,u=e.children.findLast(g=>g.name===c),f;if(u?(f=u.material,f1(v,g=>{g.magFilter=N.NearestFilter,g.minFilter=N.NearestFilter,g.flipY=!1,g.wrapS=N.MirroredRepeatWrapping,g.wrapT=N.MirroredRepeatWrapping,f.map=g})):(u=F0(n,v,z0[t]),t==="head"&&(u.children[0].position.y+=.01),u.name=c,f=u.material,a||(f.side=N.DoubleSide)),l==="leather"&&!s){let g=r.nbt?.value?.display?.value?.color?.value;if(g){let y=g>>16&255,A=g>>8&255,b=g&255;f.color.setRGB(y/255,A/255,b/255)}else f.color.setHex(11890001);U5(n,e,t,r,i,!0)}else f.color.setHex(16777215);let p=new N.Object3D;p.name=`armor_${t}${s?"_overlay":""}`,p.add(u),e.add(u)}function zi(n,e){for(let t of n.children)(t.name===`geometry_armor_${e}`||t.name===`geometry_armor_${e}_overlay`)&&t.removeFromParent()}var Ui=async(n,e)=>{let t;if(!n&&!e)t=await P3;else{if(n||(n=await O0(e,"skin")),!n)return;let{canvas:a}=await _0(n);t=new Le.CanvasTexture(a)}t.magFilter=Le.NearestFilter,t.minFilter=Le.NearestFilter;let r=new Le.BoxGeometry,i=new Le.MeshStandardMaterial,s=!1,o=new Le.Mesh(r,i);o.scale.x=s?3:4,o.scale.y=12,o.scale.z=4,ov(r,40,16,s?3:4,12,4),i.map=t,i.needsUpdate=!0;let v=new Le.Group;return v.add(o),v.scale.set(.1,.1,.1),o.rotation.z=Math.PI,v};function sv(n,e,t,r,i,s,o,v){let a=(B,H,G,O)=>[new Le.Vector2(B/o,1-O/v),new Le.Vector2(G/o,1-O/v),new Le.Vector2(G/o,1-H/v),new Le.Vector2(B/o,1-H/v)],l=a(e+s,t,e+r+s,t+s),c=a(e+r+s,t,e+r*2+s,t+s),u=a(e,t+s,e+s,t+s+i),f=a(e+s,t+s,e+r+s,t+s+i),p=a(e+r+s,t+s,e+r+s*2,t+i+s),g=a(e+r+s*2,t+s,e+r*2+s*2,t+i+s),y=n.attributes.uv,A=[p[3],p[2],p[0],p[1]],b=[u[3],u[2],u[0],u[1]],_=[l[3],l[2],l[0],l[1]],S=[c[0],c[1],c[3],c[2]],C=[f[3],f[2],f[0],f[1]],M=[g[3],g[2],g[0],g[1]],P=[];for(let B of[A,b,_,S,C,M])for(let H of B)P.push(H.x,H.y);y.set(new Float32Array(P)),y.needsUpdate=!0}function ov(n,e,t,r,i,s){sv(n,e,t,r,i,s,64,64)}var D3={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]}},G5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new ue.Mesh);d(this,"objectOuterGroup",new ue.Group);d(this,"objectInnerGroup",new ue.Group);d(this,"holdingBlockInnerGroup",new ue.Group);d(this,"camera",new ue.PerspectiveCamera(75,1,.1,100));d(this,"stopUpdate",!1);d(this,"lastHeldItem");d(this,"lastHeldItemRenderKey");d(this,"isSwinging",!1);d(this,"nextIterStopCallbacks");d(this,"idleAnimator");d(this,"ready",!1);d(this,"lastUpdate",0);d(this,"playerHand");d(this,"offHandDisplay",!1);d(this,"offHandModeLegacy",!1);d(this,"swingAnimator");d(this,"config");d(this,"disposed",!1);d(this,"unsubs",[]);d(this,"lastItemModelName");d(this,"switchRequest",0);this.initCameraGroup(),this.unsubs.push(O3(this.worldRenderer.playerStateReactive,"heldItemMain",()=>{this.offHand||this.updateItem()})),this.unsubs.push(O3(this.worldRenderer.playerStateReactive,"heldItemOff",()=>{this.offHand&&this.updateItem()})),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Ui().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=A1(async()=>Ui(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",i=>{i&&(this.playerHand=i,this.updateItem())},i=>{ke(i,!0)});this.unsubs.push(r)})}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new ue.Mesh}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,r,i){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 ue.Scene;o.add(this.cameraGroup),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let v=t.getSize(new ue.Vector2),a=Math.min(v.width,v.height),l=v.width-a,{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),this.offHandDisplay)t.setViewport(0,0,a,a);else{let u=v.width-a;t.setViewport(u,0,a,a)}t.render(o,this.camera),t.setViewport(0,0,v.width,v.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new dt(()=>({y:this.objectInnerGroup.position.y}),(s,o)=>{s==="y"&&(this.objectInnerGroup.position.y=o)},{y:16})});let t=e,r=this.objectInnerGroup.position.y+this.objectInnerGroup.scale.y*1.5*(t==="appeared"?1:-1),i=!1;return new Promise(s=>{this.blockSwapAnimation.switcher.transitionTo({y:r},t,()=>{i||s(!0)},()=>{i=!0,s(!1)})})}isDifferentItem(e){return this.lastHeldItemRenderKey!==Ft(this.worldRenderer,e)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this;this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation);let t=1,{position:r,scale:i}=this.getHandHeld3d(),s=-r.z,o=this.offHandModeLegacy?-1:1;this.objectOuterGroup.position.set(s*r.x*t*o,s*r.y,-s);let v=i*2.22*.2;this.objectOuterGroup.scale.set(v,v,v)}async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let i=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},x1(this.worldRenderer),!1,this.lastItemModelName);if(i){let{mesh:s,isBlock:o,modelName:v}=i;o?(t=s,e.type="block"):(s.position.set(.5,.5,.5),t=s,e.type="item"),this.lastItemModelName=v}}else t=this.playerHand;if(!t)return;t.name="holdingBlock";let r=this.getHandHeld3d().rotation;return t.rotation.x=ue.MathUtils.degToRad(r.x),t.rotation.y=ue.MathUtils.degToRad(r.y),t.rotation.z=ue.MathUtils.degToRad(r.z),{model:t,type:e.type}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.holdingBlockInnerGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(e){let t=Ft(this.worldRenderer,e),r=this.lastHeldItemRenderKey!==t;if(this.lastHeldItem=e,!r)return;this.lastHeldItemRenderKey=t,this.lastItemModelName=void 0;let i=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0}if(!e){this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(i!==this.switchRequest)return;let o=await this.createItemModel(e);if(!o||i!==this.switchRequest)return;let v=new ue.Group;this.holdingBlockInnerGroup.removeFromParent(),this.holdingBlockInnerGroup=new ue.Group,this.holdingBlockInnerGroup.add(o.model),v.add(this.holdingBlockInnerGroup),this.holdingBlock=o.model,this.objectInnerGroup=new ue.Group,this.objectInnerGroup.add(v),this.objectInnerGroup.position.set(-.5,-.5,-.5),s&&(this.objectInnerGroup.position.y-=this.objectInnerGroup.scale.y*1.5),Object.assign(v.position,{x:.5,y:.5,z:.5}),this.objectOuterGroup=new ue.Group,this.objectOuterGroup.add(this.objectInnerGroup),this.cameraGroup.add(this.objectOuterGroup);let a=this.getHandHeld3d().rotation;this.objectOuterGroup.rotation.y=ue.MathUtils.degToRad(a.yOuter),s&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator??(this.swingAnimator=new Vi(this.holdingBlockInnerGroup)),this.swingAnimator.setHandMesh(this.holdingBlockInnerGroup),this.swingAnimator.type=o.type,this.config.viewBobbing&&(this.idleAnimator=new Gi(this.holdingBlockInnerGroup,this.worldRenderer.playerStateReactive))}getHandHeld3d(){let e=this.lastHeldItem?.type??"hand",t=this.offHandModeLegacy?"Left":"Right",r=.8*1.15,i={x:.4,y:-.7,z:-.45},s={x:-32.4,y:42.8,z:-41.3,yOuter:0};if(e==="item"){let o=D3[`item${t}`];i={x:-.05,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},r=o.scale[0]*1.15}else if(e==="block"){let o=D3[`block${t}`];i={x:.4,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},r=o.scale[0]*1.15}return{rotation:s,position:i,scale:r}}dispose(){this.disposed=!0,this.ready=!1,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,ke(this.cameraGroup,!0),ke(this.objectOuterGroup,!0),ke(this.objectInnerGroup,!0),ke(this.holdingBlockInnerGroup,!0),this.holdingBlock=void 0,this.playerHand&&(ke(this.playerHand,!0),this.playerHand=void 0)}},Gi=class{constructor(e,t){this.handMesh=e;this.playerState=t;d(this,"globalTime",0);d(this,"lastTime",0);d(this,"currentState");d(this,"targetState");d(this,"defaultPosition");d(this,"idleOffset",{y:0,rotationZ:0});d(this,"tween",new Bt);d(this,"idleTween",null);d(this,"stateSwitcher");d(this,"debugParams",{walkingSpeed:8,sprintingSpeed:16,walkingAmplitude:{x:1/30,y:1/10,rotationZ:.25},sprintingAmplitude:{x:1/30,y:1/10,rotationZ:.4}});d(this,"debugGui");d(this,"updated",!1);this.handMesh=e,this.globalTime=0,this.currentState="NOT_MOVING",this.targetState="NOT_MOVING",this.defaultPosition={x:e.position.x,y:e.position.y,z:e.position.z,rotationX:e.rotation.x,rotationY:e.rotation.y,rotationZ:e.rotation.z},this.stateSwitcher=new dt(()=>({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}),(r,i)=>{switch(r){case"x":this.handMesh.position.x=i;break;case"y":this.handMesh.position.y=i;break;case"z":this.handMesh.position.z=i;break;case"rotationX":this.handMesh.rotation.x=i;break;case"rotationY":this.handMesh.rotation.y=i;break;case"rotationZ":this.handMesh.rotation.z=i;break}},{x:2,y:2,z:2,rotation:Math.PI}),this.debugGui=new T0("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 De(this.idleOffset,this.tween).to({y:.05,rotationZ:.05},3e3).easing(He.Sinusoidal.InOut).yoyo(!0).repeat(1/0).start()}stopIdleAnimation(){this.idleTween&&(this.idleTween.stop(),this.idleOffset.y=0,this.idleOffset.rotationZ=0)}getStateTransform(e,t){switch(e){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 r=e==="SPRINTING"?this.debugParams.sprintingSpeed:this.debugParams.walkingSpeed,i=e==="SPRINTING"?this.debugParams.sprintingAmplitude:this.debugParams.walkingAmplitude;return{x:this.defaultPosition.x+Math.sin(t*r)*i.x,y:this.defaultPosition.y-Math.abs(Math.cos(t*r))*i.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ}}}}setState(e){if(e===this.targetState)return;this.targetState=e;let t=!1;if(this.currentState!==e){if(this.stopIdleAnimation(),!t){let r=this.getStateTransform(e,this.globalTime);this.stateSwitcher.transitionTo(r,e)}this.currentState=e}}update(){this.stateSwitcher.update();let e=performance.now(),t=(e-this.lastTime)/1e3;if(this.lastTime=e,!this.stateSwitcher.isTransitioning)switch(this.currentState){case"NOT_MOVING":case"SNEAKING":this.globalTime=Math.PI/4;break;case"SPRINTING":case"WALKING":this.globalTime+=t;break}if(this.playerState){let r=this.playerState.movementState;r!==this.targetState&&this.setState(r)}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 r=this.getStateTransform(this.currentState,this.globalTime);Object.assign(this.handMesh.position,r),Object.assign(this.handMesh.rotation,{x:r.rotationX,y:r.rotationY,z:r.rotationZ})}}getCurrentState(){return this.currentState}destroy(){this.stopIdleAnimation(),this.stateSwitcher.forceFinish()}},Vi=class{constructor(e){this.handMesh=e;d(this,"PI",Math.PI);d(this,"animationTimer",0);d(this,"lastTime",0);d(this,"isAnimating",!1);d(this,"stopRequested",!1);d(this,"originalRotation");d(this,"originalPosition");d(this,"originalScale");d(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});d(this,"debugGui");d(this,"type","hand");this.handMesh=e,this.originalRotation=e.rotation.clone(),this.originalPosition=e.position.clone(),this.originalScale=e.scale.clone(),this.debugGui=new T0("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(e){this.handMesh=e,this.originalRotation.copy(e.rotation),this.originalPosition.copy(e.position),this.originalScale.copy(e.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 e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let r=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(r>=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 i=r,s=Math.sqrt(i),o=Math.sin(i*this.PI),v=Math.sin(s*this.PI);if(this.type==="hand"){let a=this.debugParams.armSwingXPosScale*v,l=this.debugParams.armSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.armSwingZPosScale*o;this.handMesh.position.x+=a,this.handMesh.position.y+=l+this.debugParams.armHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=ue.MathUtils.degToRad(this.debugParams.armSwingYRotAmount*v),this.handMesh.rotation.z+=ue.MathUtils.degToRad(this.debugParams.armSwingZRotAmount*o)}else{let a=this.debugParams.itemSwingXPosScale*v,l=this.debugParams.itemSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.itemSwingZPosScale*o;this.handMesh.position.x+=a,this.handMesh.position.y+=l+this.debugParams.itemHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=ue.MathUtils.degToRad(this.debugParams.itemPreswingRotY),this.handMesh.rotation.x+=ue.MathUtils.degToRad(this.debugParams.itemSwingXRotAmount*o),this.handMesh.rotation.y+=ue.MathUtils.degToRad(this.debugParams.itemSwingYRotAmount*v),this.handMesh.rotation.z+=ue.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 V5(n,e=!1){return n.displayOptions.inWorldRenderingConfig.handRenderer==="legacy"?new G5(n,e):new C5(n,e)}E();x();k();R();import*as Ke from"three";import{Vec3 as Wi}from"vec3";var F3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAALUlEQVR42mP4//8/IyWYYdSAwW6Ara3tf4oMmD179n9ChhD0AsiQ0Wgc7AYAAOqH+zNQ3r9kAAAAAElFTkSuQmCC";var z3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOklEQVR42mP4//8/IyWYYdQA3AbY2tr+H1gDZs+e/R9mCD7D8IYBzBAQTXYgEvIKQQPw2T6aEqlkAADEA/W3ycLXvwAAAABJRU5ErkJggg==";var L3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQklEQVR42mP4//8/IyWYYRgbYGtr+39wGQDiYzMUpwGzZ8+GawDRID4IkxSIMEOwaSQ6FgiFBW0NIOR8osJgBOQFALo37sVTOo/LAAAAAElFTkSuQmCC";var U3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWElEQVR42mP4//8/IyWYYXAbYGtr+59sA0CaZ8+eTZkBhNg4DQApQlYIcglMDN1VWA0AKYJpQvYONi/hDUSYIfjCgmA0EooJ2hmAK9CINgBXoA2xvEAMBgBGPud3dYZtOQAAAABJRU5ErkJggg==";var G3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVR42r1TQQrAMAxyD8tL89iMHgQJoQxHewi0UsWYFFX1/CkcF4iIsgUWOTM9ASV3F3rHF+v9rK4wEVnEFoFYbwmTbRZFFN9m0B9QZBfk2THaAhqktQdTkHYL9iZe+40vs7nda+BuVOMAAAAASUVORK5CYII=";var V3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR42rWTWwpAIQhEbWGu1MUaXRgQcXpyP8SIPI1jibu3l5DfAKrqyFgfAczsKxx5xJUCFGYFUZXMpOe9CAa8BOS+0U5UVbYQ6Siqbi0BFT0auTSRHZqNkE6BGXgEYKYtAczIbQAz8ukzXT3l3egz49IXvXQCVAAAAABJRU5ErkJggg==";var W3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeElEQVQ4jaWSQQ4AIQgD9WG8tI/tnkgaUgmuBw8YHcqERXK/nOUuI4JPAABMSESwA1qAQgAQwBygnfNjTaCpWoBzUlNZQJ07x9FUdgSlV5FaW4Cjq8isW8BJ2GgPtEuVdr0HKvLXHjiRI0An8jTKqo9dF000cnBzPgKuxXtbq/m1AAAAAElFTkSuQmCC";var N3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVR42qWTSRKAMAgE8WF5KY/FygEL2yEp9cAhCz0wJBYRx58wbowxYsZngLvHjITsgNYpJySBrPIBUMqZSHhdSw+oQlgVa01U7VRQ7huTk67aUWZaVyaNZFsSQBCTVBW3KahLyo/lQ6KR1Y+2BTUyGqke1AXoxsSzpYlU3FW0/Exv1ie0hq53Bf15aAAAAABJRU5ErkJggg==";var j3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmklEQVR42o2SYQ6FMAiDeQfbSXdYXjSpqd869QeZQiilpbr7l2KM0cc75+xUV77YpGCjAPUqitMU3uCAXrsAlPSCcgJMbG4M0mQ1Etz/i0KlXQnmwyqpv1uH4h7fiws7ISneTYNEk0ImCxcAArGJrE4AXhypPtl7AqTdeJG8k3gHb0L6QfmK9WQTa59cSFdHRssKFHHngteV/wPDepaHIu0QVAAAAABJRU5ErkJggg==";var Y3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVR42n2Tyw3AIAxD3cGYlGFTUSmV+2o4IEEAf2JQVV1rjDGq576ec5avWVdfWIW12aMPEJBEImoPv+CAvvcCODsVNWBS8wA4A5ndv1/ytciQvBLMyeTSHD3ZYXPXXH7Y0ZMdJvCxQJls5O6tKHlPPWGEfU58WZR6ive1kKSleFNC2kXGRnrcDqhTTOmPeP3pAZnTq6Oin4X0oXbfnNZu626Io6lqGCwAAAAASUVORK5CYII=";var G1=class{constructor(e){this.worldRenderer=e;d(this,"_cursorLinesHidden",!1);d(this,"cursorLineMaterial");d(this,"interactionLines",null);d(this,"prevColor");d(this,"blockBreakMesh");d(this,"breakTextures",[]);let t=[F3,z3,L3,U3,G3,V3,W3,N3,j3,Y3];for(let i=0;i<10;i++)It(t[i]).then(s=>{s.magFilter=Ke.NearestFilter,s.minFilter=Ke.NearestFilter,this.breakTextures.push(s)});let r=new Ke.MeshBasicMaterial({transparent:!0,blending:Ke.MultiplyBlending,alphaTest:.5});this.blockBreakMesh=new Ke.Mesh(new Ke.BoxGeometry(1,1,1),r),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(e){this.interactionLines&&(this.interactionLines.mesh.visible=!e),this._cursorLinesHidden=e}updateLineMaterial(){let e=this.worldRenderer.playerStateReactive.gameMode==="creative",t=this.worldRenderer.renderer.getPixelRatio();this.cursorLineMaterial&&this.cursorLineMaterial.dispose(),this.cursorLineMaterial=new mt({color:(()=>{switch(this.worldRenderer.worldRendererConfig.highlightBlockColor){case"blue":return 4227327;case"classic":return 0;default:return e?4227327:0}})(),linewidth:Math.max(t*.7,1)*2}),this.prevColor=this.worldRenderer.worldRendererConfig.highlightBlockColor}updateBreakAnimation(e,t,r){if(this.hideBreakAnimation(),t===null||!e||!r)return;let{position:i,width:s,height:o,depth:v}=r,a=new Wi(i.x,i.y,i.z);this.blockBreakMesh.scale.set(s*1.001,o*1.001,v*1.001),a.add(new Wi(e.x,e.y,e.z)),this.blockBreakMesh.position.set(a.x,a.y,a.z),this.blockBreakMesh.visible=!0,this.blockBreakMesh.material.map=this.breakTextures[t]??this.breakTextures.at(-1),this.blockBreakMesh.material.needsUpdate=!0}hideBreakAnimation(){this.blockBreakMesh&&(this.blockBreakMesh.visible=!1)}updateDisplay(){if(this.cursorLineMaterial){let{renderer:e}=this.worldRenderer;this.cursorLineMaterial.resolution.set(e.domElement.width,e.domElement.height),this.cursorLineMaterial.dashOffset=performance.now()/750}}setHighlightCursorBlock(e,t,r=!1){if(e&&this.interactionLines&&e.equals(this.interactionLines.blockPos)&&gv(t??[],this.interactionLines.shapePositions??[])&&!r||(this.interactionLines!==null&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.interactionLines.mesh),this.interactionLines=null),e===null))return;let i=new Ke.Group;for(let{position:s,width:o,height:v,depth:a}of t??[]){let l=new Wi(s.x,s.y,s.z),c=[1.0001*o,1.0001*v,1.0001*a],u=new Ke.BoxGeometry(...c),f=new ht().fromEdgesGeometry(new Ke.EdgesGeometry(u)),p=new z5(f,this.cursorLineMaterial);p.position.set(l.x,l.y,l.z),p.computeLineDistances(),i.add(p)}this.worldRenderer.sceneOrigin.addAndTrack(i),i.position.set(e.x,e.y,e.z),i.visible=!this.cursorLinesHidden,this.interactionLines={blockPos:e,mesh:i,shapePositions:t}}render(){this.prevColor!==this.worldRenderer.worldRendererConfig.highlightBlockColor&&this.updateLineMaterial(),this.updateDisplay()}},gv=(n,e)=>{if(n.length!==e.length)return!1;for(let[t,r]of n.entries())if(r!==e[t])return!1;return!0};E();x();k();R();E();x();k();R();var bv=l5(Ai(),1);import Q3 from"prismarine-nbt";import{getItemDefinition as yv}from"mc-assets/dist/itemDefinitions";var _v=(n,e)=>{let t,r,i=n.name;i.includes(":")||(i=`minecraft:${i}`);let s=e.currentResources?.customItemModelNames[i];if(n.components){let o=new Map;for(let c of n.components)o.set(c.type,c);let v=o.get("custom_name")||o.get("item_name");v&&(t=typeof v.data=="string"?v.data:Q3.simplify(v.data));let a=o.get("item_model");if(a&&(r=a.data),s){let c=o.get("custom_model_data");if(c?.data){let u;typeof c.data=="number"?u=c.data:typeof c.data=="object"&&"floats"in c.data&&Array.isArray(c.data.floats)&&c.data.floats.length>0&&(u=c.data.floats[0]),u&&s[u]&&(r=s[u])}}let l=o.get("lore");l&&(t??(t=n.displayName??n.name),t+=`
|
|
21459
|
-
${JSON.stringify(l.data)}`)}if(n.nbt){let o=Q3.simplify(n.nbt),v=o.display?.Name;v&&(t=v),s&&o.CustomModelData&&s[o.CustomModelData]&&(r=s[o.CustomModelData])}return{customText:t,customModel:r}};var K3=(n,e,t,r)=>{let i=n.name,{customModel:s}=_v(n,t);s&&(i=s);let o=gs(r,{...e}),v=t.currentResources,a=yv(ss(v),{name:i,version:v.version,properties:o})?.model;return(a==="minecraft:special"?void 0:a)??i};E();x();k();R();var ea=l5(X3(),1);import{versionToNumber as $3}from"mc-assets/dist/utils";var ta=(n,e,t=!1,r=!1)=>{let i=n.modelName,s=globalThis.loadedData.itemsByName[i];$3(e.currentResources.version)<$3("1.13")&&(i=(0,ea.getRenamedData)(s?"items":"blocks",i,e.currentResources.version,"1.13.1"));let o;if(!r){let a=e.currentResources?.guiAtlas?.json,l=u=>u&&a?.textures[u.replace("minecraft:","").replace("block/","").replace("blocks/","").replace("item/","").replace("items/","").replace("_inventory","")],c=l(i)??l(n.originalItemName);if(c){let u=c.u*a.width,f=c.v*a.height;return{texture:"gui",slice:[u,f,a.tileSize,a.tileSize],scale:.25,blockData:null,modelName:null}}}let v=a=>a.top??a;try{if(!e.currentResources?.itemsRenderer)throw new Error("Items renderer is not available");o=e.currentResources.itemsRenderer.getItemTexture(i,{},!1,r)??(n.originalItemName?e.currentResources.itemsRenderer.getItemTexture(n.originalItemName,{},!1,r):void 0)??e.currentResources.itemsRenderer.getItemTexture("item/missing_texture")}catch(a){reportError?.(`Failed to render item ${i} (original: ${n.originalItemName}) on ${e.currentResources.version} (resourcepack: TODO!): ${a.stack}`),o=v(e.currentResources.itemsRenderer.getItemTexture("errored"))}return o??(o=v(e.currentResources.itemsRenderer.getItemTexture("unknown"))),"type"in o?{texture:o.type,slice:o.slice,modelName:i,blockData:null,scale:null}:{texture:"blocks",blockData:o,modelName:i,slice:null,scale:null}};var ra=(n,e,t,r)=>{let i=t.currentResources;if(!i)throw new Error("Resources not loaded");let s=n.itemId??n.blockId??n.name,{blockState:o}=n;try{let v=o?globalThis.loadedData.blocksByStateId[o]?.name:typeof s=="number"?globalThis.loadedData.items[s]?.name:s;if(!v)throw new Error(`Item not found: ${s}`);let a=K3({...n,name:v},e,t,r),l=ta({modelName:a},t,!1,!0);if(!l)throw new Error(`Failed to get render info for item ${v}`);let c=l.texture==="blocks"?i.blocksAtlasImage:i.itemsAtlasImage;if(l.blockData)return{resolvedModel:l.blockData.resolvedModel,modelName:l.modelName};if(l.slice){let[u,f,p,g]=l.slice,[y,A,b,_]=[u/c.width,f/c.height,p/c.width,g/c.height];return{u:y,v:A,su:b,sv:_,renderInfo:l,modelName:l.modelName}}throw new Error(`Invalid render info for item ${v}`)}catch(v){return reportError?.(v),{u:0,v:0,su:16/i.blocksAtlasImage.width,sv:16/i.blocksAtlasImage.width,modelName:"missing"}}};E();x();k();R();import*as Zt from"three";var W1=class{constructor(e){this.worldRenderer=e;d(this,"audioListener");d(this,"activeSounds",new Set);d(this,"audioContext");d(this,"soundVolumes",new Map);d(this,"baseVolume",1);e.onWorldSwitched.push(()=>{this.stopAll()}),e.onReactiveConfigUpdated("volume",t=>{this.changeVolume(t)})}initAudioListener(){this.audioListener||(this.audioListener=new Zt.AudioListener,this.worldRenderer.camera.add(this.audioListener))}playSound(e,t,r=1,i=1,s=500){this.initAudioListener();let o=new Zt.PositionalAudio(this.audioListener);this.activeSounds.add(o),this.soundVolumes.set(o,r);let v=new Zt.AudioLoader,a=Date.now();v.loadAsync(t).then(l=>{Date.now()-a>s||(o.setBuffer(l),o.setRefDistance(20),o.setVolume(r*this.baseVolume),o.setPlaybackRate(i),this.worldRenderer.sceneOrigin.addAndTrack(o),o.position.set(e.x,e.y,e.z),o.onEnded=()=>{this.worldRenderer.sceneOrigin.removeAndUntrack(o),o.source&&o.disconnect(),this.activeSounds.delete(o),this.soundVolumes.delete(o),v.manager.itemEnd(t)},o.play())})}stopAll(){for(let e of this.activeSounds)e&&(e.stop(),e.source&&e.disconnect(),this.worldRenderer.sceneOrigin.removeAndUntrack(e));this.activeSounds.clear(),this.soundVolumes.clear()}changeVolume(e){this.baseVolume=e;for(let[t,r]of this.soundVolumes)t.setVolume(r*this.baseVolume)}destroy(){this.stopAll(),this.audioListener&&(this.audioListener.removeFromParent(),this.audioListener=void 0)}playTestSound(){this.playSound(this.worldRenderer.camera.position,"/sound.mp3")}};E();x();k();R();import*as Ue from"three";var N1=class{constructor(e,t){this.worldRenderer=e;this.onRenderCallbacks=t;d(this,"rollAngle",0);d(this,"rollAnimation");d(this,"basePitch",0);d(this,"baseYaw",0);d(this,"cameraBobInput",null);t.push(()=>{this.update()})}get damageRollAmount(){return 5}get damageAnimDuration(){return 200}setCameraBobInput(e){this.cameraBobInput=e}setBaseRotation(e,t){this.basePitch=e,this.baseYaw=t,this.update()}getBaseRotation(){return{pitch:this.basePitch,yaw:this.baseYaw}}shakeFromDamage(e){let t=this.rollAngle,r=t+(e??(Math.random()<.5?-1:1))*this.damageRollAmount;this.rollAnimation={startTime:performance.now(),startRoll:t,targetRoll:r,duration:this.damageAnimDuration/2}}update(){if(this.worldRenderer.playerStateUtils.isSpectatingEntity()&&(this.rollAngle=0,this.rollAnimation=void 0),this.rollAnimation){let t=performance.now(),r=t-this.rollAnimation.startTime,i=Math.min(r/this.rollAnimation.duration,1);this.rollAnimation.returnToZero?(this.rollAngle=this.rollAnimation.startRoll*(1-this.easeInOut(i)),i===1&&(this.rollAnimation=void 0)):(this.rollAngle=this.rollAnimation.startRoll+(this.rollAnimation.targetRoll-this.rollAnimation.startRoll)*this.easeOut(i),i===1&&(this.rollAnimation={startTime:t,startRoll:this.rollAngle,targetRoll:0,duration:this.damageAnimDuration/2,returnToZero:!0}))}let e=this.worldRenderer.cameraObject;if(this.worldRenderer.cameraGroupVr){let t=new Ue.Quaternion().setFromAxisAngle(new Ue.Vector3(0,1,0),this.baseYaw);e.setRotationFromQuaternion(t)}else{let t=this.addAntiZfightingOffset(this.basePitch),r=this.addAntiZfightingOffset(this.baseYaw),i=new Ue.Quaternion().setFromAxisAngle(new Ue.Vector3(1,0,0),t),s=new Ue.Quaternion().setFromAxisAngle(new Ue.Vector3(0,1,0),r),o=new Ue.Quaternion().setFromAxisAngle(new Ue.Vector3(0,0,1),Ue.MathUtils.degToRad(this.rollAngle)),v=new Ue.Quaternion,a=new Ue.Quaternion,l=this.worldRenderer.playerStateReactive.perspective;if(this.cameraBobInput){let u=E1(this.cameraBobInput);v=new Ue.Quaternion().setFromAxisAngle(new Ue.Vector3(0,0,1),u.rotation.z),a=new Ue.Quaternion().setFromAxisAngle(new Ue.Vector3(1,0,0),u.rotation.x),l==="first_person"&&this.worldRenderer.camera.position.set(u.position.x,u.position.y,0)}else l==="first_person"&&this.worldRenderer.camera.position.set(0,0,0);let c=s.multiply(i).multiply(o).multiply(v).multiply(a);e.setRotationFromQuaternion(c)}}easeOut(e){return 1-(1-e)*(1-e)}easeInOut(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}addAntiZfightingOffset(e){let r=(e%(Math.PI*2)+Math.PI*2)%(Math.PI*2),i=.01;return Math.abs(r)<i||Math.abs(r-Math.PI/2)<i||Math.abs(r-Math.PI)<i||Math.abs(r-3*Math.PI/2)<i?e+.001:e}};E();x();k();R();import*as K from"three";var j1=class{constructor(e){this.worldRenderer=e;d(this,"customMedia",new Map);d(this,"lastCheck",0);d(this,"THROTTLE_TIME",100);this.worldRenderer.onWorldSwitched.push(()=>{this.onWorldGone()}),this.worldRenderer.onRender.push(()=>{this.render()}),this.worldRenderer.onReactiveConfigUpdated("volume",()=>{let{volume:t}=this.worldRenderer.worldRendererConfig;for(let[r,i]of this.customMedia.entries())i.positionalAudio&&i.positionalAudio.setVolume((i.props.volume??1)*t)})}onWorldGone(){for(let[e,t]of this.customMedia.entries())this.destroyMedia(e)}onWorldStop(){for(let[e,t]of this.customMedia.entries())this.setVideoPlaying(e,!1)}createErrorTexture(e,t,r=16777215,i="Failed to load"){let s=new OffscreenCanvas(100,100),o=100;s.width=o,s.height=o;let v=s.getContext("2d");if(!v)return new K.CanvasTexture(s);v.clearRect(0,0,s.width,s.height),v.fillStyle=`rgba(${r>>16&255}, ${r>>8&255}, ${r&255}, 1)`,v.fillRect(0,0,s.width,s.height),v.fillStyle="#ff0000",v.font="bold 10px sans-serif",v.textAlign="center",v.textBaseline="middle",v.fillText(i,s.width/2,s.height/2,s.width);let a=new K.CanvasTexture(s);return a.minFilter=K.LinearFilter,a.magFilter=K.LinearFilter,a}createBackgroundTexture(e,t,r=0,i=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 v=r>>16&255,a=r>>8&255,l=r&255;o.fillStyle=`rgba(${v}, ${a}, ${l}, ${i})`,o.fillRect(0,0,1,1);let c=new K.CanvasTexture(s);return c.minFilter=K.NearestFilter,c.magFilter=K.NearestFilter,c}validateOrigin(e,t){if(t===!0)return!0;if(t===!1)return!1;let r=new URL(e);return t.some(i=>r.origin.endsWith(i))}onPageInteraction(){for(let[e,t]of this.customMedia.entries())t.hadAutoPlayError&&(t.hadAutoPlayError=!1,this.playVideo(e))}addMedia(e,t){let r=structuredClone(t);this.destroyMedia(e);let i=!1;t.src.startsWith("https://disk.yandex.ru/i/")&&(i=!0,t.src=`/ya-image?url=${t.src}`);let{scene:s}=this.worldRenderer;t.allowOrigins!==void 0&&!this.validateOrigin(t.src,t.allowOrigins)&&(t.src="");let v=t.src.endsWith(".png")||t.src.endsWith(".jpg")||t.src.endsWith(".jpeg")||t.imageOverride;i&&!t.imageOverride&&fetch(t.src,{method:"HEAD"}).then(M=>{M.headers.get("content-type")?.startsWith("image/")&&(this.destroyMedia(e),this.addMedia(e,{...r,src:t.src,imageOverride:!0}))}).catch(console.error);let a,l,c=le&&!v;if(!v&&!c){a=document.createElement("video"),a.src=t.src.endsWith(".gif")?t.src.replace(".gif",".mp4"):t.src,a.loop=t.loop??!0;let M=(t.volume??1)*this.worldRenderer.worldRendererConfig.volume;a.volume=Math.min(M,1),a.playsInline=!0,a.crossOrigin="anonymous";let P=this.worldRenderer.soundSystem;if(P.initAudioListener(),!P.audioListener)throw new Error("Audio listener not initialized");l=new K.PositionalAudio(P.audioListener),l.setRefDistance(6),l.setVolume(M),this.worldRenderer.sceneOrigin.addAndTrack(l),l.position.set(t.position.x,t.position.y,t.position.z),l.setMediaElementSource(a),l.connect(),a.addEventListener("pause",()=>{l?.pause(),globalThis.tempSendVideoStop?.(e,"paused",a.currentTime)}),a.addEventListener("play",()=>{l?.play(),globalThis.tempSendVideoPlay?.(e)}),a.addEventListener("seeked",()=>{l&&a&&(l.offset=a.currentTime)}),a.addEventListener("stalled",()=>{globalThis.tempSendVideoStop?.(e,"stalled",a.currentTime)}),a.addEventListener("waiting",()=>{globalThis.tempSendVideoStop?.(e,"waiting",a.currentTime)}),a.addEventListener("error",({error:B})=>{globalThis.tempSendVideoStop?.(e,`error: ${B}`,a.currentTime)}),a.addEventListener("ended",()=>{globalThis.tempSendVideoStop?.(e,"ended",a.currentTime),t.loop||(a.currentTime=0,C.ended=!0)})}let u=this.createBackgroundTexture(t.size.width,t.size.height,t.background),f=M=>{let P=this.createErrorTexture(t.size.width,t.size.height,t.background,M);y.map=P,y.needsUpdate=!0},p=new K.PlaneGeometry(1,1),g=t.allowLighting?K.MeshLambertMaterial:K.MeshBasicMaterial,y=new g({map:u,transparent:!0,side:t.doubleSide?K.DoubleSide:K.FrontSide,alphaTest:.1}),A;if(a)A=new K.VideoTexture(a);else if(c)A=this.createErrorTexture(t.size.width,t.size.height,t.background,"Video unavailable (multi-thread)");else if(le){let M=w5(t.src);A=M.texture,A.minFilter=K.NearestFilter,A.magFilter=K.NearestFilter,M.promise.then(()=>{this.customMedia.get(e)?.texture===A&&(y.map=A,y.needsUpdate=!0)}).catch(()=>f())}else A=new K.TextureLoader().load(t.src,()=>{this.customMedia.get(e)?.texture===A&&(y.map=A,y.needsUpdate=!0)},void 0,()=>f());A.minFilter=K.NearestFilter,A.magFilter=K.NearestFilter,A.generateMipmaps=!1;let b=new K.Mesh(p,y),{mesh:_}=this.positionMeshExact(b,K.MathUtils.degToRad((t.rotation??0)*90),t.position,t.size.width,t.size.height);s.add(_),a&&(b.onBeforeRender=()=>{a.readyState===a.HAVE_ENOUGH_DATA&&(!a.paused||!C?.hadAutoPlayError)&&(y.map!==A&&(y.map=A,y.needsUpdate=!0),A.needsUpdate=!0,l&&(l.position.copy(_.position),l.rotation.copy(_.rotation)))});let S=M=>{let P=p.attributes.uv.array;P[0]=M.startU,P[1]=M.startV,P[2]=M.endU,P[3]=M.startV,P[4]=M.endU,P[5]=M.endV,P[6]=M.startU,P[7]=M.endV,p.attributes.uv.needsUpdate=!0};t.uvMapping&&S(t.uvMapping);let C={mesh:_,video:a,texture:A,updateUVMapping:S,positionalAudio:l,props:r,hadAutoPlayError:!1,pausedBecuaseHidden:!1,ended:!1,handleError(M){if(C.destroyed)return;let P=B=>B;f(M.name==="NotAllowedError"||M.name==="AbortError"?P("Waiting for user interaction"):P("Failed to auto play"))}};return this.customMedia.set(e,C),a&&t.autoPlay&&this.playVideo(e,!0),e}playVideo(e,t=!1){let r=this.customMedia.get(e);if(r?.video){if(!t&&r.positionalAudio&&r.video.currentTime<1){let i=r.video.currentTime;this.addMedia(e,r.props),r.video.currentTime=i,r.props.autoPlay||this.playVideo(e,!0);return}r.video.play().then(()=>{r.hadAutoPlayError=!1}).catch(i=>{r.pausedBecuaseHidden||((i.name==="NotAllowedError"||i.name==="AbortError"||i.message?.includes("not allowed")&&!r.pausedBecuaseHidden)&&(r.hadAutoPlayError=!0),r.handleError(i))})}}render(){for(let[e,t]of this.customMedia.entries()){let r=t.mesh.visible;t.mesh.visible=this.worldRenderer.shouldObjectVisible(t.mesh)&&!t.mesh.forceHide,r!==t.mesh.visible&&t.video&&(t.mesh.visible?t.pausedBecuaseHidden&&(this.playVideo(e),t.pausedBecuaseHidden=!1):t.video.paused||(t.video.pause(),t.pausedBecuaseHidden=!0))}}setVideoPlaying(e,t){let r=this.customMedia.get(e);r?.video&&(t?this.playVideo(e):r.video.pause())}setVideoSeeking(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.currentTime=t)}setVideoVolume(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.volume=t)}setVideoSpeed(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.playbackRate=t)}setControlMode(e,t,r){let i=this.customMedia.get(e);i?.video&&(i.props.controlMode={mouseButton:t,controlMode:r})}destroyMedia(e){let{scene:t}=this.worldRenderer,r=this.customMedia.get(e);if(r){r.destroyed=!0,r.video&&(r.video.pause(),r.video.src="",r.video.remove()),r.positionalAudio&&this.worldRenderer.sceneOrigin.removeAndUntrack(r.positionalAudio),this.worldRenderer.sceneOrigin.removeAndUntrack(r.mesh),r.texture.dispose();let i=r.mesh.children[0];i&&(i.geometry.dispose(),i.material instanceof K.Material&&i.material.dispose()),this.customMedia.delete(e)}}positionMeshExact(e,t,r,i,s,o=1){t===0&&(r.z+=.001),t===Math.PI/2&&(r.x-=.001),t===Math.PI&&(r.z-=.001),t===3*Math.PI/2&&(r.x+=.001),t===0&&(r.z+=1),t===Math.PI&&(r.x+=1),t===3*Math.PI/2&&(r.z+=1,r.x+=1),e.matrix.identity(),e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1),e.rotateY(t),(t===Math.PI/2||t===3*Math.PI/2)&&(e.rotateZ(-Math.PI),e.rotateX(-Math.PI)),e.scale.set(i,s,o),e.geometry.translate(.5,.5,0),e.geometry.attributes.position.needsUpdate=!0,this.worldRenderer.sceneOrigin.track(e),e.position.set(r.x,r.y,r.z);let v=new K.Group;v.add(e);let a=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711680}));a.position.set(r.x,r.y,r.z),v.add(a);let l=r.x+Math.cos(t)*i,c=r.z+Math.sin(t)*i,u=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:255}));u.position.set(r.x,r.y+s,r.z),v.add(u);let f=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16776960}));f.position.set(l,r.y,c),v.add(f);let p=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711935}));p.position.set(l,r.y+s,c),v.add(p);let g=new K.Vector3(this.worldRenderer.sceneOrigin.toSceneX(r.x),this.worldRenderer.sceneOrigin.toSceneY(r.y),this.worldRenderer.sceneOrigin.toSceneZ(r.z)),y=new K.ArrowHelper(new K.Vector3(Math.cos(t),0,Math.sin(t)),g,1,16711680);return v.add(y),{mesh:e,debugGroup:v}}createTestCanvasTexture(){let e=new OffscreenCanvas(100,100);e.width=100,e.height=100;let t=e.getContext("2d");return t?(t.font="10px Arial",t.fillStyle="red",t.fillText("Hello World",0,10),new K.CanvasTexture(e)):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:e,scene:t}=this.worldRenderer,r=new K.Raycaster,i=new K.Vector2(0,0);r.setFromCamera(i,e);let s=r.intersectObjects(t.children,!0);if(s.length>0){let o=s[0],v=o.object;for(let[a,l]of this.customMedia.entries())if(v===l.mesh||l.mesh.children.includes(v)){let{uv:c}=o;if(c){let u={id:a,x:c.x,y:c.y};this.worldRenderer.reactiveState.world.intersectMedia=u,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(e){let t=this.worldRenderer.reactiveState.world.intersectMedia;if(t){let{id:r,x:i,y:s}=t,o=this.customMedia.get(r),v=o?.props.controlMode;if(o?.video&&(v?.mouseButton==="both"||v?.mouseButton===e))switch(v?.controlMode){case"play_pause":{this.setVideoPlaying(r,o.video.paused);break}case"play_if_ended":{o.ended&&this.setVideoPlaying(r,!0);break}case"toggle_mute":{o.video.muted=!o.video.muted;break}}}}};E();x();k();R();import*as U0 from"three";E();x();k();R();import*as Te from"three";var Rv=1,ia=10,g0={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 sa(n){let e=n.color??16711680,t=n.depthTest??!1,r=n.visualScale??n.metadata?.visualScale??(typeof window>"u"?void 0:window.serverMetadata?.waypointVisualScale)??g0.DEFAULT_VISUAL_SCALE,i=n.opacity??n.metadata?.opacity??(typeof window>"u"?void 0:window.serverMetadata?.waypointOpacity)??g0.DEFAULT_OPACITY,s=je(na(),na());Y1(s,e,n.label??"","0m",r);let o=new Te.CanvasTexture(s);o.anisotropy=1,o.magFilter=Te.LinearFilter,o.minFilter=Te.LinearFilter;let v=new Te.SpriteMaterial({map:o,transparent:!0,opacity:1,depthTest:t,depthWrite:!1}),a=new Te.Sprite(v);a.position.set(0,0,0),a.renderOrder=10,a.material.opacity=i;let l=n.label??"",c="0m",u=Number.NaN,f,p,g,y,A=null,b=g0.ARROW.enabledDefault,_=new Te.Group;_.add(a);let{x:S,y:C,z:M}=n.position;_.position.set(S,C,M);function P(){o.needsUpdate=!0}function B(){if(!p||!g)return;let Y=p.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 oe=`#${e.toString(16).padStart(6,"0")}`;g.lineWidth=6,g.strokeStyle="black",g.stroke(),g.fillStyle=oe,g.fill(),y&&(y.needsUpdate=!0)}function H(Y){e=Y,c="0m",u=0,Y1(s,e,l,"0m",r),P(),f&&B()}function G(Y){l=Y??"",Y1(s,e,l,c,r),P()}function O(Y,oe){oe!==c&&(c=oe,Y1(s,e,Y,oe,r),P())}function j(Y){a.visible=Y}function J(Y,oe,be){_.position.set(Y,oe,be)}function Z(Y,oe,be,Ge){let Oe=oe*Math.PI/180,he=Math.tan(Oe/2)*2*be*(g0.TARGET_SCREEN_PX*r/Ge);a.scale.set(he,he,1)}function X(){if(f)return;let Y=128;p=je(Y,Y),g=p.getContext("2d"),B(),y=new Te.CanvasTexture(p),y.anisotropy=1,y.magFilter=Te.LinearFilter,y.minFilter=Te.LinearFilter;let oe=new Te.SpriteMaterial({map:y,transparent:!0,depthTest:!1,depthWrite:!1,opacity:i});f=new Te.Sprite(oe),f.renderOrder=12,f.visible=!1,A&&A.add(f)}function de(Y){b=Y,!Y&&f&&(f.visible=!1)}function ae(Y){f?.parent&&f.parent.remove(f),A=Y,f&&Y&&Y.add(f)}function ve(Y,oe,be){if(!b||(X(),!f))return!0;let Ge=n.metadata?.onlyLeftRight===!0,Oe=new Te.Vector3;Y.getWorldDirection(Oe);let Xe=Y.up.clone().normalize(),he=new Te.Vector3().copy(Oe).cross(Xe).normalize(),h0=new Te.Vector3().copy(he).cross(Oe).normalize(),s5=new Te.Vector3().setFromMatrixPosition(Y.matrixWorld),o5=new Te.Vector3(_.position.x,_.position.y,_.position.z).sub(s5),N0=o5.dot(Oe),C0=o5.dot(he),j0=o5.dot(h0),Z5=oe/be,Y0=Y.fov*Math.PI/180,xt=2*Math.atan(Math.tan(Y0/2)*Z5),q5=Math.atan2(C0,N0),X5=Math.atan2(j0,N0);if(N0>0&&Math.abs(q5)<=xt/2&&Math.abs(X5)<=Y0/2)return f.visible=!1,!0;let Ze=q5/(xt/2),Se=X5/(Y0/2);N0<=0&&(Math.abs(Ze)>Math.abs(Se)?(Ze=Math.sign(Ze),Se=0):(Ze=0,Se=Math.sign(Se))),Ge&&(Math.abs(Ze)>Math.abs(Se)||(Ze=Ze>=0?1:-1),Se=0);let Rt=Math.max(Math.abs(Ze),Math.abs(Se))||1,a5=Ze/Rt,o0=Se/Rt,kt=g0.ARROW.paddingPx,w=(a5+1)*.5*oe,h=(1-o0)*.5*be,m=Math.min(Math.max(w,kt),oe-kt),T=Math.min(Math.max(h,kt),be-kt);a5=m/oe*2-1,o0=-(T/be)*2+1;let I=Math.max(2,Y.near*4),F=Math.tan(Y0/2)*I,V=F*Z5,ie=s5.clone().add(Oe.clone().multiplyScalar(I)).add(he.clone().multiplyScalar(a5*V)).add(h0.clone().multiplyScalar(o0*F));f.visible=!0,f.position.copy(ie);let ye=Math.atan2(Se,Ze);f.material.rotation=ye-Math.PI/2;let pe=Math.tan(Y0/2)*2*I*(g0.ARROW.pixelSize*r/be);return f.scale.set(pe,pe,1),!1}function ge(Y){return Y.distanceTo(_.position)}function Ee(Y,oe,be,Ge){let Oe=ge(Y);Z(Y,oe.fov,Oe,Ge);let Xe=Math.round(Oe/ia)*ia;Xe!==u&&(u=Xe,O(l,`${Math.max(0,Xe)}m`));let he=ve(oe,be,Ge);return j(he),he}function ne(){let Y=a.material;if(Y.map?.dispose(),Y.dispose(),f){f.parent&&f.parent.remove(f);let oe=f.material;oe.map?.dispose(),oe.dispose()}f=void 0,p=void 0,g=void 0,y=void 0}return{group:_,sprite:a,enableOffscreenArrow:de,setArrowParent:ae,updateForCamera:Ee,setColor:H,setLabel:G,updateDistanceText:O,setVisible:j,setPosition:J,dispose:ne}}function oa(){let n=globalThis.devicePixelRatio||1,e=Math.min(n,Rv);return g0.CANVAS_SCALE*e}function na(){return Math.round(g0.CANVAS_SIZE*oa())}function Y1(n,e,t,r,i){let s=n.width,o=oa(),v=n.getContext("2d");v.clearRect(0,0,s,s);let a=s/2,l=Math.round(s*g0.LAYOUT.DOT_Y),c=Math.round(s*.05*i),u=Math.max(2,Math.round(4*o*i)),f=c+u;v.beginPath(),v.arc(a,l,f,0,Math.PI*2),v.fillStyle=`#${e.toString(16).padStart(6,"0")}`,v.fill(),v.textAlign="center",v.textBaseline="middle";let p=Math.round(s*.08*i),g=Math.round(s*.06*i);v.font=`800 ${p}px mojangles`,v.lineWidth=Math.max(2,Math.round(3*o*i));let y=Math.round(s*g0.LAYOUT.NAME_Y);v.strokeStyle="black",v.strokeText(t,a,y),v.fillStyle="white",v.fillText(t,a,y),v.font=`800 ${g}px mojangles`,v.lineWidth=Math.max(2,Math.round(2*o*i));let A=Math.round(s*g0.LAYOUT.DISTANCE_Y);v.strokeStyle="black",v.strokeText(r,a,A),v.fillStyle="#CCCCCC",v.fillText(r,a,A)}var Q1=class{constructor(e){this.worldRenderer=e;d(this,"waypoints",new Map);d(this,"waypointScene",new U0.Scene);d(this,"lastCameraPosition",new U0.Vector3);d(this,"lastUpdateTime",0);d(this,"UPDATE_THROTTLE_MS",16)}updateWaypoints(){let e=performance.now(),t=this.worldRenderer.getCameraPosition(),r=this.lastCameraPosition.distanceTo(t)>.5,i=e-this.lastUpdateTime>this.UPDATE_THROTTLE_MS;if(!r&&!i)return;this.lastCameraPosition.copy(t),this.lastUpdateTime=e;let s=this.worldRenderer.renderer.getSize(new U0.Vector2);for(let o of this.waypoints.values()){let v=new U0.Vector3(o.x,o.y,o.z),a=t.distanceTo(v),l=(!o.minDistance||a>=o.minDistance)&&(o.maxDistance===1/0||a<=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(e,t,r,i,s={}){this.removeWaypoint(e);let o=s.color??16711680,{label:v,metadata:a}=s,l=s.minDistance??0,c=s.maxDistance??1/0,u=sa({position:new U0.Vector3(t,r,i),color:o,label:v||e,metadata:a});u.enableOffscreenArrow(!0),u.setArrowParent(this.waypointScene),this.waypointScene.add(u.group),this.waypoints.set(e,{id:e,x:t+.5,y:r+.5,z:i+.5,minDistance:l,maxDistance:c,color:o,label:v,sprite:u})}removeWaypoint(e){let t=this.waypoints.get(e);t&&(this.waypointScene.remove(t.sprite.group),t.sprite.dispose(),this.waypoints.delete(e))}clear(){for(let e of this.waypoints.keys())this.removeWaypoint(e)}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(e){return this.waypoints.get(e)}getAllWaypoints(){return[...this.waypoints.values()]}setWaypointColor(e,t){let r=this.waypoints.get(e);r&&(r.sprite.setColor(t),r.color=t)}setWaypointLabel(e,t){let r=this.waypoints.get(e);r&&(r.label=t,r.sprite.setLabel(t))}};E();x();k();R();import*as Re from"three";import{Vec3 as W5}from"vec3";var xe=class xe{constructor(e){this.worldRenderer=e;d(this,"explosions",new Map);d(this,"particleGeometry");d(this,"particleMaterials",[]);d(this,"testModeTimer");d(this,"explosionCounter",0);this.particleGeometry=new Re.BoxGeometry(xe.DEFAULT_PARTICLE_SIZE,xe.DEFAULT_PARTICLE_SIZE,xe.DEFAULT_PARTICLE_SIZE),this.createParticleMaterials()}createParticleMaterials(){let e=[16711680,65280,255,16776960,16711935,65535,16753920,8388736,16761035,16777215];for(let t of e){let r=new Re.MeshBasicMaterial({color:t,transparent:!0,opacity:1});this.particleMaterials.push(r)}}getRandomMaterial(){return this.particleMaterials[Math.floor(Math.random()*this.particleMaterials.length)]}createExplosion(e,t=1,r,i=xe.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],v=Math.floor(xe.DEFAULT_PARTICLE_COUNT*t),a;if(xe.DEBUG_SHOW_EXPLOSION_CENTER){let c=.5*t,u=new Re.SphereGeometry(c,8,8),f=new Re.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});a=new Re.Mesh(u,f),a.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(a),a.position.set(e.x,e.y,e.z)}for(let c=0;c<v;c++){let u=Math.random()*Math.PI*2,f=Math.sqrt(Math.random())*xe.VELOCITY_FACTOR*t,p=new W5(f*Math.cos(u),Math.random()*.5-.25,f*Math.sin(u));c<5;let g=r===void 0?this.getRandomMaterial().clone():new Re.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),y=new Re.Mesh(this.particleGeometry,g);y.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(y),y.position.set(e.x,e.y,e.z),c<5;let A={position:e.clone(),velocity:p,color:new Re.Color(g.color),life:1,maxLife:1,mesh:y};o.push(A)}let l={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:a};return this.explosions.set(s,l),l}createExplosionFacingCamera(e,t=1,r,i=xe.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],v=Math.floor(xe.DEFAULT_PARTICLE_COUNT*t),a;if(xe.DEBUG_SHOW_EXPLOSION_CENTER){let f=.5*t,p=new Re.SphereGeometry(f,8,8),g=new Re.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});a=new Re.Mesh(p,g),a.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(a),a.position.set(e.x,e.y,e.z)}let l=this.worldRenderer.getCameraPosition(),c=new W5(l.x-e.x,l.y-e.y,l.z-e.z).normalize();for(let f=0;f<v;f++){let p=Math.random()*Math.PI*2,g=Math.sqrt(Math.random())*xe.VELOCITY_FACTOR*t,y=new W5(g*Math.cos(p),g*Math.sin(p),0),A=new W5(y.x*c.x-y.z*c.z,y.y,y.x*c.z+y.z*c.x);f<5;let b=r===void 0?this.getRandomMaterial().clone():new Re.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),_=new Re.Mesh(this.particleGeometry,b);_.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(_),_.position.set(e.x,e.y,e.z);let S={position:e.clone(),velocity:A,color:new Re.Color(b.color),life:1,maxLife:1,mesh:_};o.push(S)}let u={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:a};return this.explosions.set(s,u),u}explode(e,t=1,r,i){return this.createExplosion(e,t,r,i).id}explodeFacingCamera(e,t=1,r,i){return this.createExplosionFacingCamera(e,t,r,i).id}startTestMode(){let e=this.worldRenderer.getCameraPosition(),t=new W5(e.x,e.y+10,e.z);this.testModeTimer=setInterval(()=>{let r=.8+Math.random()*.4,i=[16711680,65280,255,16776960,16711935,65535,16753920],s=i[Math.floor(Math.random()*i.length)];this.explodeFacingCamera(t,r,s)},xe.TEST_INTERVAL)}updateParticle(e,t,r){let i=e.mesh.position.x===e.position.x&&e.mesh.position.y===e.position.y&&e.mesh.position.z===e.position.z;i&&e.life>.95,e.velocity.y+=xe.GRAVITY;let s=e.position.clone(),o=t/1e3;e.position.add(e.velocity.scaled(o)),e.mesh.position.set(e.position.x,e.position.y,e.position.z);let v=e.life;e.life-=t/r;let a=Math.max(0,e.life);if(e.mesh.material instanceof Re.MeshBasicMaterial&&(e.mesh.material.opacity=a),i&&v>.95){let l=e.position.distanceTo(s)}return e.life>0}render(){let e=Date.now(),t=16.67;this.explosions.size>0&&Math.random()<.01;for(let[r,i]of this.explosions.entries()){let s=e-i.startTime;if(s>=i.duration){this.removeExplosion(r);continue}s%2e3<16,i.particles=i.particles.filter(o=>this.updateParticle(o,t,i.duration)),i.particles.length===0&&this.removeExplosion(r)}}removeExplosion(e){let t=this.explosions.get(e);if(t){for(let r of t.particles)this.worldRenderer.sceneOrigin.removeAndUntrack(r.mesh),r.mesh.material instanceof Re.Material&&r.mesh.material.dispose();t.debugSphere&&(this.worldRenderer.sceneOrigin.removeAndUntrack(t.debugSphere),t.debugSphere.geometry.dispose(),t.debugSphere.material instanceof Re.Material&&t.debugSphere.material.dispose()),this.explosions.delete(e)}}stopTestMode(){this.testModeTimer&&(clearInterval(this.testModeTimer),this.testModeTimer=void 0)}destroy(){this.stopTestMode();for(let e of this.explosions.keys())this.removeExplosion(e);for(let e of this.particleMaterials)e.dispose();this.particleGeometry.dispose()}};d(xe,"DEFAULT_PARTICLE_COUNT",50),d(xe,"DEFAULT_PARTICLE_SIZE",.05),d(xe,"DEFAULT_EXPLOSION_DURATION",6e3),d(xe,"GRAVITY",-.005),d(xe,"VELOCITY_FACTOR",1.5),d(xe,"TEST_INTERVAL",1e3),d(xe,"DEBUG_SHOW_EXPLOSION_CENTER",!0),d(xe,"DEBUG_SHOW_PARTICLE_TRAILS",!1);var K1=xe;E();x();k();R();import*as pt from"three";import{Vec3 as Ni}from"vec3";var J1=class n{constructor(e,t,r,i){this.worldRenderer=e;this.updateCamera=t;this.updateFov=r;this.getInitialState=i;d(this,"isRunning",!1);d(this,"currentScript",null);d(this,"currentPointIndex",0);d(this,"currentTweens",[]);d(this,"startTime",0);d(this,"totalDuration",0);d(this,"currentPosition",{x:0,y:0,z:0});d(this,"currentRotation",{yaw:0,pitch:0});d(this,"currentFov",75)}startScript(e){if(this.isRunning||!e.points||e.points.length===0)return!1;this.currentScript=e,this.isRunning=!0,this.currentPointIndex=0,this.startTime=performance.now(),this.totalDuration=e.points.reduce((r,i)=>r+i.duration,0);let t=this.getInitialState();return this.currentPosition={x:t.position.x,y:t.position.y,z:t.position.z},this.currentRotation={yaw:t.yaw,pitch:t.pitch},this.currentFov=t.fov,this.moveToPoint(0),!0}stopScript(){if(this.isRunning){for(let e of this.currentTweens)e.stop();this.currentTweens=[],this.isRunning=!1,this.currentScript=null,this.currentPointIndex=0}}runExampleScripts(e){let t=this.worldRenderer.getCameraPosition(),r=new Ni(t.x,t.y,t.z),i=n.createCircularFlyby(r,30,20,15e3),s=n.createSpiralDescent(r.offset(0,50,0),r,3,12e3),o=n.createBuildingTour([{pos:r.offset(-20,10,-20),lookAt:r,duration:3e3},{pos:r.offset(20,15,-20),lookAt:r,duration:3e3},{pos:r.offset(20,20,20),lookAt:r,duration:3e3},{pos:r.offset(-20,25,20),lookAt:r,duration:3e3}]),v=[i,s,o];return this.startScript(v[e]),{circular:i,spiral:s,buildingTour:o}}moveToPoint(e){if(!this.currentScript||e>=this.currentScript.points.length){this.handleScriptComplete();return}let t=this.currentScript.points[e],{duration:r}=t,i={x:t.x,y:t.y,z:t.z},s={yaw:t.yaw,pitch:t.pitch},o=t.fov??this.currentFov;if(t.lookAt){let u=new pt.Vector3(t.lookAt.x,t.lookAt.y,t.lookAt.z),f=new pt.Vector3(t.x,t.y,t.z),p=u.sub(f).normalize();s.yaw=Math.atan2(-p.x,-p.z),s.pitch=Math.asin(p.y)}let v=this.getEasingFunction(t.easing||"easeInOut"),a=new De(this.currentPosition).to(i,r).easing(v).onUpdate(()=>{this.updateCamera(new Ni(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),l=new De(this.currentRotation).to(this.wrapRotation(s),r).easing(v).onUpdate(()=>{this.updateCamera(new Ni(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 u={fov:this.currentFov};c=new De(u).to({fov:o},r).easing(v).onUpdate(()=>{this.currentFov=u.fov,this.updateFov(this.currentFov)})}this.currentTweens=[a,l],c&&this.currentTweens.push(c),a.start(),l.start(),c?.start(),a.onComplete(()=>{this.currentPointIndex++,this.currentScript?.onPointReached?.(e,t),this.isRunning&&this.moveToPoint(this.currentPointIndex)})}wrapRotation(e){let t=e.yaw,r=t-this.currentRotation.yaw;r>Math.PI?t-=2*Math.PI:r<-Math.PI&&(t+=2*Math.PI);let i=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,e.pitch));return{yaw:t,pitch:i}}getEasingFunction(e){switch(e){case"linear":return He.Linear.None;case"easeIn":return He.Quadratic.In;case"easeOut":return He.Quadratic.Out;case"easeInOut":return He.Quadratic.InOut;case"smoothstep":return He.Cubic.InOut;case"bounce":return He.Bounce.Out;default:return He.Quadratic.InOut}}handleScriptComplete(){if(!this.currentScript)return;let e=this.currentScript;e.loop?(this.currentPointIndex=0,this.moveToPoint(0)):(e.onComplete?.(),this.stopScript())}get running(){return this.isRunning}get progress(){if(!this.isRunning||this.totalDuration===0)return 0;let e=performance.now()-this.startTime;return Math.min(e/this.totalDuration,1)}get currentScriptName(){return this.currentScript?.name}static createCircularFlyby(e,t,r,i){let s=[];for(let v=0;v<=8;v++){let a=v/8*Math.PI*2,l=e.x+Math.cos(a)*t,c=e.z+Math.sin(a)*t,u=e.y+r;s.push({x:l,y:u,z:c,yaw:a+Math.PI/2,pitch:-.2,duration:i/8,easing:"smoothstep",lookAt:{x:e.x,y:e.y,z:e.z}})}return{name:"Circular Flyby",points:s,loop:!1}}static createSpiralDescent(e,t,r,i){let s=[],o=r*8,v=20;for(let a=0;a<=o;a++){let l=a/o,c=l*r*Math.PI*2,u=pt.MathUtils.lerp(e.x,t.x,l)+Math.cos(c)*v*(1-l),f=pt.MathUtils.lerp(e.z,t.z,l)+Math.sin(c)*v*(1-l),p=pt.MathUtils.lerp(e.y,t.y,l);s.push({x:u,y:p,z:f,yaw:c+Math.PI/2,pitch:-.3*l,duration:i/o,easing:"easeInOut"})}return{name:"Spiral Descent",points:s,loop:!1}}static createBuildingTour(e){return{name:"Building Tour",points:e.map((r,i)=>({x:r.pos.x,y:r.pos.y,z:r.pos.z,yaw:0,pitch:0,duration:r.duration||3e3,easing:"smoothstep",lookAt:r.lookAt?{x:r.lookAt.x,y:r.lookAt.y,z:r.lookAt.z}:void 0})),loop:!1}}};E();x();k();R();import*as ee from"three";var ji=.75,Z1=class{constructor(e,t,r){this.scene=e;this.defaultSkybox=t;this.initialImage=r;d(this,"texture",null);d(this,"mesh",null);d(this,"skyMesh",null);d(this,"voidMesh",null);d(this,"worldTime",0);d(this,"partialTicks",0);d(this,"viewDistance",4);d(this,"temperature",ji);d(this,"inWater",!1);d(this,"waterBreathing",!1);d(this,"fogBrightness",0);d(this,"prevFogBrightness",0);d(this,"fogOrangeness",0);d(this,"distanceFactor",2.7);d(this,"brightnessAtPosition",1);d(this,"debugGui");this.debugGui=new T0("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}}),r||this.createGradientSky()}async init(){this.initialImage&&await this.setSkyboxImage(this.initialImage)}async setSkyboxImage(e){this.texture&&this.texture.dispose();let t=new ee.TextureLoader;if(this.texture=await new Promise(r=>{t.load(e,i=>{i.mapping=ee.EquirectangularReflectionMapping,i.encoding=ee.sRGBEncoding,i.minFilter=ee.NearestFilter,i.magFilter=ee.NearestFilter,i.needsUpdate=!0,r(i)})}),this.mesh)this.mesh.material.map=this.texture,this.mesh.material.needsUpdate=!0;else{let r=new ee.SphereGeometry(500,60,40);r.scale(-1,1,1);let i=new ee.MeshBasicMaterial({map:this.texture,side:ee.FrontSide});this.mesh=new ee.Mesh(r,i),this.scene.add(this.mesh)}}update(e,t){t!==this.viewDistance&&(this.viewDistance=t,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(e,t=0){this.debugGui.visible||(this.worldTime=e,this.partialTicks=t,this.updateSkyColors())}updateViewDistance(e){this.viewDistance=e,this.updateSkyColors()}updateTemperature(e){this.debugGui.visible||(this.temperature=e,this.updateSkyColors())}updateWaterState(e,t){this.debugGui.visible||(this.inWater=e,this.waterBreathing=t,this.updateSkyColors())}updateDefaultSkybox(e){this.debugGui.visible||(this.defaultSkybox=e,this.updateSkyColors())}createGradientSky(){{let r=new ee.PlaneGeometry(768,768);r.rotateX(-Math.PI/2),r.translate(0,16,0);let i=new ee.MeshBasicMaterial({color:16777215,side:ee.DoubleSide,depthTest:!1});this.skyMesh=new ee.Mesh(r,i),this.scene.add(this.skyMesh)}{let r=new ee.PlaneGeometry(768,768);r.rotateX(-Math.PI/2),r.translate(0,-16,0);let i=new ee.MeshBasicMaterial({color:16777215,side:ee.DoubleSide,depthTest:!1});this.voidMesh=new ee.Mesh(r,i),this.scene.add(this.voidMesh)}this.updateSkyColors()}getFogColor(e=0){let t=this.getCelestialAngle(e),r=Math.cos(t*Math.PI*2)*2+.5;r=Math.max(0,Math.min(1,r));let i=.7529412,s=.84705883,o=1;return i*=r*.94+.06,s*=r*.94+.06,o*=r*.91+.09,new ee.Vector3(i,s,o)}getSkyColor(e=0,t=0,r=0){let i=this.getCelestialAngle(r),s=Math.cos(i*3.141593*2)*2+.5;s<0&&(s=0),s>1&&(s=1);let o=this.getTemperature(e,t),v=this.getSkyColorByTemp(o),a=(v>>16&255)/255,l=(v>>8&255)/255,c=(v&255)/255;return new ee.Vector3(a*s,l*s,c*s)}calculateCelestialAngle(e,t){let i=(e%24e3+t)/24e3-.25;return i<0&&i++,i>1&&i--,i=1-(Math.cos(i*Math.PI)+1)/2,i+=(i-i)/3,i}getCelestialAngle(e){return this.calculateCelestialAngle(this.worldTime,e)}getTemperature(e,t){return this.temperature}getSkyColorByTemp(e){e/=3,e<-1&&(e=-1),e>1&&(e=1);let t=.6222222-e*.05,i=this.fogOrangeness>0?t+(.12-t)*this.fogOrangeness*.8:t+this.fogOrangeness*.1,s=.5+e*.1+Math.abs(this.fogOrangeness)*.3;return this.hsbToRgb(i,s,1)}hsbToRgb(e,t,r){let i=0,s=0,o=0;if(t===0)i=s=o=Math.floor(r*255+.5);else{let v=(e-Math.floor(e))*6,a=v-Math.floor(v),l=r*(1-t),c=r*(1-t*a),u=r*(1-t*(1-a));switch(Math.floor(v)){case 0:i=Math.floor(r*255+.5),s=Math.floor(u*255+.5),o=Math.floor(l*255+.5);break;case 1:i=Math.floor(c*255+.5),s=Math.floor(r*255+.5),o=Math.floor(l*255+.5);break;case 2:i=Math.floor(l*255+.5),s=Math.floor(r*255+.5),o=Math.floor(u*255+.5);break;case 3:i=Math.floor(l*255+.5),s=Math.floor(c*255+.5),o=Math.floor(r*255+.5);break;case 4:i=Math.floor(u*255+.5),s=Math.floor(l*255+.5),o=Math.floor(r*255+.5);break;case 5:i=Math.floor(r*255+.5),s=Math.floor(l*255+.5),o=Math.floor(c*255+.5);break}}return 4278190080|i<<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 e=this.viewDistance/32,t=this.brightnessAtPosition*(1-e)+e;if(this.fogBrightness+=(t-this.fogBrightness)*.1,this.inWater){let g=this.waterBreathing?100:5;this.scene.fog=new ee.Fog(new ee.Color(0,0,1),.0025,g),this.scene.background=new ee.Color(0,0,1),this.skyMesh.material.color.set(new ee.Color(0,0,1)),this.voidMesh.material.color.set(new ee.Color(0,0,.6));return}let r=this.viewDistance*16,i=1-(.25+.75*this.viewDistance/32)**.25,s=this.getCelestialAngle(this.partialTicks),o=this.getSkyColor(0,0,this.partialTicks),v=this.getFogColor(this.partialTicks),a=Math.cos(s*Math.PI*2)*2+.5,l=Math.max(0,Math.min(1,a)),c=this.prevFogBrightness+(this.fogBrightness-this.prevFogBrightness)*this.partialTicks,u=(v.x+(o.x-v.x)*i)*l*c,f=(v.y+(o.y-v.y)*i)*l*c,p=(v.z+(o.z-v.z)*i)*l*c;this.scene.background=new ee.Color(u,f,p),this.scene.fog=new ee.Fog(new ee.Color(u,f,p),.0025,r*this.distanceFactor),this.skyMesh.material.color.set(new ee.Color(o.x,o.y,o.z)),this.voidMesh.material.color.set(new ee.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))}};E();x();k();R();import*as re from"three";var kv=`
|
|
21457
|
+
f 71/216/54 68/215/54 67/214/54 72/213/54`;var Ci={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,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAP1BMVEUAAACvsv+zsPmmqv+nn/+GkPXWhCt+iOyBb+d1b/9odutodOyTWuRbb+NlZfS0W0xsV+JpVuNNWc82QZ86AGw+Ir4cAAAAAXRSTlMAQObYZgAAAUdJREFUeNrtk9FugzAMRXG4twFS1jbl/791cbJUQnuAmE2VKk5cKpDukeNA9zeAhP4mwDlgahdAEoDm1dAukIzmlXaB/HBcUGbQJCBkBejgkMrt3j5WeYGD0iAglkXkehVZFlBQ2b0FkKjtE2CjIIYEUfIhESdMCUyWoyBFZPZI+Nks8OUs/f7kXSsLgCxwiRbBl9YRgddazcC5lhnc/T1VFdQObDMIwdJBRQQh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8kkR5bzGBcDqOJqtYGcYhzSSXRjQvAbpvMaFW7h8NAW+kTVwRBfOnEkN0nldCPB5YCQAW3Th5ylQcQGKpr0EmtMapMCXogZPJFCQghXsR2kbD4blANmFeUB0IRgQ26FnndclAdkFKwdAdiH44YyQSD6JpSK70NjNa9DciTlnpBtFAe2UB8YwXcF9CTCxggErD8RvADLgkXiZRjzsMkK7jJcFVuN/5l7nm3icRCFjL4fJRdkuXPfngCi54uxP1hEzonQX4v7sRMLnMefhfpIwXrAFhXyw4P7/kgmYSeJwxJwAAAAASUVORK5CYII=",vex:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAMFBMVEUAAABthJtgeY9Ta4H////z+Pzg6fHG2eqivNWUrMOGn7eCl6t5kqp6j6RthJtgcoMKluMvAAAABHRSTlMAoKCgEjok+wAAAPlJREFUeNq1yL1Kw1AAhuE3hxYrRYm5gmivQL0Hwa1LnAtCFpdOjuKY4KBjfnYhIUPWEnIBhgxZRSjHC8hp3KWxkg5ndfD5pu8FDqNAKQkwKXIE9Fuj3zCQjECYDCaPs4tOQP9pDME4B1MAbIwTgJEwv2yixPcCPw2igGkcljlZ3YfP33WSJTB9yhG25HaJPLUBtkCdvl5fpVlVVRy3ntdQZW+eX6e77UIcNqAke0eq+JCgGvam4apoUGqtHtC067K9Q1O+l2WMJl9RvPAnl7+0L5Ao9NBB16GxZpZloTGFeWYC47l7DzrXcUF3sHTQjW9YoHMW4zn/5QeNK1xt8XQSVQAAAABJRU5ErkJggg==",villager:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAbFBMVEX///++iGy3gnKze2J6enpra2thYWFUVFRUU1NISElMODM9LSkAAAD///++iGy3gnKUj4m1e2eze2KBfXl/e3eja01vbWqQXkNjYmAAlhFUU1N1Ry93QjVcQjpISElMODM9LSkzJBEjIyMjGBTjk4HHAAAADXRSTlMAAAAAAAAAAAAAAAAA7Uh4SAAAA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D2/0ZFAk9zM9XrfYvrb1L1TPXvNbFnhwqQEPOKZbVKaZW0aWIpvy+bZVOypUYT7vFx9tGz9zOcFuDN/+gIHIEjcASOwBH44cB/1lQM4ZNhKecAAAAASUVORK5CYII="};E();x();k();R();import*as Fe from"three";var Bi=class{constructor(e,t){this.object=e;this.animations=t;d(this,"clock",new Fe.Clock);d(this,"animatedObjects",new Set);d(this,"state")}createAnimationState(){let e=new Fe.AnimationMixer(this.object),t=new Map;for(let r of this.animations)t.set(r.name,e.clipAction(r));return this.state={mixer:e,animations:this.animations,actions:t,speed:1,loop:!0},this.object.traverse(r=>{if(r instanceof Fe.Mesh||r instanceof Fe.Line||r instanceof Fe.Points||r instanceof Fe.Sprite){let i=r.onBeforeRender;r.onBeforeRender=(s,o,a,v,l,c)=>{let u=this.clock.getDelta();e.update(u),i?.(s,o,a,v,l,c)}}}),this.animatedObjects.add(this.object),this.state}playAnimation(e,t,r){let i=this.state.actions.get(e);if(!i)return!1;this.state.mixer.stopAllAction();let s=t??this.state.loop;return i.setLoop(s?Fe.LoopRepeat:Fe.LoopOnce,1/0),i.clampWhenFinished=!s,r===void 0?i.timeScale=this.state.speed:i.timeScale=r,i.reset().fadeIn(.1).play(),!0}updateAnimationParams(e,t){e!==void 0&&(this.state.speed=e),t!==void 0&&(this.state.loop=t);for(let r of this.state.actions.values())e!==void 0&&(r.timeScale=e),t!==void 0&&(r.setLoop(t?Fe.LoopRepeat:Fe.LoopOnce,1/0),r.clampWhenFinished=!t)}stopAnimations(){this.state.mixer.stopAllAction()}getDelta(){return this.clock.getDelta()}};function h3(n,e){let t=new Bi(n,e);return t.createAnimationState(),t}function k4(n){return"parts"in n&&Array.isArray(n.parts)?n.parts:[n]}var T4={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 m3(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function M4(n,e,t,r,i=!1,s=64,o=64,a=!1,v=[]){let l=new te.Euler(0,0,0);r.rotation&&(l.x=-r.rotation[0]*Math.PI/180,l.y=-r.rotation[1]*Math.PI/180,l.z=-r.rotation[2]*Math.PI/180);for(let{dir:c,corners:u,u0:h,v0:p,u1:g,v1:y}of Object.values(T4)){let A=Math.floor(n.positions.length/3),b=c[0]!==0,w=[];for(let S of u){let C,M;i?(C=(r.uv[0]+S[3]*r.size[0])/s,M=(r.uv[1]+S[4]*r.size[1])/o):(C=(r.uv[0]+m3(S[3]?g:h,r.size))/s,M=(r.uv[1]+m3(S[4]?y:p,r.size))/o);let I=b&&a?S[0]^1:S[0],B=S[1],H=b&&a?S[2]^1:S[2],G=r.inflate??0,O=new te.Vector3(r.origin[0]+I*r.size[0]+(I?G:-G),r.origin[1]+B*r.size[1]+(B?G:-G),r.origin[2]+H*r.size[2]+(H?G:-G));O=O.applyEuler(l),O=O.sub(t.position),O=O.applyEuler(t.rotation),O=O.add(t.position),n.positions.push(O.x,O.y,O.z),n.normals.push(c[0],c[1],c[2]),w.push(C,M),n.skinIndices.push(e,0,0,0),n.skinWeights.push(1,0,0,0)}if(a)for(let S=0;S+1<u.length;S+=2){let C=S*2,M=w.slice(C,C+4);w[C]=M[2],w[C+1]=M[b?1:3],w[C+2]=M[0],w[C+3]=M[b?3:1]}n.uvs.push(...w),n.indices.push(A,A+1,A+2,A+2,A+1,A+3)}}function D0(n,e,t,r={},i={}){let s=t.texturewidth??64,o=t.textureheight??64,a,v=e.startsWith("block:"),l=n?.material.map;if(v){if(!n)throw new Error("worldRenderer is required for block textures");let w=e.slice(6),S=n.resourcesManager.currentResources.blocksAtlasJson.textures[w];S&&(s=l?.image.width??s,o=l?.image.height??o,a=[S.u,S.v])}let c={},u={positions:[],normals:[],uvs:[],indices:[],skinIndices:[],skinWeights:[]},h=0;for(let w of t.bones){let S=new te.Bone;if(w.pivot&&(S.position.x=w.pivot[0],S.position.y=w.pivot[1],S.position.z=w.pivot[2]),w.bind_pose_rotation?(S.rotation.x=-w.bind_pose_rotation[0]*Math.PI/180,S.rotation.y=-w.bind_pose_rotation[1]*Math.PI/180,S.rotation.z=-w.bind_pose_rotation[2]*Math.PI/180):w.rotation&&(S.rotation.x=-w.rotation[0]*Math.PI/180,S.rotation.y=-w.rotation[1]*Math.PI/180,S.rotation.z=-w.rotation[2]*Math.PI/180),r.rotation?.[w.name]&&(S.rotation.x-=(r.rotation[w.name].x??0)*Math.PI/180,S.rotation.y-=(r.rotation[w.name].y??0)*Math.PI/180,S.rotation.z-=(r.rotation[w.name].z??0)*Math.PI/180),S.name=`bone_${w.name}`,c[w.name]=S,w.cubes)for(let C of w.cubes){let M=[];M4(u,h,S,C,v,s,o,w.mirror,M),M.length&&(i.errors??(i.errors=[]),i.errors.push(...M.map(I=>`Bone ${w.name}: ${I}`)))}h++}let p=[];for(let w of t.bones)w.parent&&c[w.parent]?c[w.parent].add(c[w.name]):p.push(c[w.name]);let g=new te.Skeleton(Object.values(c)),y=new te.BufferGeometry;y.setAttribute("position",new te.Float32BufferAttribute(u.positions,3)),y.setAttribute("normal",new te.Float32BufferAttribute(u.normals,3)),y.setAttribute("uv",new te.Float32BufferAttribute(u.uvs,2)),y.setAttribute("skinIndex",new te.Uint16BufferAttribute(u.skinIndices,4)),y.setAttribute("skinWeight",new te.Float32BufferAttribute(u.skinWeights,4)),y.setIndex(u.indices);let A=new te.MeshLambertMaterial({transparent:!0,alphaTest:.1,side:te.DoubleSide}),b=new te.SkinnedMesh(y,A);if(b.add(...p),b.bind(g),b.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 c1(e,w=>{A.map||(w.magFilter=te.NearestFilter,w.minFilter=te.NearestFilter,w.flipY=!1,w.wrapS=te.RepeatWrapping,w.wrapT=te.RepeatWrapping,A.map=w)},()=>{let w=A.map.image.width;w&&s!==w&&(A.map.repeat.x=s/w);let S=A.map.image.height;S&&o!==S&&(A.map.repeat.y=o/S),A.needsUpdate=!0});return b}var S4=[{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 p3(n){for(let e of S4)if(typeof e.pattern=="string"){if(e.pattern===n)return e.target}else if(e.pattern.test(n))return e.target}var g3=n=>Co[n],b3={zombie:1.85,husk:1.85,arrow:.0025},C4={zombie:new I1(0,1,0),husk:new I1(0,1,0),boat:new I1(0,-1,0),arrow:new I1(0,-.9,0)},M0=class{constructor(e,t,r,i={},s={}){d(this,"mesh");d(this,"animations");d(this,"animationControllers",[]);let o=t,a=p3(t);if(a&&(t=a,s.tempMap=a),i.customModel){let l=k4(i.customModel);this.mesh=new te.Object3D;for(let c=0;c<l.length;c++){let{modelPath:u,modelType:h,metadata:p}=l[c],g=new te.Object3D;switch(g.name=`custom_part_${c}`,h){case"gltf":{new _4().parseAsync(u,"").then(A=>{if(g.add(A.scene),p?.scale){let b=p.scale;g.scale.set(b,b,b)}if(p?.offset){let{x:b=0,y:w=0,z:S=0}=p.offset;g.position.set(b,w,S)}if(p?.texture){let b=It(p.texture);g.traverse(w=>{w instanceof te.Mesh&&(w.material=new te.MeshBasicMaterial({map:b,transparent:!0,alphaTest:.1}))})}if(A.animations?.length){this.animations=[...this.animations??[],...A.animations];let b=h3(g,A.animations);this.animationControllers.push(b);let w=p?.animation,S=p?.animationLoop??!0;w?b.playAnimation(w,S):b.playAnimation(A.animations[0].name,S)}}).catch(A=>{});break}case"obj":{let A=new Wt().parse(u);if(p?.scale){let{scale:b}=p;A.scale.set(b,b,b)}if(p?.offset){let{x:b=0,y:w=0,z:S=0}=p.offset;A.position.set(b,w,S)}if(p?.texture){let b=It(p.texture),w=new te.MeshBasicMaterial({map:b,transparent:!0,alphaTest:.1});A.traverse(S=>{S instanceof te.Mesh&&(S.material=w)})}g.add(A);break}case"bedrock":{let y=JSON.parse(u);if(p?.scale&&g.scale.set(p.scale,p.scale,p.scale),p?.offset){let{x:A=0,y:b=0,z:w=0}=p.offset;g.position.set(A,b,w)}for(let[A,b]of Object.entries(y.geometry)){let w=p?.textures?.[A]??y.textures?.[A];if(!w)continue;let S=D0(r,w.endsWith(".png")||w.startsWith("data:image/")||w.startsWith("block:")?w:w+".png",b,i,s);S.name=`geometry_${A}`,g.add(S)}break}}this.mesh.add(g)}s.type=l.length===1?l[0].modelType:"special";return}if(jt[t]){let l=new Wt,c={zombie_horse:`textures/${e}/entity/horse/horse_zombie.png`,husk:w4,skeleton_horse:`textures/${e}/entity/horse/horse_skeleton.png`,donkey:`textures/${e}/entity/horse/donkey.png`,mule:`textures/${e}/entity/horse/mule.png`,ocelot:A4,arrow:E4,spectral_arrow:x4,tipped_arrow:R4},u=c[o]||c[t];u&&(s.textureMap=!0);let h=u||Ci[t];if(Ci[t]&&(s.isHardcodedTexture=!0),!h)throw new Error(`No texture for ${t}`);let p=It(h),g=new te.MeshBasicMaterial({map:p,transparent:!0,alphaTest:.1}),y=l.parse(jt[t]),A=b3[o]||b3[t];A&&y.scale.set(A,A,A);let b=C4[o];b&&y.position.set(b.x,b.y,b.z),y.traverse(w=>{w instanceof te.Mesh&&(w.material=g,w.name==="Head layer"&&(w.visible=!1),w.name==="Head"&&i.rotation?.head&&(w.rotation.x-=(i.rotation.head.x??0)*Math.PI/180,w.rotation.y-=(i.rotation.head.y??0)*Math.PI/180,w.rotation.z-=(i.rotation.head.z??0)*Math.PI/180))}),this.mesh=y,s.type="obj";return}let v=g3(t);if(v){this.mesh=new te.Object3D;for(let[l,c]of Object.entries(v.geometry)){let u=i.textures?.[l]??v.textures[l];if(!u)continue;let h=D0(r,u.endsWith(".png")||u.startsWith("data:image/")||u.startsWith("block:")?u:u+".png",c,i,s);h.name=`geometry_${l}`,this.mesh.add(h)}s.type="bedrock"}}playAnimation(e,t=!1){if(!this.animationControllers.length)return;let r=!1;for(let i of this.animationControllers)i.playAnimation(e,t)&&(r=!0)}update(e){}static getStaticData(e){if(e=p3(e)||e,jt[e])return{boneNames:[]};let t=g3(e);if(!t)throw new Error(`Unknown entity ${e}`);return{boneNames:Object.values(t.geometry).flatMap(r=>r.name)}}};globalThis.EntityMesh=M0;E();x();k();R();import{default as I4}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_1.png";import{default as H4}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_2.png";import{default as O4}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_1.png";import{default as D4}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_2.png";import{default as F4}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_1.png";import{default as z4}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_2.png";import{default as L4}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_1.png";import{default as U4}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_2.png";import{default as G4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1.png";import{default as V4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1_overlay.png";import{default as N4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2.png";import{default as W4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2_overlay.png";import{default as j4}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_1.png";import{default as Y4}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_2.png";import{default as Q4}from"mc-assets/dist/other-textures/latest/models/armor/turtle_layer_1.png";import{default as _3}from"mc-assets/dist/other-textures/latest/entity/elytra.png";var F0={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 y3={leather_layer_1:G4,leather_layer_1_overlay:V4,leather_layer_2:N4,leather_layer_2_overlay:W4,chainmail_layer_1:I4,chainmail_layer_2:H4,iron_layer_1:L4,iron_layer_2:U4,diamond_layer_1:O4,diamond_layer_2:D4,golden_layer_1:F4,golden_layer_2:z4,netherite_layer_1:j4,netherite_layer_2:Y4,turtle_layer_1:Q4};var k3=Pt($e),K4=120,Pi=n=>n*(Math.PI/180);function J4(n){return n<0&&(n=4294967295+n+1>>>0),n.toString(16)}function q4(n){if(n===void 0)return;if(parseInt(n,10)===0)return"rgba(0, 0, 0, 0)";let e=J4(parseInt(n,10));return e.length===8?`#${e.slice(2,8)}${e.slice(0,2)}`:`#${e}`}function w3(n,e){return n===void 0?e: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 _0(n,e){return n===void 0?e??new W.Euler:n instanceof W.Euler?n:n.yaw!==void 0&&n.pitch!==void 0&&n.roll!==void 0?new W.Euler(-Pi(n.pitch),-Pi(n.yaw),Pi(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]):e??new W.Euler}var H1=Math.PI*2;function Z4(n,e){let t=((e-n)%H1+H1)%H1;return t>Math.PI?t-H1:t}function T3({username:n,nameTagBackgroundColor:e="rgba(0, 0, 0, 0.3)",nameTagTextOpacity:t=255},{fontFamily:r="mojangles"},i){let s=We(64,64),o=R3(i),a=s.getContext("2d");if(!a)throw new Error("Could not get 2d context");let v=48,l=5;a.font=`${v}px ${r}`;let c=String(typeof n=="string"?n:new o(n).toString()).split(`
|
|
21458
|
+
`),u=0;for(let p of c){let g=a.measureText(p).width+l*2;g>u&&(u=g)}if(s.width=u,s.height=(v+l)*c.length,a.fillStyle=e,a.fillRect(0,0,s.width,s.height),a.globalAlpha=t/255,!!jr(n,o,s,v,"white",-l+v))return a.globalAlpha=1,s}globalThis.getUsernameTexture=T3;var D1=(n,e,t,r)=>{for(let v of t.children)v.name==="nametag"&&v.removeFromParent();if(n.username===void 0||n.username===null||(typeof n.username=="string"?n.username:new(R3(r))(n.username).toString()).startsWith("EMPTY"))return;let s=T3(n,e,r);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",t.add(a),a},A3={},X4=n=>n.charAt(0)===n.charAt(0).toUpperCase();function E3(n){if(n!=null){if(Array.isArray(n))return n;if(typeof n=="object"){let e=n,t=Object.keys(e).filter(r=>/^\d+$/.test(r)).map(Number).sort((r,i)=>r-i);if(t.length&&t[0]===0&&t.every((r,i)=>r===i))return t.map(r=>e[String(r)])}}}function $4(n,e,t,r,i){if(e.name)try{let l=(X4(e.name)?Ai(e.name):e.name).toLowerCase(),c=new M0("1.16.4",l,t,i);if(c.mesh)return D1(e,r,c.mesh,t.version),c.mesh}catch(l){reportError?.(l)}if(!n||!(0,x3.isEntityAttackable)(n,e))return;let s=new W.BoxGeometry(e.width,e.height,e.width);s.translate(0,e.height/2,0);let o=new W.MeshBasicMaterial({color:16711935}),a=new W.Mesh(s,o);return(A3[e.name]=(A3[e.name]||0)+1)<6&&D1({username:e.name,height:e.height},r,a,t.version),a}var F1=class{constructor(e,t){this.worldRenderer=e;this.mcData=t;d(this,"entities",{});d(this,"playerEntity",null);d(this,"entitiesOptions",{fontFamily:"mojangles"});d(this,"debugMode");d(this,"onSkinUpdate");d(this,"clock",new W.Clock);d(this,"currentlyRendering",!0);d(this,"cachedMapsImages",{});d(this,"itemFrameMaps",{});d(this,"pendingModelOverrides",new Map);d(this,"motionCache",new Map);d(this,"MOVE_ON",.05);d(this,"MOVE_OFF",.02);d(this,"RUN_ON",4.8);d(this,"RUN_OFF",4.2);d(this,"uuidPerSkinUrlsCache",{});d(this,"currentSkinUrls",{});d(this,"loadedSkinEntityIds",new Set);d(this,"playerPerAnimation",{});this.debugMode="none",this.onSkinUpdate=()=>{},this.watchResourcesUpdates()}updateAutoWalkFlags(e,t,r){if(!t.playerObject?.animation)return;let i=t.playerObject.animation;if(!("isMoving"in i)||!("isRunning"in i)||r<=0)return;let s=this.motionCache.get(e);if(!s){this.motionCache.set(e,{pos:t.position.clone(),speed:0}),i.isMoving=!1,i.isRunning=!1;return}let o=t.position.x-s.pos.x,a=t.position.z-s.pos.z;s.pos.copy(t.position);let v=Math.hypot(o,a)/Math.max(r,1e-6);s.speed=s.speed*.8+v*.2;let l=i.isMoving?s.speed>this.MOVE_OFF:s.speed>this.MOVE_ON,c=i.isRunning?s.speed>this.RUN_OFF:s.speed>this.RUN_ON;i.isMoving=l,i.isRunning=l&&c}get entitiesByName(){let e={};for(let t of Object.values(this.entities))t.realName&&(e[t.realName]=e[t.realName]||[],e[t.realName].push(t));return e}get entitiesRenderingCount(){return Object.values(this.entities).filter(e=>e.visible).length}getDebugString(){let e=Object.keys(this.entities).length,t=this.entitiesRenderingCount,r=Object.values(this.entities).filter(s=>s.playerObject),i=r.filter(s=>s.visible);return`${t}/${e} ${i.length}/${r.length}`}handlePlayerEntity(e){if(!this.playerEntity){let t=new W.Group;t.originalEntity={...e,name:"player"};let r=new W.Group,i=this.setupPlayerObject(e,r,{});t.playerObject=i,t.add(r),t.name="player_entity",this.playerEntity=t,this.worldRenderer.scene.add(t),this.updatePlayerSkin(e.id,e.username,e.uuid??void 0,$e)}this.playerEntity.originalEntity={...e,name:"player"},e.position&&(this.worldRenderer.sceneOrigin.getWorldPosition(this.playerEntity)||this.worldRenderer.sceneOrigin.track(this.playerEntity),this.playerEntity.position.set(e.position.x,e.position.y,e.position.z)),e.yaw!==void 0&&(this.playerEntity.rotation.y=e.yaw),this.updateEntityEquipment(this.playerEntity,e)}clear(){for(let e of Object.values(this.entities))this.worldRenderer.sceneOrigin.removeAndUntrack(e),Re(e);this.entities={},this.currentSkinUrls={},this.motionCache.clear(),this.playerEntity&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.playerEntity),Re(this.playerEntity),this.playerEntity=null)}reloadEntities(){for(let e of Object.values(this.entities))this.update({...e.originalEntity,delete:!0},{}),this.update(e.originalEntity,{})}watchResourcesUpdates(){this.worldRenderer.resourcesManager.on("assetsTexturesUpdated",()=>this.reloadEntities()),this.worldRenderer.resourcesManager.on("assetsInventoryReady",()=>this.reloadEntities())}setDebugMode(e,t=null){this.debugMode=e;for(let r of t?[t]:Object.values(this.entities)){let i=r.children.find(s=>s.name==="debug");i.visible=!1,this.debugMode==="basic"&&(i.visible=!0)}}setRendering(e,t=null){this.currentlyRendering=e;for(let r of t?[t]:Object.values(this.entities))e?this.worldRenderer.scene.children.includes(r)||this.worldRenderer.scene.add(r):this.worldRenderer.scene.remove(r)}playEntityModelAnimation(e,t,r=!1){let i=this.entities[e];i&&i.traverse(s=>{s instanceof M0&&s.playAnimation(t,r)})}render(){let e=this.worldRenderer.worldRendererConfig.renderEntities;e!==this.currentlyRendering&&this.setRendering(e);let t=this.clock.getDelta(),r=Math.min(t,1/30),i=this.worldRenderer.viewerChunkPosition,s=10*10;for(let[o,a]of[...Object.entries(this.entities),["player_entity",this.playerEntity]]){if(!a)continue;let v=o,l=o==="player_entity";if(l){let u=this.worldRenderer.playerStateUtils.isThirdPerson();if(a.visible=u,u){let h=this.worldRenderer.playerStateReactive.eyeHeight;a.position.set(this.worldRenderer.cameraWorldPos.x,this.worldRenderer.cameraWorldPos.y-h,this.worldRenderer.cameraWorldPos.z)}v=String(this.playerEntity?.originalEntity.id??"player_entity")}let{playerObject:c}=a;if(this.updateAutoWalkFlags(v,a,t),c?.animation&&c.animation.update(c,r),a.traverse(u=>{u instanceof M0&&u.update(r)}),!l&&i&&a.position){let u=a.position.x-i.x,h=a.position.y-i.y,p=a.position.z-i.z,g=u*u+h*h+p*p;a.visible=!!(g<s||this.worldRenderer.shouldObjectVisible(a)),this.maybeRenderPlayerSkin(o)}if(a.visible&&this.syncArmorPositions(a),l&&a.visible){let u=this.worldRenderer.cameraShake.getBaseRotation();a.rotation.set(0,u.yaw,0),a.traverse(h=>{h.name==="head"&&h.rotation.set(-u.pitch,0,0)})}}}syncArmorPositions(e){e.playerObject&&e.traverse(t=>{if(!t.name.startsWith("geometry_armor_"))return;let{skin:r}=e.playerObject;switch(t.name){case"geometry_armor_head":t.children[0]?.children[0]&&t.children[0].children[0].rotation.set(-r.head.rotation.x,r.head.rotation.y,r.head.rotation.z,r.head.rotation.order);break;case"geometry_armor_legs":t.children[0]&&(t.children[0].children[2]&&t.children[0].children[2].rotation.set(-r.leftLeg.rotation.x,r.leftLeg.rotation.y,r.leftLeg.rotation.z,r.leftLeg.rotation.order),t.children[0].children[1]&&t.children[0].children[1].rotation.set(-r.rightLeg.rotation.x,r.rightLeg.rotation.y,r.rightLeg.rotation.z,r.rightLeg.rotation.order));break;case"geometry_armor_feet":t.children[0]&&(t.children[0].children[0]&&t.children[0].children[0].rotation.set(-r.rightLeg.rotation.x,r.rightLeg.rotation.y,r.rightLeg.rotation.z,r.rightLeg.rotation.order),t.children[0].children[1]&&t.children[0].children[1].rotation.set(-r.leftLeg.rotation.x,r.leftLeg.rotation.y,-r.leftLeg.rotation.z,r.leftLeg.rotation.order));break}})}getPlayerObject(e){return this.playerEntity?.originalEntity.id===e?this.playerEntity?.playerObject:this.entities[e]?.playerObject}isCanvasBlank(e){return!e.getContext("2d")?.getImageData(0,0,e.width,e.height).data.some(t=>t!==0)}async updatePlayerSkin(e,t,r,i,s=void 0){i!==$e&&this.loadedSkinEntityIds.add(String(e)),r&&((typeof i=="string"||typeof s=="string")&&(this.uuidPerSkinUrlsCache[r]={}),typeof i=="string"&&(this.uuidPerSkinUrlsCache[r].skinUrl=i),typeof s=="string"&&(this.uuidPerSkinUrlsCache[r].capeUrl=s),i===!0&&(i=this.uuidPerSkinUrlsCache[r]?.skinUrl??i),s??(s=this.uuidPerSkinUrlsCache[r]?.capeUrl));let a=this.getPlayerObject(e);if(!a)return;if(i===!0){if(!t)return;let l=await H0(t,"skin");if(!this.getPlayerObject(e)||!l)return;i=l}if(typeof i!="string")throw new Error("Invalid skin url");if(this.currentSkinUrls[String(e)]===i){if(s){if(s===!0&&t){let l=await H0(t,"cape");if(!this.getPlayerObject(e)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(e,s)}return}i!==$e&&(this.currentSkinUrls[String(e)]=i);let v=this.worldRenderer.worldRendererConfig.renderEars||t==="deadmau5";this.loadAndApplySkin(e,i,v).then(async()=>{if(s){if(s===!0&&t){let l=await H0(t,"cape");if(!this.getPlayerObject(e)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(e,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(e,t,r){let i=this.getPlayerObject(e);if(i)try{let s;if(i=this.getPlayerObject(e),!i)return;let o,a;if(t===$e){let l=await y0($e);s=l.image,o=new W.CanvasTexture(l.canvas),a=l.canvas}else{let{canvas:l,image:c}=await y0(t);s=c,o=new W.CanvasTexture(l),a=l}o.magFilter=W.NearestFilter,o.minFilter=W.NearestFilter,o.needsUpdate=!0,i.skin.map=o,i.skin.modelType=zr(a),i.skin.isCustom=t!==$e,Ri(i);let v;if(s?r&&(v=We(64,64),Lr(v,s),r=!this.isCanvasBlank(v)):r=!1,r){let l=new W.CanvasTexture(v);l.magFilter=W.NearestFilter,l.minFilter=W.NearestFilter,l.needsUpdate=!0,i.ears.map=l,i.ears.visible=!0}else i.ears.map=null,i.ears.visible=!1;this.onSkinUpdate?.()}catch{}}async loadAndApplyCape(e,t){let r=this.getPlayerObject(e);if(r)try{let{canvas:i,image:s}=await y0(t);if(r=this.getPlayerObject(e),!r)return;Fr(i,s);let o=new W.CanvasTexture(i);o.magFilter=W.NearestFilter,o.minFilter=W.NearestFilter,o.needsUpdate=!0,r.cape.map=o,r.cape.visible=!0,r.elytra.map=o,this.onSkinUpdate?.(),r.backEquipment||(r.backEquipment="cape")}catch{}}debugSwingArm(){let e=Object.values(this.entities).find(r=>r.playerObject?.animation);if(!e||!e.playerObject?.animation)return;let t=e.playerObject.animation;t.swingArm&&t.swingArm()}playAnimation(e,t){let r=String(e);if(t!=="oneSwing"){if(this.playerPerAnimation[r]===t)return;this.playerPerAnimation[r]=t}if(e==="player_entity"&&this.playerEntity?.playerObject){let{playerObject:s}=this.playerEntity;if(t==="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=t==="walking"||t==="running"||t==="crouchWalking",o.isRunning=t==="running",o.isCrouched=t==="crouch"||t==="crouchWalking")});return}let i=this.getPlayerObject(e);if(i){if(t==="oneSwing"){i.animation&&i.animation.swingArm&&i.animation.swingArm();return}i.animation&&i.animation.switchAnimationCallback!==void 0&&(i.animation.switchAnimationCallback=()=>{let s=i.animation;s&&(s.isMoving=t==="walking"||t==="running"||t==="crouchWalking",s.isRunning=t==="running",s.isCrouched=t==="crouch"||t==="crouchWalking")});return}if(this.playerEntity?.playerObject){let{playerObject:s}=this.playerEntity;if(t==="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=t==="walking"||t==="running"||t==="crouchWalking",o.isRunning=t==="running",o.isCrouched=t==="crouch"||t==="crouchWalking")})}}parseEntityLabel(e){if(e)try{if(e.type==="string")return e.value;let t=typeof e=="string"?D5.default.simplify(D5.default.parse(e)):Hi.simplify(e);return bi(t).map(this.textFromComponent).join("")}catch{return e}}textFromComponent(e){return typeof e=="string"?e:e.text??""}getItemMesh(e,t,r=!1,i){!e.nbt&&e.nbtData&&(e.nbt=e.nbtData);let s=this.worldRenderer.getItemRenderData(e,t);if(!(i&&i===s?.modelName)){if(s&&"resolvedModel"in s){let o=Ds(this.worldRenderer.material,s.resolvedModel,s.modelName,this.worldRenderer.resourcesManager.currentResources.worldBlockProvider,this.worldRenderer.resourcesManager.currentResources.mcData),a=1;t["minecraft:display_context"]==="ground"?a=.5:t["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,p=co(o,{u:a,v,sizeX:l??1,sizeY:c??1},{faceCamera:r,use3D:!r}),g=1;return t["minecraft:display_context"]==="ground"?g=.5:t["minecraft:display_context"]==="thirdperson"&&(g=6),p.mesh.scale.set(g,g,g),{mesh:p.mesh,isBlock:!1,modelName:s.modelName,cleanup:p.cleanup}}}}setVisible(e,t){t?e.scale.set(1,1,1):e.scale.set(0,0,0)}update(e,t){let r=e.name==="player";(e.name==="zombie_villager"||e.name==="husk")&&(t.texture=`textures/1.16.4/entity/${e.name==="zombie_villager"?"zombie_villager/zombie_villager.png":`zombie/${e.name}.png`}`),e.name==="glow_item_frame"&&(t.textures||(t.textures=[]),t.textures.background="block:glow_item_frame");let i=this.entities[e.id],s=!i;if(e.delete){if(!i)return;i.userData._posTween?.stop(),i.userData._rotTween?.stop(),i.additionalCleanup&&i.additionalCleanup(),i.traverse(g=>{g.additionalCleanup&&g.additionalCleanup()}),this.onRemoveEntity(e),this.worldRenderer.sceneOrigin.removeAndUntrack(i),Re(i),delete this.entities[e.id];return}let o;if(i===void 0){this.beforeEntityAdded(e);let g=new W.Group;if(g.originalEntity=e,e.name==="item"||e.name==="tnt"||e.name==="falling_block"||e.name==="snowball"||e.name==="egg"||e.name==="ender_pearl"||e.name==="experience_bottle"||e.name==="splash_potion"||e.name==="lingering_potion"){let b=e.name==="tnt"||e.type==="projectile"?{name:e.name}:e.name==="falling_block"?{blockState:e.objectData}:E3(e.metadata)?.find(w=>typeof w=="object"&&w?.itemCount);if(b){let w=this.getItemMesh(b,{"minecraft:display_context":"ground"},e.type==="projectile");if(w){if(o=w.mesh,e.name==="item"||e.type==="projectile"?(o.scale.set(.5,.5,.5),o.position.set(0,e.name==="item"?.2:.1,0)):(o.scale.set(2,2,2),o.position.set(0,.5,0)),e.name==="item"){let S=new W.Clock;o.onBeforeRender=()=>{let C=S.getDelta();o.rotation.y+=C}}g.additionalCleanup=()=>{w.cleanup&&w.cleanup()}}}}else if(r){let b=new W.Group,w=this.setupPlayerObject(e,b,t);if(g.playerObject=w,o=b,e.username){let S=D1(e,{fontFamily:"mojangles"},b,this.worldRenderer.version);S&&(S.position.y=w.position.y+w.scale.y*16+3,S.scale.multiplyScalar(12))}}else o=$4(this.mcData,e,this.worldRenderer,this.entitiesOptions,{...t,customModel:e.customModel});if(!o)return;o.name="mesh";let y=e.pos??e.position;this.worldRenderer.sceneOrigin.track(g),g.position.set(y.x,y.y,y.z);let A=new W.BoxHelper(o,e.type==="hostile"?16711680:e.type==="mob"?65280:e.type==="player"?255:16753920);A.name="debug",g.add(o),g.add(A),A.visible=!1,this.worldRenderer.scene.add(g),i=g,i.name="entity",i.realName=e.name,this.entities[e.id]=i,r&&this.updatePlayerSkin(e.id,e.username,t?.texture?e.uuid:void 0,t?.texture||$e),this.setDebugMode(this.debugMode,g),this.setRendering(this.currentlyRendering,g),this.afterAddEntity(e)}else o=i.children.find(g=>g.name==="mesh");this.updateEntityEquipment(i,e);let a=M3(e,this.mcData),l=(E3(e.metadata)?.[0]??e.metadata?.[0]??0)&32||this.worldRenderer.playerStateReactive.cameraSpectatingEntity===e.id&&this.worldRenderer.playerStateUtils.isSpectator();for(let g of o.children??[])g.name!=="nametag"&&(g.visible=!l);a.baby?i.scale.set(.5,.5,.5):i.scale.set(1,1,1);let c=O1("text_display",e,this.mcData),u=c?.text||a.custom_name_visible&&a.custom_name;if(e.name!=="player"&&u){let g=c&&(c.billboard_render_constraints==="fixed"||!c.billboard_render_constraints),y=c&&!(parseInt(c.style_flags,10)&4)?q4(c.background_color):void 0,A;if(c?.text_opacity){let b=parseInt(c?.text_opacity,10);A=b>0?b:256-b}D1({...e,username:typeof u=="string"?D5.default.simplify(D5.default.parse(u)):Hi.simplify(u),nameTagBackgroundColor:y,nameTagTextOpacity:A,nameTagFixed:g,nameTagScale:c?.scale,nameTagTranslation:c&&(c.translation||new W.Vector3(0,0,0)),nameTagRotationLeft:w3(c?.left_rotation),nameTagRotationRight:w3(c?.right_rotation)},this.entitiesOptions,o,this.worldRenderer.version)}let h=O1("armor_stand",e,this.mcData);if(h){let g=(parseInt(h.client_flags,10)&1)!==0,y=(parseInt(h.client_flags,10)&4)!==0,A=(parseInt(h.client_flags,10)&8)===0,b=(parseInt(h.client_flags,10)&16)!==0;o.castShadow=!b,o.receiveShadow=!b,g?i.scale.set(.5,.5,.5):i.scale.set(1,1,1),i.traverse(w=>{switch(w.name){case"bone_baseplate":this.setVisible(w,A),w.rotation.y=-i.rotation.y;break;case"bone_head":h.head_pose&&w.setRotationFromEuler(_0(h.head_pose));break;case"bone_body":h.body_pose&&w.setRotationFromEuler(_0(h.body_pose));break;case"bone_rightarm":w.parent?.name!=="bone_armor"&&this.setVisible(w,y),h.left_arm_pose?w.setRotationFromEuler(_0(h.left_arm_pose)):w.setRotationFromEuler(_0({yaw:-10,pitch:-10,roll:0}));break;case"bone_leftarm":w.parent?.name!=="bone_armor"&&this.setVisible(w,y),h.right_arm_pose?w.setRotationFromEuler(_0(h.right_arm_pose)):w.setRotationFromEuler(_0({yaw:10,pitch:-10,roll:0}));break;case"bone_rightleg":h.left_leg_pose?w.setRotationFromEuler(_0(h.left_leg_pose)):w.setRotationFromEuler(_0({yaw:-1,pitch:-1,roll:0}));break;case"bone_leftleg":h.right_leg_pose?w.setRotationFromEuler(_0(h.right_leg_pose)):w.setRotationFromEuler(_0({yaw:1,pitch:1,roll:0}));break}})}let p=O1("item_frame",e,this.mcData);if(p||(p=O1("glow_item_frame",e,this.mcData)),p){let g=p?.item??e.metadata?.[8];if(o.scale.set(1,1,1),o.position.set(0,0,-.5),i.rotation.x=-e.pitch,i.children.find(y=>{if(y.name.startsWith("map_")){Re(y);let A=parseInt(y.name.split("_")[1],10);return this.itemFrameMaps[A]=this.itemFrameMaps[A]?.filter(b=>b!==y),y instanceof W.Mesh&&y.material?.map?.dispose(),!0}else if(y.name==="item")return Re(y),!0;return!1})?.removeFromParent(),g&&(g.itemId??g.blockId??0)!==0){let y=p.rotation??0,A=g.nbtData?.value?.map?.value??g.components?.find(b=>b.type==="map_id")?.data;if(A)o.scale.set(16/12,16/12,1),this.addMapModel(i,A,y);else{let b=this.getItemMesh(g,{"minecraft:display_context":"fixed"});b&&(b.mesh.position.set(0,0,-.05),b.isBlock?b.mesh.scale.set(.25,.25,.25):b.mesh.scale.set(.5,.5,.5),b.mesh.rotateY(Math.PI),b.mesh.rotateZ(-y*Math.PI/4),b.mesh.name="item",i.add(b.mesh))}}}e.username!==void 0&&(i.username=e.username),this.updateNameTagVisibility(i),this.updateEntityPosition(e,s,t)}updateEntityPosition(e,t,r){let i=this.entities[e.id];if(!i)return;let s=t?0:K4;if(e.position){let a=this.worldRenderer.sceneOrigin.getWorldPosition(i)??{x:e.position.x,y:e.position.y,z:e.position.z};i.userData._tweenTarget||(i.userData._tweenTarget={x:a.x,y:a.y,z:a.z}),i.userData._posTween?.stop(),i.userData._posTween=new Oe(i.userData._tweenTarget).to({x:e.position.x,y:e.position.y,z:e.position.z},s).onUpdate(()=>{i.position.set(i.userData._tweenTarget.x,i.userData._tweenTarget.y,i.userData._tweenTarget.z)}).start()}let o;if(i.playerObject&&r?.rotation?.head){let a=r.rotation.head.y,v=typeof a=="number"&&Number.isFinite(a)?a:e.yaw;typeof v=="number"&&Number.isFinite(v)&&(o=v)}else typeof e.yaw=="number"&&Number.isFinite(e.yaw)&&(o=e.yaw);if(typeof o=="number"&&Number.isFinite(o)){let a=Z4(i.rotation.y,o);i.userData._rotTween?.stop(),i.userData._rotTween=new Oe(i.rotation).to({y:i.rotation.y+a},s).start()}if(i?.playerObject&&r?.rotation?.head){let{playerObject:a}=i;a.skin.head.rotation.y=0;let v=r.rotation.head.x;a.skin.head.rotation.x=typeof v=="number"&&Number.isFinite(v)?-v:0}}afterAddEntity(e){}beforeEntityAdded(e){let t=this.pendingModelOverrides.get(e.id.toString());if(t){let{parts:r}=t;e.customModel=r.length===1?r[0]:{parts:r},this.pendingModelOverrides.delete(e.id.toString())}}maybeRenderPlayerSkin(e){let t=this.entities[e];if(e==="player_entity"&&(t=this.playerEntity,e=this.playerEntity?.originalEntity.id),!t||!t.playerObject||!t.visible)return;let r=128,i=this.worldRenderer.getCameraPosition(),s=this.worldRenderer.sceneOrigin.getWorldPosition(t),a=(s?new W.Vector3(s.x,s.y,s.z):t.position.clone().add(new W.Vector3(this.worldRenderer.sceneOrigin.x,this.worldRenderer.sceneOrigin.y,this.worldRenderer.sceneOrigin.z))).distanceTo(i);if(a<r&&a<this.worldRenderer.viewDistance*16){if(this.loadedSkinEntityIds.has(String(e)))return;this.updatePlayerSkin(e,t.playerObject.realUsername,t.playerObject.realPlayerUuid,!0,!0)}}onRemoveEntity(e){this.loadedSkinEntityIds.delete(e.id.toString()),delete this.currentSkinUrls[e.id.toString()],this.motionCache.delete(e.id.toString())}updateMap(e,t){this.cachedMapsImages[e]=t;let r=this.itemFrameMaps[e];if(r&&(r=r.filter(i=>i.parent),this.itemFrameMaps[e]=r,r))for(let i of r)i.material.map=this.loadMap(t),i.material.needsUpdate=!0,i.visible=!0}updateNameTagVisibility(e){let t=this.worldRenderer.playerStateReactive.team,r=e.originalEntity.team,i=r?.nameTagVisibility||"always",s=i==="always"||i==="hideForOwnTeam"&&r?.team!==t?.team||i==="hideForOtherTeams"&&(r?.team===t?.team||t===void 0);e.traverse(o=>{o.name==="nametag"&&(o.visible=s)})}addMapModel(e,t,r){let i=this.cachedMapsImages?.[t],s=null;i&&(s=this.loadMap(i));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),e.add(v);let l=!0;e.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-r*Math.PI/2),v.name=`map_${t}`,s||(v.visible=!1),this.itemFrameMaps[t]||(this.itemFrameMaps[t]=[]),this.itemFrameMaps[t].push(v)}loadMap(e){let t=It(e);return t.needsUpdate=!0,t}addItemModel(e,t,r,i=!1){let s=`bone_${t}item`,o=`custom_item_${t}`;if(e.traverse(v=>{v.name===o&&(v.removeFromParent(),v.additionalCleanup&&v.additionalCleanup())}),!r)return;let a=this.getItemMesh(r,{"minecraft:display_context":"thirdperson"});a?.mesh&&e.traverse(v=>{if(v.name.toLowerCase()===s||v.name===`${t}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)),i&&(l.position.y=-8,l.position.z=5,l.position.x=t==="left"?1:-1,l.rotation.x=Math.PI),l.add(c),l.name=o,v.add(l)}})}handleDamageEvent(e,t){let r=this.entities[e]?.children.find(i=>i.name==="mesh");r&&r.traverse(i=>{if(i instanceof W.Mesh&&i.material.clone){i.material.clone().dispose(),i.material=i.material.clone();let o=i.material.color.clone();i.material.color.set(16711680),new Oe(i.material.color).to(o,500).start()}})}raycastSceneDebug(){let e=new W.Raycaster;return e.setFromCamera(new W.Vector2(0,0),this.worldRenderer.camera),e.intersectObjects(this.worldRenderer.scene.children)[0]?.object}updateEntityModel(e,t,r,i){let s=Array.isArray(t)?t:[{modelPath:t,modelType:r,metadata:i}];this.pendingModelOverrides.set(e,{parts:s});let o=this.entities[e];o&&(this.update({...o.originalEntity,delete:!0},{}),this.update(o.originalEntity,{}))}setupPlayerObject(e,t,r){let i=new Ft;i.realPlayerUuid=e.uuid??"",i.realUsername=e.username??"",i.position.set(0,16,0),Ri(i),t.add(i);let s=1/16;return t.scale.set(s,s,s),t.rotation.set(0,Math.PI,0),i.animation=new I5,i.animation.isMoving=!1,i}updateEntityEquipment(e,t){if(!e||!t.equipment)return;let r=t.type==="player";if(this.addItemModel(e,r?"right":"left",t.equipment[0],r),this.addItemModel(e,r?"left":"right",t.equipment[1],r),F5(this.worldRenderer,e,"feet",t.equipment[2]),F5(this.worldRenderer,e,"legs",t.equipment[3],2),F5(this.worldRenderer,e,"chest",t.equipment[4]),F5(this.worldRenderer,e,"head",t.equipment[5]),r&&e.playerObject){let{playerObject:i}=e;i.backEquipment=t.equipment.some(s=>s?.name==="elytra")?"elytra":"cape",i.backEquipment==="elytra"&&this.loadAndApplyCape(t.id,_3),i.cape.map===null&&(i.cape.visible=!1)}}};function M3(n,e){let t=e?.entitiesByName[n.name];return new Proxy({},{get(r,i,s){if(typeof i!="string"||!t)return;let o=t.metadataKeys?.indexOf(i);return n.metadata?.[o??-1]}})}function O1(n,e,t){if(e.name===n)return M3(e,t)}function F5(n,e,t,r,i=1,s=!1){if(!r){Ii(e,t);return}let o=r.name.split("_"),a,v=t==="head"&&r.name==="player_head";if(v)if(Ii(e,t),r.nbt){let g=Hi.simplify(r.nbt);try{let y;if(g.SkullOwner?y=g.SkullOwner.Properties.textures[0]?.Value:y=g["minecraft:profile"]?.Properties?.find(A=>A.name==="textures")?.value,y){a=JSON.parse(z.from(y,"base64").toString()).textures?.SKIN?.url;let{skinTexturesProxy:b}=n.worldRendererConfig;b&&(a=a?.replace("http://textures.minecraft.net/",b).replace("https://textures.minecraft.net/",b))}}catch{}}else a=$e;let l=o[0];if(!a){let g=`${l}_layer_${i}${s?"_overlay":""}`;a=n.resourcesManager.currentResources.customTextures.armor?.textures[g]?.src??y3[g]}if(!a||!F0[t]){Ii(e,t);return}let c=`geometry_armor_${t}${s?"_overlay":""}`,u=e.children.findLast(g=>g.name===c),h;if(u?(h=u.material,c1(a,g=>{g.magFilter=W.NearestFilter,g.minFilter=W.NearestFilter,g.flipY=!1,g.wrapS=W.MirroredRepeatWrapping,g.wrapT=W.MirroredRepeatWrapping,h.map=g})):(u=D0(n,a,F0[t]),t==="head"&&(u.children[0].position.y+=.01),u.name=c,h=u.material,v||(h.side=W.DoubleSide)),l==="leather"&&!s){let g=r.nbt?.value?.display?.value?.color?.value;if(g){let y=g>>16&255,A=g>>8&255,b=g&255;h.color.setRGB(y/255,A/255,b/255)}else h.color.setHex(11890001);F5(n,e,t,r,i,!0)}else h.color.setHex(16777215);let p=new W.Object3D;p.name=`armor_${t}${s?"_overlay":""}`,p.add(u),e.add(u)}function Ii(n,e){for(let t of n.children)(t.name===`geometry_armor_${e}`||t.name===`geometry_armor_${e}_overlay`)&&t.removeFromParent()}var Oi=async(n,e)=>{let t;if(!n&&!e)t=await k3;else{if(n||(n=await H0(e,"skin")),!n)return;let{canvas:v}=await y0(n);t=new ze.CanvasTexture(v)}t.magFilter=ze.NearestFilter,t.minFilter=ze.NearestFilter;let r=new ze.BoxGeometry,i=new ze.MeshStandardMaterial,s=!1,o=new ze.Mesh(r,i);o.scale.x=s?3:4,o.scale.y=12,o.scale.z=4,tv(r,40,16,s?3:4,12,4),i.map=t,i.needsUpdate=!0;let a=new ze.Group;return a.add(o),a.scale.set(.1,.1,.1),o.rotation.z=Math.PI,a};function ev(n,e,t,r,i,s,o,a){let v=(B,H,G,O)=>[new ze.Vector2(B/o,1-O/a),new ze.Vector2(G/o,1-O/a),new ze.Vector2(G/o,1-H/a),new ze.Vector2(B/o,1-H/a)],l=v(e+s,t,e+r+s,t+s),c=v(e+r+s,t,e+r*2+s,t+s),u=v(e,t+s,e+s,t+s+i),h=v(e+s,t+s,e+r+s,t+s+i),p=v(e+r+s,t+s,e+r+s*2,t+i+s),g=v(e+r+s*2,t+s,e+r*2+s*2,t+i+s),y=n.attributes.uv,A=[p[3],p[2],p[0],p[1]],b=[u[3],u[2],u[0],u[1]],w=[l[3],l[2],l[0],l[1]],S=[c[0],c[1],c[3],c[2]],C=[h[3],h[2],h[0],h[1]],M=[g[3],g[2],g[0],g[1]],I=[];for(let B of[A,b,w,S,C,M])for(let H of B)I.push(H.x,H.y);y.set(new Float32Array(I)),y.needsUpdate=!0}function tv(n,e,t,r,i,s){ev(n,e,t,r,i,s,64,64)}var C3={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]}},z5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new de.Mesh);d(this,"objectOuterGroup",new de.Group);d(this,"objectInnerGroup",new de.Group);d(this,"holdingBlockInnerGroup",new de.Group);d(this,"camera",new de.PerspectiveCamera(75,1,.1,100));d(this,"stopUpdate",!1);d(this,"lastHeldItem");d(this,"lastHeldItemRenderKey");d(this,"isSwinging",!1);d(this,"nextIterStopCallbacks");d(this,"idleAnimator");d(this,"ready",!1);d(this,"lastUpdate",0);d(this,"playerHand");d(this,"offHandDisplay",!1);d(this,"offHandModeLegacy",!1);d(this,"swingAnimator");d(this,"config");d(this,"disposed",!1);d(this,"unsubs",[]);d(this,"lastItemModelName");d(this,"switchRequest",0);this.initCameraGroup(),this.unsubs.push(S3(this.worldRenderer.playerStateReactive,"heldItemMain",()=>{this.offHand||this.updateItem()})),this.unsubs.push(S3(this.worldRenderer.playerStateReactive,"heldItemOff",()=>{this.offHand&&this.updateItem()})),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Oi().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=y1(async()=>Oi(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",i=>{i&&(this.playerHand=i,this.updateItem())},i=>{Re(i,!0)});this.unsubs.push(r)})}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new de.Mesh}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,r,i){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 de.Scene;o.add(this.cameraGroup),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let a=t.getSize(new de.Vector2),v=Math.min(a.width,a.height),l=a.width-v,{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),this.offHandDisplay)t.setViewport(0,0,v,v);else{let u=a.width-v;t.setViewport(u,0,v,v)}t.render(o,this.camera),t.setViewport(0,0,a.width,a.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new ct(()=>({y:this.objectInnerGroup.position.y}),(s,o)=>{s==="y"&&(this.objectInnerGroup.position.y=o)},{y:16})});let t=e,r=this.objectInnerGroup.position.y+this.objectInnerGroup.scale.y*1.5*(t==="appeared"?1:-1),i=!1;return new Promise(s=>{this.blockSwapAnimation.switcher.transitionTo({y:r},t,()=>{i||s(!0)},()=>{i=!0,s(!1)})})}isDifferentItem(e){return this.lastHeldItemRenderKey!==Dt(this.worldRenderer,e)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this;this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation);let t=1,{position:r,scale:i}=this.getHandHeld3d(),s=-r.z,o=this.offHandModeLegacy?-1:1;this.objectOuterGroup.position.set(s*r.x*t*o,s*r.y,-s);let a=i*2.22*.2;this.objectOuterGroup.scale.set(a,a,a)}async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let i=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},w1(this.worldRenderer),!1,this.lastItemModelName);if(i){let{mesh:s,isBlock:o,modelName:a}=i;o?(t=s,e.type="block"):(s.position.set(.5,.5,.5),t=s,e.type="item"),this.lastItemModelName=a}}else t=this.playerHand;if(!t)return;t.name="holdingBlock";let r=this.getHandHeld3d().rotation;return t.rotation.x=de.MathUtils.degToRad(r.x),t.rotation.y=de.MathUtils.degToRad(r.y),t.rotation.z=de.MathUtils.degToRad(r.z),{model:t,type:e.type}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.holdingBlockInnerGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(e){let t=Dt(this.worldRenderer,e),r=this.lastHeldItemRenderKey!==t;if(this.lastHeldItem=e,!r)return;this.lastHeldItemRenderKey=t,this.lastItemModelName=void 0;let i=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0}if(!e){this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(i!==this.switchRequest)return;let o=await this.createItemModel(e);if(!o||i!==this.switchRequest)return;let a=new de.Group;this.holdingBlockInnerGroup.removeFromParent(),this.holdingBlockInnerGroup=new de.Group,this.holdingBlockInnerGroup.add(o.model),a.add(this.holdingBlockInnerGroup),this.holdingBlock=o.model,this.objectInnerGroup=new de.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 de.Group,this.objectOuterGroup.add(this.objectInnerGroup),this.cameraGroup.add(this.objectOuterGroup);let v=this.getHandHeld3d().rotation;this.objectOuterGroup.rotation.y=de.MathUtils.degToRad(v.yOuter),s&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator??(this.swingAnimator=new Fi(this.holdingBlockInnerGroup)),this.swingAnimator.setHandMesh(this.holdingBlockInnerGroup),this.swingAnimator.type=o.type,this.config.viewBobbing&&(this.idleAnimator=new Di(this.holdingBlockInnerGroup,this.worldRenderer.playerStateReactive))}getHandHeld3d(){let e=this.lastHeldItem?.type??"hand",t=this.offHandModeLegacy?"Left":"Right",r=.8*1.15,i={x:.4,y:-.7,z:-.45},s={x:-32.4,y:42.8,z:-41.3,yOuter:0};if(e==="item"){let o=C3[`item${t}`];i={x:-.05,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},r=o.scale[0]*1.15}else if(e==="block"){let o=C3[`block${t}`];i={x:.4,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},r=o.scale[0]*1.15}return{rotation:s,position:i,scale:r}}dispose(){this.disposed=!0,this.ready=!1,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,Re(this.cameraGroup,!0),Re(this.objectOuterGroup,!0),Re(this.objectInnerGroup,!0),Re(this.holdingBlockInnerGroup,!0),this.holdingBlock=void 0,this.playerHand&&(Re(this.playerHand,!0),this.playerHand=void 0)}},Di=class{constructor(e,t){this.handMesh=e;this.playerState=t;d(this,"globalTime",0);d(this,"lastTime",0);d(this,"currentState");d(this,"targetState");d(this,"defaultPosition");d(this,"idleOffset",{y:0,rotationZ:0});d(this,"tween",new Ct);d(this,"idleTween",null);d(this,"stateSwitcher");d(this,"debugParams",{walkingSpeed:8,sprintingSpeed:16,walkingAmplitude:{x:1/30,y:1/10,rotationZ:.25},sprintingAmplitude:{x:1/30,y:1/10,rotationZ:.4}});d(this,"debugGui");d(this,"updated",!1);this.handMesh=e,this.globalTime=0,this.currentState="NOT_MOVING",this.targetState="NOT_MOVING",this.defaultPosition={x:e.position.x,y:e.position.y,z:e.position.z,rotationX:e.rotation.x,rotationY:e.rotation.y,rotationZ:e.rotation.z},this.stateSwitcher=new ct(()=>({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}),(r,i)=>{switch(r){case"x":this.handMesh.position.x=i;break;case"y":this.handMesh.position.y=i;break;case"z":this.handMesh.position.z=i;break;case"rotationX":this.handMesh.rotation.x=i;break;case"rotationY":this.handMesh.rotation.y=i;break;case"rotationZ":this.handMesh.rotation.z=i;break}},{x:2,y:2,z:2,rotation:Math.PI}),this.debugGui=new k0("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 Oe(this.idleOffset,this.tween).to({y:.05,rotationZ:.05},3e3).easing(He.Sinusoidal.InOut).yoyo(!0).repeat(1/0).start()}stopIdleAnimation(){this.idleTween&&(this.idleTween.stop(),this.idleOffset.y=0,this.idleOffset.rotationZ=0)}getStateTransform(e,t){switch(e){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 r=e==="SPRINTING"?this.debugParams.sprintingSpeed:this.debugParams.walkingSpeed,i=e==="SPRINTING"?this.debugParams.sprintingAmplitude:this.debugParams.walkingAmplitude;return{x:this.defaultPosition.x+Math.sin(t*r)*i.x,y:this.defaultPosition.y-Math.abs(Math.cos(t*r))*i.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ}}}}setState(e){if(e===this.targetState)return;this.targetState=e;let t=!1;if(this.currentState!==e){if(this.stopIdleAnimation(),!t){let r=this.getStateTransform(e,this.globalTime);this.stateSwitcher.transitionTo(r,e)}this.currentState=e}}update(){this.stateSwitcher.update();let e=performance.now(),t=(e-this.lastTime)/1e3;if(this.lastTime=e,!this.stateSwitcher.isTransitioning)switch(this.currentState){case"NOT_MOVING":case"SNEAKING":this.globalTime=Math.PI/4;break;case"SPRINTING":case"WALKING":this.globalTime+=t;break}if(this.playerState){let r=this.playerState.movementState;r!==this.targetState&&this.setState(r)}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 r=this.getStateTransform(this.currentState,this.globalTime);Object.assign(this.handMesh.position,r),Object.assign(this.handMesh.rotation,{x:r.rotationX,y:r.rotationY,z:r.rotationZ})}}getCurrentState(){return this.currentState}destroy(){this.stopIdleAnimation(),this.stateSwitcher.forceFinish()}},Fi=class{constructor(e){this.handMesh=e;d(this,"PI",Math.PI);d(this,"animationTimer",0);d(this,"lastTime",0);d(this,"isAnimating",!1);d(this,"stopRequested",!1);d(this,"originalRotation");d(this,"originalPosition");d(this,"originalScale");d(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});d(this,"debugGui");d(this,"type","hand");this.handMesh=e,this.originalRotation=e.rotation.clone(),this.originalPosition=e.position.clone(),this.originalScale=e.scale.clone(),this.debugGui=new k0("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(e){this.handMesh=e,this.originalRotation.copy(e.rotation),this.originalPosition.copy(e.position),this.originalScale.copy(e.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 e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let r=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(r>=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 i=r,s=Math.sqrt(i),o=Math.sin(i*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*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=de.MathUtils.degToRad(this.debugParams.armSwingYRotAmount*a),this.handMesh.rotation.z+=de.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*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=de.MathUtils.degToRad(this.debugParams.itemPreswingRotY),this.handMesh.rotation.x+=de.MathUtils.degToRad(this.debugParams.itemSwingXRotAmount*o),this.handMesh.rotation.y+=de.MathUtils.degToRad(this.debugParams.itemSwingYRotAmount*a),this.handMesh.rotation.z+=de.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 L5(n,e=!1){return n.displayOptions.inWorldRenderingConfig.handRenderer==="legacy"?new z5(n,e):new T5(n,e)}E();x();k();R();import*as Qe from"three";import{Vec3 as zi}from"vec3";var B3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAALUlEQVR42mP4//8/IyWYYdSAwW6Ara3tf4oMmD179n9ChhD0AsiQ0Wgc7AYAAOqH+zNQ3r9kAAAAAElFTkSuQmCC";var P3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOklEQVR42mP4//8/IyWYYdQA3AbY2tr+H1gDZs+e/R9mCD7D8IYBzBAQTXYgEvIKQQPw2T6aEqlkAADEA/W3ycLXvwAAAABJRU5ErkJggg==";var I3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQklEQVR42mP4//8/IyWYYRgbYGtr+39wGQDiYzMUpwGzZ8+GawDRID4IkxSIMEOwaSQ6FgiFBW0NIOR8osJgBOQFALo37sVTOo/LAAAAAElFTkSuQmCC";var H3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWElEQVR42mP4//8/IyWYYXAbYGtr+59sA0CaZ8+eTZkBhNg4DQApQlYIcglMDN1VWA0AKYJpQvYONi/hDUSYIfjCgmA0EooJ2hmAK9CINgBXoA2xvEAMBgBGPud3dYZtOQAAAABJRU5ErkJggg==";var O3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVR42r1TQQrAMAxyD8tL89iMHgQJoQxHewi0UsWYFFX1/CkcF4iIsgUWOTM9ASV3F3rHF+v9rK4wEVnEFoFYbwmTbRZFFN9m0B9QZBfk2THaAhqktQdTkHYL9iZe+40vs7nda+BuVOMAAAAASUVORK5CYII=";var D3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR42rWTWwpAIQhEbWGu1MUaXRgQcXpyP8SIPI1jibu3l5DfAKrqyFgfAczsKxx5xJUCFGYFUZXMpOe9CAa8BOS+0U5UVbYQ6Siqbi0BFT0auTSRHZqNkE6BGXgEYKYtAczIbQAz8ukzXT3l3egz49IXvXQCVAAAAABJRU5ErkJggg==";var F3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeElEQVQ4jaWSQQ4AIQgD9WG8tI/tnkgaUgmuBw8YHcqERXK/nOUuI4JPAABMSESwA1qAQgAQwBygnfNjTaCpWoBzUlNZQJ07x9FUdgSlV5FaW4Cjq8isW8BJ2GgPtEuVdr0HKvLXHjiRI0An8jTKqo9dF000cnBzPgKuxXtbq/m1AAAAAElFTkSuQmCC";var z3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVR42qWTSRKAMAgE8WF5KY/FygEL2yEp9cAhCz0wJBYRx58wbowxYsZngLvHjITsgNYpJySBrPIBUMqZSHhdSw+oQlgVa01U7VRQ7huTk67aUWZaVyaNZFsSQBCTVBW3KahLyo/lQ6KR1Y+2BTUyGqke1AXoxsSzpYlU3FW0/Exv1ie0hq53Bf15aAAAAABJRU5ErkJggg==";var L3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmklEQVR42o2SYQ6FMAiDeQfbSXdYXjSpqd869QeZQiilpbr7l2KM0cc75+xUV77YpGCjAPUqitMU3uCAXrsAlPSCcgJMbG4M0mQ1Etz/i0KlXQnmwyqpv1uH4h7fiws7ISneTYNEk0ImCxcAArGJrE4AXhypPtl7AqTdeJG8k3gHb0L6QfmK9WQTa59cSFdHRssKFHHngteV/wPDepaHIu0QVAAAAABJRU5ErkJggg==";var U3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVR42n2Tyw3AIAxD3cGYlGFTUSmV+2o4IEEAf2JQVV1rjDGq576ec5avWVdfWIW12aMPEJBEImoPv+CAvvcCODsVNWBS8wA4A5ndv1/ytciQvBLMyeTSHD3ZYXPXXH7Y0ZMdJvCxQJls5O6tKHlPPWGEfU58WZR6ive1kKSleFNC2kXGRnrcDqhTTOmPeP3pAZnTq6Oin4X0oXbfnNZu626Io6lqGCwAAAAASUVORK5CYII=";var z1=class{constructor(e){this.worldRenderer=e;d(this,"_cursorLinesHidden",!1);d(this,"cursorLineMaterial");d(this,"interactionLines",null);d(this,"prevColor");d(this,"blockBreakMesh");d(this,"breakTextures",[]);let t=[B3,P3,I3,H3,O3,D3,F3,z3,L3,U3];for(let i=0;i<10;i++)Pt(t[i]).then(s=>{s.magFilter=Qe.NearestFilter,s.minFilter=Qe.NearestFilter,this.breakTextures.push(s)});let r=new Qe.MeshBasicMaterial({transparent:!0,blending:Qe.MultiplyBlending,alphaTest:.5});this.blockBreakMesh=new Qe.Mesh(new Qe.BoxGeometry(1,1,1),r),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(e){this.interactionLines&&(this.interactionLines.mesh.visible=!e),this._cursorLinesHidden=e}updateLineMaterial(){let e=this.worldRenderer.playerStateReactive.gameMode==="creative",t=this.worldRenderer.renderer.getPixelRatio();this.cursorLineMaterial&&this.cursorLineMaterial.dispose(),this.cursorLineMaterial=new ht({color:(()=>{switch(this.worldRenderer.worldRendererConfig.highlightBlockColor){case"blue":return 4227327;case"classic":return 0;default:return e?4227327:0}})(),linewidth:Math.max(t*.7,1)*2}),this.prevColor=this.worldRenderer.worldRendererConfig.highlightBlockColor}updateBreakAnimation(e,t,r){if(this.hideBreakAnimation(),t===null||!e||!r)return;let{position:i,width:s,height:o,depth:a}=r,v=new zi(i.x,i.y,i.z);this.blockBreakMesh.scale.set(s*1.001,o*1.001,a*1.001),v.add(new zi(e.x,e.y,e.z)),this.blockBreakMesh.position.set(v.x,v.y,v.z),this.blockBreakMesh.visible=!0,this.blockBreakMesh.material.map=this.breakTextures[t]??this.breakTextures.at(-1),this.blockBreakMesh.material.needsUpdate=!0}hideBreakAnimation(){this.blockBreakMesh&&(this.blockBreakMesh.visible=!1)}updateDisplay(){if(this.cursorLineMaterial){let{renderer:e}=this.worldRenderer;this.cursorLineMaterial.resolution.set(e.domElement.width,e.domElement.height),this.cursorLineMaterial.dashOffset=performance.now()/750}}setHighlightCursorBlock(e,t,r=!1){if(e&&this.interactionLines&&e.equals(this.interactionLines.blockPos)&&uv(t??[],this.interactionLines.shapePositions??[])&&!r||(this.interactionLines!==null&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.interactionLines.mesh),this.interactionLines=null),e===null))return;let i=new Qe.Group;for(let{position:s,width:o,height:a,depth:v}of t??[]){let l=new zi(s.x,s.y,s.z),c=[1.0001*o,1.0001*a,1.0001*v],u=new Qe.BoxGeometry(...c),h=new ft().fromEdgesGeometry(new Qe.EdgesGeometry(u)),p=new O5(h,this.cursorLineMaterial);p.position.set(l.x,l.y,l.z),p.computeLineDistances(),i.add(p)}this.worldRenderer.sceneOrigin.addAndTrack(i),i.position.set(e.x,e.y,e.z),i.visible=!this.cursorLinesHidden,this.interactionLines={blockPos:e,mesh:i,shapePositions:t}}render(){this.prevColor!==this.worldRenderer.worldRendererConfig.highlightBlockColor&&this.updateLineMaterial(),this.updateDisplay()}},uv=(n,e)=>{if(n.length!==e.length)return!1;for(let[t,r]of n.entries())if(r!==e[t])return!1;return!0};E();x();k();R();E();x();k();R();var fv=o5(yi(),1);import G3 from"prismarine-nbt";import{getItemDefinition as hv}from"mc-assets/dist/itemDefinitions";var mv=(n,e)=>{let t,r,i=n.name;i.includes(":")||(i=`minecraft:${i}`);let s=e.currentResources?.customItemModelNames[i];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&&(t=typeof a.data=="string"?a.data:G3.simplify(a.data));let v=o.get("item_model");if(v&&(r=v.data),s){let c=o.get("custom_model_data");if(c?.data){let u;typeof c.data=="number"?u=c.data:typeof c.data=="object"&&"floats"in c.data&&Array.isArray(c.data.floats)&&c.data.floats.length>0&&(u=c.data.floats[0]),u&&s[u]&&(r=s[u])}}let l=o.get("lore");l&&(t??(t=n.displayName??n.name),t+=`
|
|
21459
|
+
${JSON.stringify(l.data)}`)}if(n.nbt){let o=G3.simplify(n.nbt),a=o.display?.Name;a&&(t=a),s&&o.CustomModelData&&s[o.CustomModelData]&&(r=s[o.CustomModelData])}return{customText:t,customModel:r}};var V3=(n,e,t,r)=>{let i=n.name,{customModel:s}=mv(n,t);s&&(i=s);let o=us(r,{...e}),a=t.currentResources,v=hv(es(a),{name:i,version:a.version,properties:o})?.model;return(v==="minecraft:special"?void 0:v)??i};E();x();k();R();var K3=o5(Y3(),1);import{versionToNumber as Q3}from"mc-assets/dist/utils";var J3=(n,e,t=!1,r=!1)=>{let i=n.modelName,s=globalThis.loadedData.itemsByName[i];Q3(e.currentResources.version)<Q3("1.13")&&(i=(0,K3.getRenamedData)(s?"items":"blocks",i,e.currentResources.version,"1.13.1"));let o;if(!r){let v=e.currentResources?.guiAtlas?.json,l=u=>u&&v?.textures[u.replace("minecraft:","").replace("block/","").replace("blocks/","").replace("item/","").replace("items/","").replace("_inventory","")],c=l(i)??l(n.originalItemName);if(c){let u=c.u*v.width,h=c.v*v.height;return{texture:"gui",slice:[u,h,v.tileSize,v.tileSize],scale:.25,blockData:null,modelName:null}}}let a=v=>v.top??v;try{if(!e.currentResources?.itemsRenderer)throw new Error("Items renderer is not available");o=e.currentResources.itemsRenderer.getItemTexture(i,{},!1,r)??(n.originalItemName?e.currentResources.itemsRenderer.getItemTexture(n.originalItemName,{},!1,r):void 0)??e.currentResources.itemsRenderer.getItemTexture("item/missing_texture")}catch(v){reportError?.(`Failed to render item ${i} (original: ${n.originalItemName}) on ${e.currentResources.version} (resourcepack: TODO!): ${v.stack}`),o=a(e.currentResources.itemsRenderer.getItemTexture("errored"))}return o??(o=a(e.currentResources.itemsRenderer.getItemTexture("unknown"))),"type"in o?{texture:o.type,slice:o.slice,modelName:i,blockData:null,scale:null}:{texture:"blocks",blockData:o,modelName:i,slice:null,scale:null}};var q3=(n,e,t,r)=>{let i=t.currentResources;if(!i)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=V3({...n,name:a},e,t,r),l=J3({modelName:v},t,!1,!0);if(!l)throw new Error(`Failed to get render info for item ${a}`);let c=l.texture==="blocks"?i.blocksAtlasImage:i.itemsAtlasImage;if(l.blockData)return{resolvedModel:l.blockData.resolvedModel,modelName:l.modelName};if(l.slice){let[u,h,p,g]=l.slice,[y,A,b,w]=[u/c.width,h/c.height,p/c.width,g/c.height];return{u:y,v:A,su:b,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/i.blocksAtlasImage.width,sv:16/i.blocksAtlasImage.width,modelName:"missing"}}};E();x();k();R();import*as Qt from"three";var U1=class{constructor(e){this.worldRenderer=e;d(this,"audioListener");d(this,"activeSounds",new Set);d(this,"audioContext");d(this,"soundVolumes",new Map);d(this,"baseVolume",1);e.onWorldSwitched.push(()=>{this.stopAll()}),e.onReactiveConfigUpdated("volume",t=>{this.changeVolume(t)})}initAudioListener(){this.audioListener||(this.audioListener=new Qt.AudioListener,this.worldRenderer.camera.add(this.audioListener))}playSound(e,t,r=1,i=1,s=500){this.initAudioListener();let o=new Qt.PositionalAudio(this.audioListener);this.activeSounds.add(o),this.soundVolumes.set(o,r);let a=new Qt.AudioLoader,v=Date.now();a.loadAsync(t).then(l=>{Date.now()-v>s||(o.setBuffer(l),o.setRefDistance(20),o.setVolume(r*this.baseVolume),o.setPlaybackRate(i),this.worldRenderer.sceneOrigin.addAndTrack(o),o.position.set(e.x,e.y,e.z),o.onEnded=()=>{this.worldRenderer.sceneOrigin.removeAndUntrack(o),o.source&&o.disconnect(),this.activeSounds.delete(o),this.soundVolumes.delete(o),a.manager.itemEnd(t)},o.play())})}stopAll(){for(let e of this.activeSounds)e&&(e.stop(),e.source&&e.disconnect(),this.worldRenderer.sceneOrigin.removeAndUntrack(e));this.activeSounds.clear(),this.soundVolumes.clear()}changeVolume(e){this.baseVolume=e;for(let[t,r]of this.soundVolumes)t.setVolume(r*this.baseVolume)}destroy(){this.stopAll(),this.audioListener&&(this.audioListener.removeFromParent(),this.audioListener=void 0)}playTestSound(){this.playSound(this.worldRenderer.camera.position,"/sound.mp3")}};E();x();k();R();import*as Le from"three";var G1=class{constructor(e,t){this.worldRenderer=e;this.onRenderCallbacks=t;d(this,"rollAngle",0);d(this,"rollAnimation");d(this,"basePitch",0);d(this,"baseYaw",0);d(this,"cameraBobInput",null);t.push(()=>{this.update()})}get damageRollAmount(){return 5}get damageAnimDuration(){return 200}setCameraBobInput(e){this.cameraBobInput=e}setBaseRotation(e,t){this.basePitch=e,this.baseYaw=t,this.update()}getBaseRotation(){return{pitch:this.basePitch,yaw:this.baseYaw}}shakeFromDamage(e){let t=this.rollAngle,r=t+(e??(Math.random()<.5?-1:1))*this.damageRollAmount;this.rollAnimation={startTime:performance.now(),startRoll:t,targetRoll:r,duration:this.damageAnimDuration/2}}update(){if(this.worldRenderer.playerStateUtils.isSpectatingEntity()&&(this.rollAngle=0,this.rollAnimation=void 0),this.rollAnimation){let t=performance.now(),r=t-this.rollAnimation.startTime,i=Math.min(r/this.rollAnimation.duration,1);this.rollAnimation.returnToZero?(this.rollAngle=this.rollAnimation.startRoll*(1-this.easeInOut(i)),i===1&&(this.rollAnimation=void 0)):(this.rollAngle=this.rollAnimation.startRoll+(this.rollAnimation.targetRoll-this.rollAnimation.startRoll)*this.easeOut(i),i===1&&(this.rollAnimation={startTime:t,startRoll:this.rollAngle,targetRoll:0,duration:this.damageAnimDuration/2,returnToZero:!0}))}let e=this.worldRenderer.cameraObject;if(this.worldRenderer.cameraGroupVr){let t=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(0,1,0),this.baseYaw);e.setRotationFromQuaternion(t)}else{let t=this.addAntiZfightingOffset(this.basePitch),r=this.addAntiZfightingOffset(this.baseYaw),i=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(1,0,0),t),s=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(0,1,0),r),o=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(0,0,1),Le.MathUtils.degToRad(this.rollAngle)),a=new Le.Quaternion,v=new Le.Quaternion,l=this.worldRenderer.playerStateReactive.perspective;if(this.cameraBobInput){let u=_1(this.cameraBobInput);a=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(0,0,1),u.rotation.z),v=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(1,0,0),u.rotation.x),l==="first_person"&&this.worldRenderer.camera.position.set(u.position.x,u.position.y,0)}else l==="first_person"&&this.worldRenderer.camera.position.set(0,0,0);let c=s.multiply(i).multiply(o).multiply(a).multiply(v);e.setRotationFromQuaternion(c)}}easeOut(e){return 1-(1-e)*(1-e)}easeInOut(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}addAntiZfightingOffset(e){let r=(e%(Math.PI*2)+Math.PI*2)%(Math.PI*2),i=.01;return Math.abs(r)<i||Math.abs(r-Math.PI/2)<i||Math.abs(r-Math.PI)<i||Math.abs(r-3*Math.PI/2)<i?e+.001:e}};E();x();k();R();import*as K from"three";var V1=class{constructor(e){this.worldRenderer=e;d(this,"customMedia",new Map);d(this,"lastCheck",0);d(this,"THROTTLE_TIME",100);this.worldRenderer.onWorldSwitched.push(()=>{this.onWorldGone()}),this.worldRenderer.onRender.push(()=>{this.render()}),this.worldRenderer.onReactiveConfigUpdated("volume",()=>{let{volume:t}=this.worldRenderer.worldRendererConfig;for(let[r,i]of this.customMedia.entries())i.positionalAudio&&i.positionalAudio.setVolume((i.props.volume??1)*t)})}onWorldGone(){for(let[e,t]of this.customMedia.entries())this.destroyMedia(e)}onWorldStop(){for(let[e,t]of this.customMedia.entries())this.setVideoPlaying(e,!1)}createErrorTexture(e,t,r=16777215,i="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(${r>>16&255}, ${r>>8&255}, ${r&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(i,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(e,t,r=0,i=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=r>>16&255,v=r>>8&255,l=r&255;o.fillStyle=`rgba(${a}, ${v}, ${l}, ${i})`,o.fillRect(0,0,1,1);let c=new K.CanvasTexture(s);return c.minFilter=K.NearestFilter,c.magFilter=K.NearestFilter,c}validateOrigin(e,t){if(t===!0)return!0;if(t===!1)return!1;let r=new URL(e);return t.some(i=>r.origin.endsWith(i))}onPageInteraction(){for(let[e,t]of this.customMedia.entries())t.hadAutoPlayError&&(t.hadAutoPlayError=!1,this.playVideo(e))}addMedia(e,t){let r=structuredClone(t);this.destroyMedia(e);let i=!1;t.src.startsWith("https://disk.yandex.ru/i/")&&(i=!0,t.src=`/ya-image?url=${t.src}`);let{scene:s}=this.worldRenderer;t.allowOrigins!==void 0&&!this.validateOrigin(t.src,t.allowOrigins)&&(t.src="");let a=t.src.endsWith(".png")||t.src.endsWith(".jpg")||t.src.endsWith(".jpeg")||t.imageOverride;i&&!t.imageOverride&&fetch(t.src,{method:"HEAD"}).then(M=>{M.headers.get("content-type")?.startsWith("image/")&&(this.destroyMedia(e),this.addMedia(e,{...r,src:t.src,imageOverride:!0}))}).catch(console.error);let v,l,c=ae&&!a;if(!a&&!c){v=document.createElement("video"),v.src=t.src.endsWith(".gif")?t.src.replace(".gif",".mp4"):t.src,v.loop=t.loop??!0;let M=(t.volume??1)*this.worldRenderer.worldRendererConfig.volume;v.volume=Math.min(M,1),v.playsInline=!0,v.crossOrigin="anonymous";let I=this.worldRenderer.soundSystem;if(I.initAudioListener(),!I.audioListener)throw new Error("Audio listener not initialized");l=new K.PositionalAudio(I.audioListener),l.setRefDistance(6),l.setVolume(M),this.worldRenderer.sceneOrigin.addAndTrack(l),l.position.set(t.position.x,t.position.y,t.position.z),l.setMediaElementSource(v),l.connect(),v.addEventListener("pause",()=>{l?.pause(),globalThis.tempSendVideoStop?.(e,"paused",v.currentTime)}),v.addEventListener("play",()=>{l?.play(),globalThis.tempSendVideoPlay?.(e)}),v.addEventListener("seeked",()=>{l&&v&&(l.offset=v.currentTime)}),v.addEventListener("stalled",()=>{globalThis.tempSendVideoStop?.(e,"stalled",v.currentTime)}),v.addEventListener("waiting",()=>{globalThis.tempSendVideoStop?.(e,"waiting",v.currentTime)}),v.addEventListener("error",({error:B})=>{globalThis.tempSendVideoStop?.(e,`error: ${B}`,v.currentTime)}),v.addEventListener("ended",()=>{globalThis.tempSendVideoStop?.(e,"ended",v.currentTime),t.loop||(v.currentTime=0,C.ended=!0)})}let u=this.createBackgroundTexture(t.size.width,t.size.height,t.background),h=M=>{let I=this.createErrorTexture(t.size.width,t.size.height,t.background,M);y.map=I,y.needsUpdate=!0},p=new K.PlaneGeometry(1,1),g=t.allowLighting?K.MeshLambertMaterial:K.MeshBasicMaterial,y=new g({map:u,transparent:!0,side:t.doubleSide?K.DoubleSide:K.FrontSide,alphaTest:.1}),A;if(v)A=new K.VideoTexture(v);else if(c)A=this.createErrorTexture(t.size.width,t.size.height,t.background,"Video unavailable (multi-thread)");else if(ae){let M=b5(t.src);A=M.texture,A.minFilter=K.NearestFilter,A.magFilter=K.NearestFilter,M.promise.then(()=>{this.customMedia.get(e)?.texture===A&&(y.map=A,y.needsUpdate=!0)}).catch(()=>h())}else A=new K.TextureLoader().load(t.src,()=>{this.customMedia.get(e)?.texture===A&&(y.map=A,y.needsUpdate=!0)},void 0,()=>h());A.minFilter=K.NearestFilter,A.magFilter=K.NearestFilter,A.generateMipmaps=!1;let b=new K.Mesh(p,y),{mesh:w}=this.positionMeshExact(b,K.MathUtils.degToRad((t.rotation??0)*90),t.position,t.size.width,t.size.height);s.add(w),v&&(b.onBeforeRender=()=>{v.readyState===v.HAVE_ENOUGH_DATA&&(!v.paused||!C?.hadAutoPlayError)&&(y.map!==A&&(y.map=A,y.needsUpdate=!0),A.needsUpdate=!0,l&&(l.position.copy(w.position),l.rotation.copy(w.rotation)))});let S=M=>{let I=p.attributes.uv.array;I[0]=M.startU,I[1]=M.startV,I[2]=M.endU,I[3]=M.startV,I[4]=M.endU,I[5]=M.endV,I[6]=M.startU,I[7]=M.endV,p.attributes.uv.needsUpdate=!0};t.uvMapping&&S(t.uvMapping);let C={mesh:w,video:v,texture:A,updateUVMapping:S,positionalAudio:l,props:r,hadAutoPlayError:!1,pausedBecuaseHidden:!1,ended:!1,handleError(M){if(C.destroyed)return;let I=B=>B;h(M.name==="NotAllowedError"||M.name==="AbortError"?I("Waiting for user interaction"):I("Failed to auto play"))}};return this.customMedia.set(e,C),v&&t.autoPlay&&this.playVideo(e,!0),e}playVideo(e,t=!1){let r=this.customMedia.get(e);if(r?.video){if(!t&&r.positionalAudio&&r.video.currentTime<1){let i=r.video.currentTime;this.addMedia(e,r.props),r.video.currentTime=i,r.props.autoPlay||this.playVideo(e,!0);return}r.video.play().then(()=>{r.hadAutoPlayError=!1}).catch(i=>{r.pausedBecuaseHidden||((i.name==="NotAllowedError"||i.name==="AbortError"||i.message?.includes("not allowed")&&!r.pausedBecuaseHidden)&&(r.hadAutoPlayError=!0),r.handleError(i))})}}render(){for(let[e,t]of this.customMedia.entries()){let r=t.mesh.visible;t.mesh.visible=this.worldRenderer.shouldObjectVisible(t.mesh)&&!t.mesh.forceHide,r!==t.mesh.visible&&t.video&&(t.mesh.visible?t.pausedBecuaseHidden&&(this.playVideo(e),t.pausedBecuaseHidden=!1):t.video.paused||(t.video.pause(),t.pausedBecuaseHidden=!0))}}setVideoPlaying(e,t){let r=this.customMedia.get(e);r?.video&&(t?this.playVideo(e):r.video.pause())}setVideoSeeking(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.currentTime=t)}setVideoVolume(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.volume=t)}setVideoSpeed(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.playbackRate=t)}setControlMode(e,t,r){let i=this.customMedia.get(e);i?.video&&(i.props.controlMode={mouseButton:t,controlMode:r})}destroyMedia(e){let{scene:t}=this.worldRenderer,r=this.customMedia.get(e);if(r){r.destroyed=!0,r.video&&(r.video.pause(),r.video.src="",r.video.remove()),r.positionalAudio&&this.worldRenderer.sceneOrigin.removeAndUntrack(r.positionalAudio),this.worldRenderer.sceneOrigin.removeAndUntrack(r.mesh),r.texture.dispose();let i=r.mesh.children[0];i&&(i.geometry.dispose(),i.material instanceof K.Material&&i.material.dispose()),this.customMedia.delete(e)}}positionMeshExact(e,t,r,i,s,o=1){t===0&&(r.z+=.001),t===Math.PI/2&&(r.x-=.001),t===Math.PI&&(r.z-=.001),t===3*Math.PI/2&&(r.x+=.001),t===0&&(r.z+=1),t===Math.PI&&(r.x+=1),t===3*Math.PI/2&&(r.z+=1,r.x+=1),e.matrix.identity(),e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1),e.rotateY(t),(t===Math.PI/2||t===3*Math.PI/2)&&(e.rotateZ(-Math.PI),e.rotateX(-Math.PI)),e.scale.set(i,s,o),e.geometry.translate(.5,.5,0),e.geometry.attributes.position.needsUpdate=!0,this.worldRenderer.sceneOrigin.track(e),e.position.set(r.x,r.y,r.z);let a=new K.Group;a.add(e);let v=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711680}));v.position.set(r.x,r.y,r.z),a.add(v);let l=r.x+Math.cos(t)*i,c=r.z+Math.sin(t)*i,u=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:255}));u.position.set(r.x,r.y+s,r.z),a.add(u);let h=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16776960}));h.position.set(l,r.y,c),a.add(h);let p=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711935}));p.position.set(l,r.y+s,c),a.add(p);let g=new K.Vector3(this.worldRenderer.sceneOrigin.toSceneX(r.x),this.worldRenderer.sceneOrigin.toSceneY(r.y),this.worldRenderer.sceneOrigin.toSceneZ(r.z)),y=new K.ArrowHelper(new K.Vector3(Math.cos(t),0,Math.sin(t)),g,1,16711680);return a.add(y),{mesh:e,debugGroup:a}}createTestCanvasTexture(){let e=new OffscreenCanvas(100,100);e.width=100,e.height=100;let t=e.getContext("2d");return t?(t.font="10px Arial",t.fillStyle="red",t.fillText("Hello World",0,10),new K.CanvasTexture(e)):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:e,scene:t}=this.worldRenderer,r=new K.Raycaster,i=new K.Vector2(0,0);r.setFromCamera(i,e);let s=r.intersectObjects(t.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 u={id:v,x:c.x,y:c.y};this.worldRenderer.reactiveState.world.intersectMedia=u,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(e){let t=this.worldRenderer.reactiveState.world.intersectMedia;if(t){let{id:r,x:i,y:s}=t,o=this.customMedia.get(r),a=o?.props.controlMode;if(o?.video&&(a?.mouseButton==="both"||a?.mouseButton===e))switch(a?.controlMode){case"play_pause":{this.setVideoPlaying(r,o.video.paused);break}case"play_if_ended":{o.ended&&this.setVideoPlaying(r,!0);break}case"toggle_mute":{o.video.muted=!o.video.muted;break}}}}};E();x();k();R();import*as L0 from"three";E();x();k();R();import*as ke from"three";var _v=1,Z3=10,p0={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 $3(n){let e=n.color??16711680,t=n.depthTest??!1,r=n.visualScale??n.metadata?.visualScale??(typeof window>"u"?void 0:window.serverMetadata?.waypointVisualScale)??p0.DEFAULT_VISUAL_SCALE,i=n.opacity??n.metadata?.opacity??(typeof window>"u"?void 0:window.serverMetadata?.waypointOpacity)??p0.DEFAULT_OPACITY,s=We(X3(),X3());N1(s,e,n.label??"","0m",r);let o=new ke.CanvasTexture(s);o.anisotropy=1,o.magFilter=ke.LinearFilter,o.minFilter=ke.LinearFilter;let a=new ke.SpriteMaterial({map:o,transparent:!0,opacity:1,depthTest:t,depthWrite:!1}),v=new ke.Sprite(a);v.position.set(0,0,0),v.renderOrder=10,v.material.opacity=i;let l=n.label??"",c="0m",u=Number.NaN,h,p,g,y,A=null,b=p0.ARROW.enabledDefault,w=new ke.Group;w.add(v);let{x:S,y:C,z:M}=n.position;w.position.set(S,C,M);function I(){o.needsUpdate=!0}function B(){if(!p||!g)return;let Y=p.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 oe=`#${e.toString(16).padStart(6,"0")}`;g.lineWidth=6,g.strokeStyle="black",g.stroke(),g.fillStyle=oe,g.fill(),y&&(y.needsUpdate=!0)}function H(Y){e=Y,c="0m",u=0,N1(s,e,l,"0m",r),I(),h&&B()}function G(Y){l=Y??"",N1(s,e,l,c,r),I()}function O(Y,oe){oe!==c&&(c=oe,N1(s,e,Y,oe,r),I())}function j(Y){v.visible=Y}function J(Y,oe,xe){w.position.set(Y,oe,xe)}function q(Y,oe,xe,Je){let Ve=oe*Math.PI/180,_e=Math.tan(Ve/2)*2*xe*(p0.TARGET_SCREEN_PX*r/Je);v.scale.set(_e,_e,1)}function $(){if(h)return;let Y=128;p=We(Y,Y),g=p.getContext("2d"),B(),y=new ke.CanvasTexture(p),y.anisotropy=1,y.magFilter=ke.LinearFilter,y.minFilter=ke.LinearFilter;let oe=new ke.SpriteMaterial({map:y,transparent:!0,depthTest:!1,depthWrite:!1,opacity:i});h=new ke.Sprite(oe),h.renderOrder=12,h.visible=!1,A&&A.add(h)}function ue(Y){b=Y,!Y&&h&&(h.visible=!1)}function le(Y){h?.parent&&h.parent.remove(h),A=Y,h&&Y&&Y.add(h)}function ce(Y,oe,xe){if(!b||($(),!h))return!0;let Je=n.metadata?.onlyLeftRight===!0,Ve=new ke.Vector3;Y.getWorldDirection(Ve);let n0=Y.up.clone().normalize(),_e=new ke.Vector3().copy(Ve).cross(n0).normalize(),f0=new ke.Vector3().copy(_e).cross(Ve).normalize(),r5=new ke.Vector3().setFromMatrixPosition(Y.matrixWorld),i5=new ke.Vector3(w.position.x,w.position.y,w.position.z).sub(r5),N0=i5.dot(Ve),S0=i5.dot(_e),W0=i5.dot(f0),Q5=oe/xe,j0=Y.fov*Math.PI/180,Et=2*Math.atan(Math.tan(j0/2)*Q5),K5=Math.atan2(S0,N0),J5=Math.atan2(W0,N0);if(N0>0&&Math.abs(K5)<=Et/2&&Math.abs(J5)<=j0/2)return h.visible=!1,!0;let qe=K5/(Et/2),Me=J5/(j0/2);N0<=0&&(Math.abs(qe)>Math.abs(Me)?(qe=Math.sign(qe),Me=0):(qe=0,Me=Math.sign(Me))),Je&&(Math.abs(qe)>Math.abs(Me)||(qe=qe>=0?1:-1),Me=0);let xt=Math.max(Math.abs(qe),Math.abs(Me))||1,n5=qe/xt,s0=Me/xt,Rt=p0.ARROW.paddingPx,_=(n5+1)*.5*oe,f=(1-s0)*.5*xe,m=Math.min(Math.max(_,Rt),oe-Rt),T=Math.min(Math.max(f,Rt),xe-Rt);n5=m/oe*2-1,s0=-(T/xe)*2+1;let P=Math.max(2,Y.near*4),F=Math.tan(j0/2)*P,V=F*Q5,ie=r5.clone().add(Ve.clone().multiplyScalar(P)).add(_e.clone().multiplyScalar(n5*V)).add(f0.clone().multiplyScalar(s0*F));h.visible=!0,h.position.copy(ie);let pe=Math.atan2(Me,qe);h.material.rotation=pe-Math.PI/2;let me=Math.tan(j0/2)*2*P*(p0.ARROW.pixelSize*r/xe);return h.scale.set(me,me,1),!1}function Ee(Y){return Y.distanceTo(w.position)}function Ie(Y,oe,xe,Je){let Ve=Ee(Y);q(Y,oe.fov,Ve,Je);let n0=Math.round(Ve/Z3)*Z3;n0!==u&&(u=n0,O(l,`${Math.max(0,n0)}m`));let _e=ce(oe,xe,Je);return j(_e),_e}function se(){let Y=v.material;if(Y.map?.dispose(),Y.dispose(),h){h.parent&&h.parent.remove(h);let oe=h.material;oe.map?.dispose(),oe.dispose()}h=void 0,p=void 0,g=void 0,y=void 0}return{group:w,sprite:v,enableOffscreenArrow:ue,setArrowParent:le,updateForCamera:Ie,setColor:H,setLabel:G,updateDistanceText:O,setVisible:j,setPosition:J,dispose:se}}function ea(){let n=globalThis.devicePixelRatio||1,e=Math.min(n,_v);return p0.CANVAS_SCALE*e}function X3(){return Math.round(p0.CANVAS_SIZE*ea())}function N1(n,e,t,r,i){let s=n.width,o=ea(),a=n.getContext("2d");a.clearRect(0,0,s,s);let v=s/2,l=Math.round(s*p0.LAYOUT.DOT_Y),c=Math.round(s*.05*i),u=Math.max(2,Math.round(4*o*i)),h=c+u;a.beginPath(),a.arc(v,l,h,0,Math.PI*2),a.fillStyle=`#${e.toString(16).padStart(6,"0")}`,a.fill(),a.textAlign="center",a.textBaseline="middle";let p=Math.round(s*.08*i),g=Math.round(s*.06*i);a.font=`800 ${p}px mojangles`,a.lineWidth=Math.max(2,Math.round(3*o*i));let y=Math.round(s*p0.LAYOUT.NAME_Y);a.strokeStyle="black",a.strokeText(t,v,y),a.fillStyle="white",a.fillText(t,v,y),a.font=`800 ${g}px mojangles`,a.lineWidth=Math.max(2,Math.round(2*o*i));let A=Math.round(s*p0.LAYOUT.DISTANCE_Y);a.strokeStyle="black",a.strokeText(r,v,A),a.fillStyle="#CCCCCC",a.fillText(r,v,A)}var W1=class{constructor(e){this.worldRenderer=e;d(this,"waypoints",new Map);d(this,"waypointScene",new L0.Scene);d(this,"lastCameraPosition",new L0.Vector3);d(this,"lastUpdateTime",0);d(this,"UPDATE_THROTTLE_MS",16)}updateWaypoints(){let e=performance.now(),t=this.worldRenderer.getCameraPosition(),r=this.lastCameraPosition.distanceTo(t)>.5,i=e-this.lastUpdateTime>this.UPDATE_THROTTLE_MS;if(!r&&!i)return;this.lastCameraPosition.copy(t),this.lastUpdateTime=e;let s=this.worldRenderer.renderer.getSize(new L0.Vector2);for(let o of this.waypoints.values()){let a=new L0.Vector3(o.x,o.y,o.z),v=t.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(e,t,r,i,s={}){this.removeWaypoint(e);let o=s.color??16711680,{label:a,metadata:v}=s,l=s.minDistance??0,c=s.maxDistance??1/0,u=$3({position:new L0.Vector3(t,r,i),color:o,label:a||e,metadata:v});u.enableOffscreenArrow(!0),u.setArrowParent(this.waypointScene),this.waypointScene.add(u.group),this.waypoints.set(e,{id:e,x:t+.5,y:r+.5,z:i+.5,minDistance:l,maxDistance:c,color:o,label:a,sprite:u})}removeWaypoint(e){let t=this.waypoints.get(e);t&&(this.waypointScene.remove(t.sprite.group),t.sprite.dispose(),this.waypoints.delete(e))}clear(){for(let e of this.waypoints.keys())this.removeWaypoint(e)}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(e){return this.waypoints.get(e)}getAllWaypoints(){return[...this.waypoints.values()]}setWaypointColor(e,t){let r=this.waypoints.get(e);r&&(r.sprite.setColor(t),r.color=t)}setWaypointLabel(e,t){let r=this.waypoints.get(e);r&&(r.label=t,r.sprite.setLabel(t))}};E();x();k();R();import*as Ae from"three";import{Vec3 as U5}from"vec3";var we=class we{constructor(e){this.worldRenderer=e;d(this,"explosions",new Map);d(this,"particleGeometry");d(this,"particleMaterials",[]);d(this,"testModeTimer");d(this,"explosionCounter",0);this.particleGeometry=new Ae.BoxGeometry(we.DEFAULT_PARTICLE_SIZE,we.DEFAULT_PARTICLE_SIZE,we.DEFAULT_PARTICLE_SIZE),this.createParticleMaterials()}createParticleMaterials(){let e=[16711680,65280,255,16776960,16711935,65535,16753920,8388736,16761035,16777215];for(let t of e){let r=new Ae.MeshBasicMaterial({color:t,transparent:!0,opacity:1});this.particleMaterials.push(r)}}getRandomMaterial(){return this.particleMaterials[Math.floor(Math.random()*this.particleMaterials.length)]}createExplosion(e,t=1,r,i=we.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],a=Math.floor(we.DEFAULT_PARTICLE_COUNT*t),v;if(we.DEBUG_SHOW_EXPLOSION_CENTER){let c=.5*t,u=new Ae.SphereGeometry(c,8,8),h=new Ae.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});v=new Ae.Mesh(u,h),v.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(e.x,e.y,e.z)}for(let c=0;c<a;c++){let u=Math.random()*Math.PI*2,h=Math.sqrt(Math.random())*we.VELOCITY_FACTOR*t,p=new U5(h*Math.cos(u),Math.random()*.5-.25,h*Math.sin(u));c<5;let g=r===void 0?this.getRandomMaterial().clone():new Ae.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),y=new Ae.Mesh(this.particleGeometry,g);y.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(y),y.position.set(e.x,e.y,e.z),c<5;let A={position:e.clone(),velocity:p,color:new Ae.Color(g.color),life:1,maxLife:1,mesh:y};o.push(A)}let l={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:v};return this.explosions.set(s,l),l}createExplosionFacingCamera(e,t=1,r,i=we.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],a=Math.floor(we.DEFAULT_PARTICLE_COUNT*t),v;if(we.DEBUG_SHOW_EXPLOSION_CENTER){let h=.5*t,p=new Ae.SphereGeometry(h,8,8),g=new Ae.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});v=new Ae.Mesh(p,g),v.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(e.x,e.y,e.z)}let l=this.worldRenderer.getCameraPosition(),c=new U5(l.x-e.x,l.y-e.y,l.z-e.z).normalize();for(let h=0;h<a;h++){let p=Math.random()*Math.PI*2,g=Math.sqrt(Math.random())*we.VELOCITY_FACTOR*t,y=new U5(g*Math.cos(p),g*Math.sin(p),0),A=new U5(y.x*c.x-y.z*c.z,y.y,y.x*c.z+y.z*c.x);h<5;let b=r===void 0?this.getRandomMaterial().clone():new Ae.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),w=new Ae.Mesh(this.particleGeometry,b);w.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(w),w.position.set(e.x,e.y,e.z);let S={position:e.clone(),velocity:A,color:new Ae.Color(b.color),life:1,maxLife:1,mesh:w};o.push(S)}let u={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:v};return this.explosions.set(s,u),u}explode(e,t=1,r,i){return this.createExplosion(e,t,r,i).id}explodeFacingCamera(e,t=1,r,i){return this.createExplosionFacingCamera(e,t,r,i).id}startTestMode(){let e=this.worldRenderer.getCameraPosition(),t=new U5(e.x,e.y+10,e.z);this.testModeTimer=setInterval(()=>{let r=.8+Math.random()*.4,i=[16711680,65280,255,16776960,16711935,65535,16753920],s=i[Math.floor(Math.random()*i.length)];this.explodeFacingCamera(t,r,s)},we.TEST_INTERVAL)}updateParticle(e,t,r){let i=e.mesh.position.x===e.position.x&&e.mesh.position.y===e.position.y&&e.mesh.position.z===e.position.z;i&&e.life>.95,e.velocity.y+=we.GRAVITY;let s=e.position.clone(),o=t/1e3;e.position.add(e.velocity.scaled(o)),e.mesh.position.set(e.position.x,e.position.y,e.position.z);let a=e.life;e.life-=t/r;let v=Math.max(0,e.life);if(e.mesh.material instanceof Ae.MeshBasicMaterial&&(e.mesh.material.opacity=v),i&&a>.95){let l=e.position.distanceTo(s)}return e.life>0}render(){let e=Date.now(),t=16.67;this.explosions.size>0&&Math.random()<.01;for(let[r,i]of this.explosions.entries()){let s=e-i.startTime;if(s>=i.duration){this.removeExplosion(r);continue}s%2e3<16,i.particles=i.particles.filter(o=>this.updateParticle(o,t,i.duration)),i.particles.length===0&&this.removeExplosion(r)}}removeExplosion(e){let t=this.explosions.get(e);if(t){for(let r of t.particles)this.worldRenderer.sceneOrigin.removeAndUntrack(r.mesh),r.mesh.material instanceof Ae.Material&&r.mesh.material.dispose();t.debugSphere&&(this.worldRenderer.sceneOrigin.removeAndUntrack(t.debugSphere),t.debugSphere.geometry.dispose(),t.debugSphere.material instanceof Ae.Material&&t.debugSphere.material.dispose()),this.explosions.delete(e)}}stopTestMode(){this.testModeTimer&&(clearInterval(this.testModeTimer),this.testModeTimer=void 0)}destroy(){this.stopTestMode();for(let e of this.explosions.keys())this.removeExplosion(e);for(let e of this.particleMaterials)e.dispose();this.particleGeometry.dispose()}};d(we,"DEFAULT_PARTICLE_COUNT",50),d(we,"DEFAULT_PARTICLE_SIZE",.05),d(we,"DEFAULT_EXPLOSION_DURATION",6e3),d(we,"GRAVITY",-.005),d(we,"VELOCITY_FACTOR",1.5),d(we,"TEST_INTERVAL",1e3),d(we,"DEBUG_SHOW_EXPLOSION_CENTER",!0),d(we,"DEBUG_SHOW_PARTICLE_TRAILS",!1);var j1=we;E();x();k();R();import*as mt from"three";import{Vec3 as Li}from"vec3";var Y1=class n{constructor(e,t,r,i){this.worldRenderer=e;this.updateCamera=t;this.updateFov=r;this.getInitialState=i;d(this,"isRunning",!1);d(this,"currentScript",null);d(this,"currentPointIndex",0);d(this,"currentTweens",[]);d(this,"startTime",0);d(this,"totalDuration",0);d(this,"currentPosition",{x:0,y:0,z:0});d(this,"currentRotation",{yaw:0,pitch:0});d(this,"currentFov",75)}startScript(e){if(this.isRunning||!e.points||e.points.length===0)return!1;this.currentScript=e,this.isRunning=!0,this.currentPointIndex=0,this.startTime=performance.now(),this.totalDuration=e.points.reduce((r,i)=>r+i.duration,0);let t=this.getInitialState();return this.currentPosition={x:t.position.x,y:t.position.y,z:t.position.z},this.currentRotation={yaw:t.yaw,pitch:t.pitch},this.currentFov=t.fov,this.moveToPoint(0),!0}stopScript(){if(this.isRunning){for(let e of this.currentTweens)e.stop();this.currentTweens=[],this.isRunning=!1,this.currentScript=null,this.currentPointIndex=0}}runExampleScripts(e){let t=this.worldRenderer.getCameraPosition(),r=new Li(t.x,t.y,t.z),i=n.createCircularFlyby(r,30,20,15e3),s=n.createSpiralDescent(r.offset(0,50,0),r,3,12e3),o=n.createBuildingTour([{pos:r.offset(-20,10,-20),lookAt:r,duration:3e3},{pos:r.offset(20,15,-20),lookAt:r,duration:3e3},{pos:r.offset(20,20,20),lookAt:r,duration:3e3},{pos:r.offset(-20,25,20),lookAt:r,duration:3e3}]),a=[i,s,o];return this.startScript(a[e]),{circular:i,spiral:s,buildingTour:o}}moveToPoint(e){if(!this.currentScript||e>=this.currentScript.points.length){this.handleScriptComplete();return}let t=this.currentScript.points[e],{duration:r}=t,i={x:t.x,y:t.y,z:t.z},s={yaw:t.yaw,pitch:t.pitch},o=t.fov??this.currentFov;if(t.lookAt){let u=new mt.Vector3(t.lookAt.x,t.lookAt.y,t.lookAt.z),h=new mt.Vector3(t.x,t.y,t.z),p=u.sub(h).normalize();s.yaw=Math.atan2(-p.x,-p.z),s.pitch=Math.asin(p.y)}let a=this.getEasingFunction(t.easing||"easeInOut"),v=new Oe(this.currentPosition).to(i,r).easing(a).onUpdate(()=>{this.updateCamera(new Li(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),l=new Oe(this.currentRotation).to(this.wrapRotation(s),r).easing(a).onUpdate(()=>{this.updateCamera(new Li(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 u={fov:this.currentFov};c=new Oe(u).to({fov:o},r).easing(a).onUpdate(()=>{this.currentFov=u.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?.(e,t),this.isRunning&&this.moveToPoint(this.currentPointIndex)})}wrapRotation(e){let t=e.yaw,r=t-this.currentRotation.yaw;r>Math.PI?t-=2*Math.PI:r<-Math.PI&&(t+=2*Math.PI);let i=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,e.pitch));return{yaw:t,pitch:i}}getEasingFunction(e){switch(e){case"linear":return He.Linear.None;case"easeIn":return He.Quadratic.In;case"easeOut":return He.Quadratic.Out;case"easeInOut":return He.Quadratic.InOut;case"smoothstep":return He.Cubic.InOut;case"bounce":return He.Bounce.Out;default:return He.Quadratic.InOut}}handleScriptComplete(){if(!this.currentScript)return;let e=this.currentScript;e.loop?(this.currentPointIndex=0,this.moveToPoint(0)):(e.onComplete?.(),this.stopScript())}get running(){return this.isRunning}get progress(){if(!this.isRunning||this.totalDuration===0)return 0;let e=performance.now()-this.startTime;return Math.min(e/this.totalDuration,1)}get currentScriptName(){return this.currentScript?.name}static createCircularFlyby(e,t,r,i){let s=[];for(let a=0;a<=8;a++){let v=a/8*Math.PI*2,l=e.x+Math.cos(v)*t,c=e.z+Math.sin(v)*t,u=e.y+r;s.push({x:l,y:u,z:c,yaw:v+Math.PI/2,pitch:-.2,duration:i/8,easing:"smoothstep",lookAt:{x:e.x,y:e.y,z:e.z}})}return{name:"Circular Flyby",points:s,loop:!1}}static createSpiralDescent(e,t,r,i){let s=[],o=r*8,a=20;for(let v=0;v<=o;v++){let l=v/o,c=l*r*Math.PI*2,u=mt.MathUtils.lerp(e.x,t.x,l)+Math.cos(c)*a*(1-l),h=mt.MathUtils.lerp(e.z,t.z,l)+Math.sin(c)*a*(1-l),p=mt.MathUtils.lerp(e.y,t.y,l);s.push({x:u,y:p,z:h,yaw:c+Math.PI/2,pitch:-.3*l,duration:i/o,easing:"easeInOut"})}return{name:"Spiral Descent",points:s,loop:!1}}static createBuildingTour(e){return{name:"Building Tour",points:e.map((r,i)=>({x:r.pos.x,y:r.pos.y,z:r.pos.z,yaw:0,pitch:0,duration:r.duration||3e3,easing:"smoothstep",lookAt:r.lookAt?{x:r.lookAt.x,y:r.lookAt.y,z:r.lookAt.z}:void 0})),loop:!1}}};E();x();k();R();import*as ee from"three";var Ui=.75,Q1=class{constructor(e,t,r){this.scene=e;this.defaultSkybox=t;this.initialImage=r;d(this,"texture",null);d(this,"mesh",null);d(this,"skyMesh",null);d(this,"voidMesh",null);d(this,"worldTime",0);d(this,"partialTicks",0);d(this,"viewDistance",4);d(this,"temperature",Ui);d(this,"inWater",!1);d(this,"waterBreathing",!1);d(this,"fogBrightness",0);d(this,"prevFogBrightness",0);d(this,"fogOrangeness",0);d(this,"distanceFactor",2.7);d(this,"brightnessAtPosition",1);d(this,"debugGui");this.debugGui=new k0("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}}),r||this.createGradientSky()}async init(){this.initialImage&&await this.setSkyboxImage(this.initialImage)}async setSkyboxImage(e){this.texture&&this.texture.dispose();let t=new ee.TextureLoader;if(this.texture=await new Promise(r=>{t.load(e,i=>{i.mapping=ee.EquirectangularReflectionMapping,i.encoding=ee.sRGBEncoding,i.minFilter=ee.NearestFilter,i.magFilter=ee.NearestFilter,i.needsUpdate=!0,r(i)})}),this.mesh)this.mesh.material.map=this.texture,this.mesh.material.needsUpdate=!0;else{let r=new ee.SphereGeometry(500,60,40);r.scale(-1,1,1);let i=new ee.MeshBasicMaterial({map:this.texture,side:ee.FrontSide});this.mesh=new ee.Mesh(r,i),this.scene.add(this.mesh)}}update(e,t){t!==this.viewDistance&&(this.viewDistance=t,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(e,t=0){this.debugGui.visible||(this.worldTime=e,this.partialTicks=t,this.updateSkyColors())}updateViewDistance(e){this.viewDistance=e,this.updateSkyColors()}updateTemperature(e){this.debugGui.visible||(this.temperature=e,this.updateSkyColors())}updateWaterState(e,t){this.debugGui.visible||(this.inWater=e,this.waterBreathing=t,this.updateSkyColors())}updateDefaultSkybox(e){this.debugGui.visible||(this.defaultSkybox=e,this.updateSkyColors())}createGradientSky(){{let r=new ee.PlaneGeometry(768,768);r.rotateX(-Math.PI/2),r.translate(0,16,0);let i=new ee.MeshBasicMaterial({color:16777215,side:ee.DoubleSide,depthTest:!1});this.skyMesh=new ee.Mesh(r,i),this.scene.add(this.skyMesh)}{let r=new ee.PlaneGeometry(768,768);r.rotateX(-Math.PI/2),r.translate(0,-16,0);let i=new ee.MeshBasicMaterial({color:16777215,side:ee.DoubleSide,depthTest:!1});this.voidMesh=new ee.Mesh(r,i),this.scene.add(this.voidMesh)}this.updateSkyColors()}getFogColor(e=0){let t=this.getCelestialAngle(e),r=Math.cos(t*Math.PI*2)*2+.5;r=Math.max(0,Math.min(1,r));let i=.7529412,s=.84705883,o=1;return i*=r*.94+.06,s*=r*.94+.06,o*=r*.91+.09,new ee.Vector3(i,s,o)}getSkyColor(e=0,t=0,r=0){let i=this.getCelestialAngle(r),s=Math.cos(i*3.141593*2)*2+.5;s<0&&(s=0),s>1&&(s=1);let o=this.getTemperature(e,t),a=this.getSkyColorByTemp(o),v=(a>>16&255)/255,l=(a>>8&255)/255,c=(a&255)/255;return new ee.Vector3(v*s,l*s,c*s)}calculateCelestialAngle(e,t){let i=(e%24e3+t)/24e3-.25;return i<0&&i++,i>1&&i--,i=1-(Math.cos(i*Math.PI)+1)/2,i+=(i-i)/3,i}getCelestialAngle(e){return this.calculateCelestialAngle(this.worldTime,e)}getTemperature(e,t){return this.temperature}getSkyColorByTemp(e){e/=3,e<-1&&(e=-1),e>1&&(e=1);let t=.6222222-e*.05,i=this.fogOrangeness>0?t+(.12-t)*this.fogOrangeness*.8:t+this.fogOrangeness*.1,s=.5+e*.1+Math.abs(this.fogOrangeness)*.3;return this.hsbToRgb(i,s,1)}hsbToRgb(e,t,r){let i=0,s=0,o=0;if(t===0)i=s=o=Math.floor(r*255+.5);else{let a=(e-Math.floor(e))*6,v=a-Math.floor(a),l=r*(1-t),c=r*(1-t*v),u=r*(1-t*(1-v));switch(Math.floor(a)){case 0:i=Math.floor(r*255+.5),s=Math.floor(u*255+.5),o=Math.floor(l*255+.5);break;case 1:i=Math.floor(c*255+.5),s=Math.floor(r*255+.5),o=Math.floor(l*255+.5);break;case 2:i=Math.floor(l*255+.5),s=Math.floor(r*255+.5),o=Math.floor(u*255+.5);break;case 3:i=Math.floor(l*255+.5),s=Math.floor(c*255+.5),o=Math.floor(r*255+.5);break;case 4:i=Math.floor(u*255+.5),s=Math.floor(l*255+.5),o=Math.floor(r*255+.5);break;case 5:i=Math.floor(r*255+.5),s=Math.floor(l*255+.5),o=Math.floor(c*255+.5);break}}return 4278190080|i<<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 e=this.viewDistance/32,t=this.brightnessAtPosition*(1-e)+e;if(this.fogBrightness+=(t-this.fogBrightness)*.1,this.inWater){let g=this.waterBreathing?100:5;this.scene.fog=new ee.Fog(new ee.Color(0,0,1),.0025,g),this.scene.background=new ee.Color(0,0,1),this.skyMesh.material.color.set(new ee.Color(0,0,1)),this.voidMesh.material.color.set(new ee.Color(0,0,.6));return}let r=this.viewDistance*16,i=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,u=(a.x+(o.x-a.x)*i)*l*c,h=(a.y+(o.y-a.y)*i)*l*c,p=(a.z+(o.z-a.z)*i)*l*c;this.scene.background=new ee.Color(u,h,p),this.scene.fog=new ee.Fog(new ee.Color(u,h,p),.0025,r*this.distanceFactor),this.skyMesh.material.color.set(new ee.Color(o.x,o.y,o.z)),this.voidMesh.material.color.set(new ee.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))}};E();x();k();R();import*as re from"three";var wv=`
|
|
21460
21460
|
precision highp float;
|
|
21461
21461
|
attribute vec3 position;
|
|
21462
21462
|
attribute vec4 color;
|
|
@@ -21476,7 +21476,7 @@ void main() {
|
|
|
21476
21476
|
gl_PointSize = size * adjustSize * (300.0 / length(mvPosition.xyz));
|
|
21477
21477
|
gl_Position = projectionMatrix * mvPosition;
|
|
21478
21478
|
}
|
|
21479
|
-
`,
|
|
21479
|
+
`,Av=`
|
|
21480
21480
|
precision highp float;
|
|
21481
21481
|
uniform sampler2D texture;
|
|
21482
21482
|
varying vec4 vColor;
|
|
@@ -21485,7 +21485,7 @@ void main() {
|
|
|
21485
21485
|
vec4 texColor = texture2D(texture, gl_PointCoord);
|
|
21486
21486
|
gl_FragColor = vColor * texColor;
|
|
21487
21487
|
}
|
|
21488
|
-
`,Je={textureSize:128,gravity:new re.Vector3(0,-.005,0),friction:.998,defaultParticleSize:300,maxActiveFireworks:5},N5=n=>{let t=n*3;return{x:t,y:t+1,z:t+2}},j5=n=>{let t=n*4;return{r:t,g:t+1,b:t+2,a:t+3}},gt=(n=0,e=0)=>Math.floor(Math.random()*(n+1-e))+e,Mv=(n,e,t,r)=>{n.save();let i=n.createRadialGradient(e,e,0,e,e,e);i.addColorStop(0,"rgba(255,255,255,1.0)"),i.addColorStop(.5,"rgba(255,255,255,0.5)"),i.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=i,n.fillRect(0,0,t,r),n.restore()},Sv=()=>{let n=Je.textureSize,e=je(n,n),t=e.getContext("2d"),r=n/2;Mv(t,r,e.width,e.height);let i=new re.Texture(e);return i.needsUpdate=!0,i},Cv=(n,e,t,r,i=Je.defaultParticleSize)=>{let s=new re.BufferGeometry,o=[],v=[],a=[],l=[],c=[],u=Math.random()>.3?"single":"multiple",f=gt(100,20)*.01,p=()=>gt(100,1)*.01,g="red",y=Math.random();y>.66?g="red":y>.33?g="green":g="blue";for(let b=0;b<n;b++){let _=new re.Vector3(0,0,0);if(o.push(_.x,_.y,_.z),v.push(e[b].x,e[b].y,e[b].z),t==="seed"){let S=e[b].y**2*.04;b===0&&(S*=1.1),l.push(S),c.push(S*.017),a.push(1,1,1,1)}else if(t==="trail"){let S=Math.random()*.1+.1;l.push(S),c.push(S*.017),a.push(1,1,1,1)}else{let S=gt(i,10)*.001;if(l.push(S),c.push(S*.017),u==="multiple")a.push(p(),p(),p(),1);else switch(g){case"red":a.push(f,.1,.1,1);break;case"green":a.push(.1,f,.1,1);break;case"blue":a.push(.1,.1,f,1);break}}}s.setAttribute("position",new re.Float32BufferAttribute(o,3)),s.setAttribute("velocity",new re.Float32BufferAttribute(v,3)),s.setAttribute("color",new re.Float32BufferAttribute(a,4)),s.setAttribute("adjustSize",new re.Float32BufferAttribute(l,1)),s.setAttribute("mass",new re.Float32BufferAttribute(c,1));let A=new re.RawShaderMaterial({uniforms:{size:{value:Je.textureSize},texture:{value:r}},transparent:!0,depthWrite:!1,blending:re.AdditiveBlending,vertexShader:kv,fragmentShader:Tv});return new re.Points(s,A)},Y5=class{constructor(e,t,r,i,s){d(this,"particleNum");d(this,"timerStartFading");d(this,"mesh");this.particleNum=e,this.timerStartFading=10,this.mesh=Cv(e,t,r,i,s)}update(e){this.timerStartFading>0&&(this.timerStartFading-=.3);let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.5?.98:.96,v=a=>Math.random()>.5?0:(1-a)*.1;for(let a=0;a<this.particleNum;a++){let{x:l,y:c,z:u}=N5(a);r.array[c]+=e.y-s.array[a],r.array[l]*=Je.friction,r.array[u]*=Je.friction,r.array[c]*=Je.friction,t.array[l]+=r.array[l],t.array[c]+=r.array[c],t.array[u]+=r.array[u];let{a:f}=j5(a);this.timerStartFading<=0&&(i.array[f]*=o()-v(i.array[f]),i.array[f]<.001&&(i.array[f]=0))}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}disposeAll(){this.mesh.geometry.dispose(),this.mesh.material.dispose()}},Yi=class extends Y5{constructor(e,t,r){super(e,t,"seed",r)}update(e){let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.99:.96,v=u=>Math.random()>.3?0:(1-u)*.1,a=()=>Math.random()>.5?.05:-.05,l=()=>Math.random()>.1,c=Je.friction*.98;for(let u=0;u<this.particleNum;u++){let{x:f,y:p,z:g}=N5(u);r.array[p]+=e.y-s.array[u],r.array[f]*=c,r.array[g]*=c,r.array[p]*=c,t.array[f]+=r.array[f],t.array[p]+=r.array[p],t.array[g]+=r.array[g],l()&&(t.array[f]+=a()),l()&&(t.array[g]+=a());let{a:y}=j5(u);i.array[y]*=o()-v(i.array[y]),i.array[y]<.001&&(i.array[y]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},Qi=class extends Y5{constructor(e,t,r){super(e,t,"trail",r)}update(e){let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.98:.95,v=()=>Math.random()>.5?.05:-.05,a=()=>Math.random()>.2;for(let l=0;l<this.particleNum;l++){let{x:c,y:u,z:f}=N5(l);r.array[u]+=e.y-s.array[l],r.array[c]*=Je.friction,r.array[f]*=Je.friction,r.array[u]*=Je.friction,t.array[c]+=r.array[c],t.array[u]+=r.array[u],t.array[f]+=r.array[f],a()&&(t.array[c]+=v()),a()&&(t.array[f]+=v());let{a:p}=j5(l);i.array[p]*=o(),i.array[p]<.001&&(i.array[p]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},Q5=class{constructor(e,t=Je.defaultParticleSize,r){d(this,"meshGroup");d(this,"isExplode");d(this,"petalsNum");d(this,"life");d(this,"seed");d(this,"flowerSizeRate");d(this,"flower");d(this,"texture");d(this,"particleSize");this.meshGroup=new re.Group,this.isExplode=!1,this.texture=e,this.particleSize=t;let i=400,s=150;this.petalsNum=gt(i,s),this.life=150,this.seed=this.getSeed(r),this.meshGroup.add(this.seed.mesh),this.flowerSizeRate=re.MathUtils.mapLinear(this.petalsNum,s,i,.4,.7)}getSeed(e){let r=[];for(let s=0;s<40;s++){let v=s===0?Math.random()*2.5+.9:Math.random()*2+.4,a=0;r.push(new re.Vector3(0,v,a))}let i=new Yi(40,r,this.texture);if(e)i.mesh.position.set(0,0,0);else{let s=Math.random()*80-40,o=-50,v=Math.random()*80-40;i.mesh.position.set(s,o,v)}return i}explode(e){this.isExplode=!0,this.flower=this.getFlower(e),this.meshGroup.add(this.flower.mesh),this.meshGroup.remove(this.seed.mesh),this.seed.disposeAll()}getFlower(e){let t=this.petalsNum,r=[],i;if(Math.random()>.5)for(let v=0;v<t;v++){i=gt(120,60)*.01;let a=re.MathUtils.degToRad(Math.random()*180),l=re.MathUtils.degToRad(Math.random()*360),c=Math.sin(a)*Math.cos(l)*i,u=Math.sin(a)*Math.sin(l)*i,f=Math.cos(a)*i,p=new re.Vector3(c,u,f);p.multiplyScalar(this.flowerSizeRate),r.push(p)}else{let v=180/t,a=360*(Math.random()*20+1)/t,l=a,c=a;i=gt(120,60)*.01;for(let u=0;u<t;u++){let f=Math.sin(re.MathUtils.degToRad(v*u)),p=Math.cos(re.MathUtils.degToRad(v*u))*i,g=Math.cos(re.MathUtils.degToRad(l*u))*f*i,y=Math.sin(re.MathUtils.degToRad(c*u))*f*i,A=new re.Vector3(g,y,p);A.multiplyScalar(this.flowerSizeRate),r.push(A)}}let o=new Y5(t,r,"default",this.texture,this.particleSize);return o.mesh.position.set(e.x,e.y,e.z),o}update(e){this.isExplode?(this.flower.update(e),this.life>0&&(this.life-=1)):this.drawTail()}drawTail(){this.seed.update(Je.gravity);let e=this.seed.mesh.geometry.attributes.position,t=this.seed.mesh.geometry.attributes.velocity,r=0;for(let u=0,f=t.array.length;u<f;u++){let p=t.array[u];u%3===1&&p>0&&r++}if(!(r===0))return;let{x:s,y:o,z:v}=this.seed.mesh.position,a=new re.Vector3(s,o,v),l=0,c;for(let u=0,f=e.array.length;u<f;u++){let p=e.array[u];u%3===1&&p>l&&(l=p,c=new re.Vector3(e.array[u-1],p,e.array[u+2]))}c&&(a.add(c),this.explode(a))}},qt=class extends Q5{constructor(t,r=Je.defaultParticleSize,i){super(t,r,i);d(this,"tailMeshGroup");d(this,"tails");let s=150,o=100;this.petalsNum=gt(s,o),this.flowerSizeRate=re.MathUtils.mapLinear(this.petalsNum,o,s,.4,.7),this.tailMeshGroup=new re.Group,this.tails=[]}explode(t){this.isExplode=!0,this.flower=this.getFlower(t),this.tails=this.getTail(),this.meshGroup.add(this.flower.mesh),this.meshGroup.add(this.tailMeshGroup)}getTail(){let t=[],i=this.flower.mesh.geometry.attributes.color;for(let s=0;s<this.petalsNum;s++){let o=[];for(let M=0;M<20;M++)o.push(new re.Vector3(0,0,0));let v=new Qi(20,o,this.texture),{r:a,g:l,b:c,a:u}=j5(s),f=i.array[a],p=i.array[l],g=i.array[c],y=i.array[u],A=v.mesh.geometry.attributes.position,b=v.mesh.geometry.attributes.color;for(let M=0;M<A.count;M++){let P=j5(M);b.array[P.r]=f,b.array[P.g]=p,b.array[P.b]=g,b.array[P.a]=y}let{x:_,y:S,z:C}=this.flower.mesh.position;v.mesh.position.set(_,S,C),t.push(v),this.tailMeshGroup.add(v.mesh)}return t}update(t){if(this.isExplode){this.flower.update(t);let r=this.flower.mesh.geometry.attributes.position;for(let i=0,s=this.tails.length;i<s;i++){let o=this.tails[i];o.update(t);let{x:v,y:a,z:l}=N5(i),c=new re.Vector3(r.array[v],r.array[a],r.array[l]),u=o.mesh.geometry.attributes.position,f=o.mesh.geometry.attributes.velocity;for(let p=0;p<u.count;p++){let g=N5(p),y=new re.Vector3,A=new re.Vector3(u.array[g.x],u.array[g.y],u.array[g.z]),b=new re.Vector3(f.array[g.x],f.array[g.y],f.array[g.z]);y.subVectors(c,A);let _=y.sub(b);_.normalize(),_.multiplyScalar(Math.random()*3e-4*this.life),f.array[g.x]+=_.x,f.array[g.y]+=_.y,f.array[g.z]+=_.z}f.needsUpdate=!0}this.life>0&&(this.life-=1.2)}else this.drawTail()}},q1=class{constructor(e,t,r){d(this,"fireworksInstances");d(this,"scene");d(this,"sceneOrigin");d(this,"texture");d(this,"particleSize");d(this,"maxFireworks");this.fireworksInstances=[],this.scene=e,this.sceneOrigin=t,this.texture=Sv(),this.particleSize=r?.defaultParticleSize??Je.defaultParticleSize,this.maxFireworks=r?.maxActiveFireworks??Je.maxActiveFireworks}launchFirework(e){if(this.fireworksInstances.length>=this.maxFireworks)return;let t=e?.particleSize??this.particleSize,r=e?.position,i;e?.forceRich?i=new qt(this.texture,t,r):e?.forceBasic?i=new Q5(this.texture,t,r):i=Math.random()>.5?new Q5(this.texture,t,r):new qt(this.texture,t,r),this.fireworksInstances.push(i),r?(this.sceneOrigin.addAndTrack(i.meshGroup),i.meshGroup.position.set(r.x,r.y,r.z)):this.scene.add(i.meshGroup)}repositionAll(){}update(){let e=[];for(let t=this.fireworksInstances.length-1;t>=0;t--){let r=this.fireworksInstances[t];r.update(Je.gravity),r.isExplode&&e.push(t)}for(let t=0,r=e.length;t<r;t++){let i=e[t],s=this.fireworksInstances[i];if(s&&(s.meshGroup.remove(s.seed.mesh),s.seed.disposeAll(),s.life<=0)){if(this.sceneOrigin.removeAndUntrack(s.meshGroup),s instanceof qt&&s.tailMeshGroup)for(let o of s.tails)o.disposeAll();s.flower?.disposeAll(),this.fireworksInstances.splice(i,1)}}}clear(){for(let e of this.fireworksInstances)if(this.sceneOrigin.removeAndUntrack(e.meshGroup),e.seed.disposeAll(),e.flower&&e.flower.disposeAll(),e instanceof qt)for(let t of e.tails)t.disposeAll();this.fireworksInstances=[]}dispose(){this.clear(),this.texture.dispose()}};E();x();k();R();var aa=Symbol("tracked-proxy"),Bv=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"]),X1=class{constructor(e){d(this,"scene");d(this,"_x",0);d(this,"_y",0);d(this,"_z",0);d(this,"_tracked",new Set);d(this,"_worldCoords",new WeakMap);d(this,"_originalPositions",new WeakMap);d(this,"_trackOptions",new WeakMap);this.scene=e}get x(){return this._x}get y(){return this._y}get z(){return this._z}update(e,t,r){this._x=e,this._y=t,this._z=r;for(let i of this._tracked){let s=this._worldCoords.get(i);this._originalPositions.get(i).set(s.x-e,s.y-t,s.z-r),this._trackOptions.get(i)?.updateMatrix&&i.updateMatrix()}}track(e,t){let r=this._originalPositions.get(e)??e.position,i={x:0,y:0,z:0};this._originalPositions.set(e,r),this._worldCoords.set(e,i),t?this._trackOptions.set(e,t):this._trackOptions.delete(e);let s=this,o=t,v=new Proxy(r,{get(a,l,c){if(l===aa)return i;if(l==="set")return(f,p,g)=>(i.x=f,i.y=p,i.z=g,a.set(f-s._x,p-s._y,g-s._z),o?.updateMatrix&&e.updateMatrix(),c);if(l==="copy")return f=>{let p=f[aa],g=p?p.x:f.x,y=p?p.y:f.y,A=p?p.z:f.z;return i.x=g,i.y=y,i.z=A,a.set(g-s._x,y-s._y,A-s._z),o?.updateMatrix&&e.updateMatrix(),c};if(l==="setX")return f=>(i.x=f,a.x=f-s._x,o?.updateMatrix&&e.updateMatrix(),c);if(l==="setY")return f=>(i.y=f,a.y=f-s._y,o?.updateMatrix&&e.updateMatrix(),c);if(l==="setZ")return f=>(i.z=f,a.z=f-s._z,o?.updateMatrix&&e.updateMatrix(),c);if(typeof l=="string"&&Bv.has(l))return()=>{throw new Error(`Cannot call position.${l}() on a tracked object. Use position.set(x, y, z) instead.`)};let u=a[l];return typeof u=="function"?u.bind(a):u},set(a,l,c){return l==="x"?(i.x=c,a.x=c-s._x,o?.updateMatrix&&e.updateMatrix(),!0):l==="y"?(i.y=c,a.y=c-s._y,o?.updateMatrix&&e.updateMatrix(),!0):l==="z"?(i.z=c,a.z=c-s._z,o?.updateMatrix&&e.updateMatrix(),!0):(a[l]=c,!0)}});Object.defineProperty(e,"position",{value:v,configurable:!0,enumerable:!0}),this._tracked.add(e)}untrack(e){let t=this._originalPositions.get(e);t&&(Object.defineProperty(e,"position",{value:t,configurable:!0,enumerable:!0}),this._tracked.delete(e),this._worldCoords.delete(e),this._originalPositions.delete(e),this._trackOptions.delete(e))}addAndTrack(e,t){this.track(e,t),this.scene.add(e)}removeAndUntrack(e){this.untrack(e),e.removeFromParent()}removeAndUntrackAll(e){e.traverse(t=>{this.untrack(t)}),e.removeFromParent()}getWorldPosition(e){let t=this._worldCoords.get(e);return t?{x:t.x,y:t.y,z:t.z}:void 0}clear(){for(let e of this._tracked)this.untrack(e)}get trackedCount(){return this._tracked.size}toSceneX(e){return e-this._x}toSceneY(e){return e-this._y}toSceneZ(e){return e-this._z}toWorldX(e){return e+this._x}toWorldY(e){return e+this._y}toWorldZ(e){return e+this._z}};$i();E();x();k();R();$t();bt();qi();import Qv from"prismarine-chat";import*as $ from"three";import*as lr from"prismarine-nbt";import{Vec3 as nn}from"vec3";E();x();k();R();bt();$t();import*as f0 from"three";var Uv=2e6,en=fa(),or=class{constructor(e,t){d(this,"mesh");d(this,"capacityFaces");d(this,"w0");d(this,"w1");d(this,"w2");d(this,"w3");d(this,"sectionSlots",new Map);d(this,"freeList",[]);d(this,"highWatermark",0);d(this,"dirtyMin",1/0);d(this,"dirtyMax",-1);this.capacityFaces=Uv,this.w0=new Uint32Array(this.capacityFaces),this.w1=new Uint32Array(this.capacityFaces),this.w2=new Uint32Array(this.capacityFaces),this.w3=new Uint32Array(this.capacityFaces);let r=new f0.InstancedBufferGeometry,i=new Float32Array(er*3);r.setAttribute("position",new f0.BufferAttribute(i,3));let s=o=>{let v=new f0.InstancedBufferAttribute(o,1);return v.setUsage(f0.DynamicDrawUsage),v};r.setAttribute("a_w0",s(this.w0)),r.setAttribute("a_w1",s(this.w1)),r.setAttribute("a_w2",s(this.w2)),r.setAttribute("a_w3",s(this.w3)),r.instanceCount=0,this.mesh=new f0.Mesh(r,e),this.mesh.name="globalShaderCubes",this.mesh.frustumCulled=!1,this.mesh.matrixAutoUpdate=!1,this.mesh.matrix.identity(),this.mesh.position.set(0,0,0),t.add(this.mesh)}addSection(e,t,r){if(r<=0){this.removeSection(e);return}this.sectionSlots.has(e)&&this.removeSection(e),r>this.capacityFaces&&this.growCapacity(r);let i=this.takeFreeSlot(r);i||(this.highWatermark+r>this.capacityFaces&&this.growCapacity(this.highWatermark+r),i={start:this.highWatermark,count:r},this.highWatermark+=r);let s=4;for(let o=0;o<r;o++){let v=i.start+o,a=o*s;this.w0[v]=t[a],this.w1[v]=t[a+1],this.w2[v]=t[a+2],this.w3[v]=t[a+3]}this.sectionSlots.set(e,i),this.markDirty(i.start,i.start+r-1),this.mesh.geometry.instanceCount=this.highWatermark}hasSection(e){return this.sectionSlots.has(e)}getSectionSlot(e){return this.sectionSlots.get(e)}getW0(){return this.w0}takeSectionData(e){let t=this.sectionSlots.get(e);if(!t)return;let r=4,i=new Uint32Array(t.count*r);for(let s=0;s<t.count;s++){let o=t.start+s,v=s*r;i[v]=this.w0[o],i[v+1]=this.w1[o],i[v+2]=this.w2[o],i[v+3]=this.w3[o]}return this.removeSection(e),{words:i,count:t.count}}removeSection(e){let t=this.sectionSlots.get(e);if(t){for(let r=t.start;r<t.start+t.count;r++)this.w0[r]=0,this.w1[r]=0,this.w2[r]=en,this.w3[r]=0;this.markDirty(t.start,t.start+t.count-1),this.sectionSlots.delete(e),this.insertFreeSlot(t),this.shrinkHighWatermark(),this.mesh.geometry.instanceCount=this.highWatermark}}uploadDirtyRange(){if(this.dirtyMin>this.dirtyMax)return;let e=this.dirtyMin,t=this.dirtyMax-this.dirtyMin+1,r=this.mesh.geometry;for(let i of["a_w0","a_w1","a_w2","a_w3"]){let s=r.getAttribute(i);s.updateRange.offset=e,s.updateRange.count=t,s.needsUpdate=!0}this.dirtyMin=1/0,this.dirtyMax=-1}setCameraOrigin(e,t,r){let i=Math.floor(e),s=Math.floor(t),o=Math.floor(r),v=this.mesh.material.uniforms.u_cameraOrigin;v?.value?.set&&v.value.set(i,s,o);let a=this.mesh.material.uniforms.u_cameraOriginFrac;a?.value?.set&&a.value.set(e-i,t-s,r-o)}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.dirtyMin=1/0,this.dirtyMax=-1,this.w0.fill(0),this.w1.fill(0),this.w2.fill(en),this.w3.fill(0),this.mesh.geometry.instanceCount=0}dispose(){this.mesh.parent?.remove(this.mesh),this.mesh.geometry.dispose(),this.reset()}markDirty(e,t){e<this.dirtyMin&&(this.dirtyMin=e),t>this.dirtyMax&&(this.dirtyMax=t)}takeFreeSlot(e){for(let t=0;t<this.freeList.length;t++){let r=this.freeList[t];if(r.count>=e){if(this.freeList.splice(t,1),r.count===e)return r;let i={start:r.start,count:e};return this.insertFreeSlot({start:r.start+e,count:r.count-e}),i}}}insertFreeSlot(e){this.freeList.push(e),this.freeList.sort((t,r)=>t.start-r.start),this.mergeFreeList()}mergeFreeList(){if(this.freeList.length<2)return;let e=[],t=this.freeList[0];for(let r=1;r<this.freeList.length;r++){let i=this.freeList[r];t.start+t.count===i.start?t={start:t.start,count:t.count+i.count}:(e.push(t),t=i)}e.push(t),this.freeList=e}shrinkHighWatermark(){for(;this.highWatermark>0;){let e=this.highWatermark-1,t=this.freeList.find(i=>i.start<=e&&i.start+i.count>e);if(!t||t.start+t.count!==this.highWatermark)break;this.highWatermark=t.start;let r=this.freeList.indexOf(t);this.freeList.splice(r,1)}}growCapacity(e){let t=this.capacityFaces;for(;t<e;)t*=2;let r=new Uint32Array(t),i=new Uint32Array(t),s=new Uint32Array(t),o=new Uint32Array(t);r.set(this.w0),i.set(this.w1),s.set(this.w2),o.set(this.w3),s.fill(en,this.w0.length),this.w0=r,this.w1=i,this.w2=s,this.w3=o,this.capacityFaces=t;let v=this.mesh.geometry,a=(l,c)=>{let u=v.getAttribute(c);u&&(v.deleteAttribute(c),"dispose"in u&&typeof u.dispose=="function"&&u.dispose());let f=new f0.InstancedBufferAttribute(l,1);f.setUsage(f0.DynamicDrawUsage),v.setAttribute(c,f)};a(this.w0,"a_w0"),a(this.w1,"a_w1"),a(this.w2,"a_w2"),a(this.w3,"a_w3"),this.dirtyMin=0,this.dirtyMax=this.highWatermark-1}};E();x();k();R();$t();bt();function wa(n,e,t,r,i){if(e<=0)return;let s=t-8,o=r-8,v=i-8,a=Xt,l=16,c=16,u=16,f=-1,p=-1,g=-1;for(let M=0;M<e;M++){let P=n[M*a],B=P&(1<<d0.LX_BITS)-1,H=P>>d0.LY_SHIFT&(1<<d0.LY_BITS)-1,G=P>>d0.LZ_SHIFT&(1<<d0.LZ_BITS)-1;B<l&&(l=B),H<c&&(c=H),G<u&&(u=G),B>f&&(f=B),H>p&&(p=H),G>g&&(g=G)}if(f<0)return;let y=s+l,A=o+c,b=v+u,_=s+f+1,S=o+p+1,C=v+g+1;return{minX:y,minY:A,minZ:b,maxX:_,maxY:S,maxZ:C,cx:(y+_)*.5,cy:(A+S)*.5,cz:(b+C)*.5}}function ar(n,e,t,r,i,s,o,v,a){return n>=r&&n<=o&&e>=i&&e<=v&&t>=s&&t<=a}function tn(n,e,t,r,i,s,o,v,a,l,c,u,f){if(ar(n,e,t,o,v,a,l,c,u))return;let p=0,g=f;if(Math.abs(r)<1e-8){if(n<o||n>l)return}else{let y=1/r,A=(o-n)*y,b=(l-n)*y;if(A>b){let _=A;A=b,b=_}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}if(Math.abs(i)<1e-8){if(e<v||e>c)return}else{let y=1/i,A=(v-e)*y,b=(c-e)*y;if(A>b){let _=A;A=b,b=_}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}if(Math.abs(s)<1e-8){if(t<a||t>u)return}else{let y=1/s,A=(a-t)*y,b=(u-t)*y;if(A>b){let _=A;A=b,b=_}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}return p<=g&&p>=0?p:void 0}function Gv(n,e,t,r,i,s,o,v,a,l,c,u,f){let p=f;if(Math.abs(r)>=1e-8){let g=r>0?(l-n)/r:(o-n)/r;g>1e-6&&(p=Math.min(p,g))}else if(n<o||n>l)return;if(Math.abs(i)>=1e-8){let g=i>0?(c-e)/i:(v-e)/i;g>1e-6&&(p=Math.min(p,g))}else if(e<v||e>c)return;if(Math.abs(s)>=1e-8){let g=s>0?(u-t)/s:(a-t)/s;g>1e-6&&(p=Math.min(p,g))}else if(t<a||t>u)return;return p<=f?p:void 0}function rn(n,e,t,r,i,s,o,v,a,l,c,u,f,p,g,y){let A=i-8,b=s-8,_=o-8,S=p,C=!1;for(let M=0;M<t;M++){let P=n[e+M*r],B=P&(1<<d0.LX_BITS)-1,H=P>>d0.LY_SHIFT&(1<<d0.LY_BITS)-1,G=P>>d0.LZ_SHIFT&(1<<d0.LZ_BITS)-1,O=B+(H<<4)+(G<<8);if(g[O]===y)continue;g[O]=y;let j=A+B,J=b+H,Z=_+G,X=j+1,de=J+1,ae=Z+1,ve;ar(v,a,l,j,J,Z,X,de,ae)?ve=Gv(v,a,l,c,u,f,j,J,Z,X,de,ae,S):ve=tn(v,a,l,c,u,f,j,J,Z,X,de,ae,S),ve!==void 0&&ve<S&&(S=ve,C=!0)}return C?S:void 0}E();x();k();R();import*as qe from"three";var Aa=20,Ea=40,Vv={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},xa={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 Wv(n){let e=n.replace("_wall_banner","_banner");return Vv[e]??15}var Nv=(n,e,t,r,i,s,o)=>{switch(n.fillStyle=t,e){case"bs":n.fillRect(r,i,s,o);break;case"ls":n.fillRect(r,i,s/3,o);break;case"rs":n.fillRect(r+s*2/3,i,s/3,o);break;case"ts":n.fillRect(r,i,s,o/3);break;case"ms":n.fillRect(r,i+o/3,s,o/3);break;case"drs":n.fillRect(r,i,s/2,o/2);break;case"dls":n.fillRect(r+s/2,i,s/2,o/2);break;case"ss":for(let v=0;v<s;v+=2)n.fillRect(r+v,i,1,o);break;case"cr":n.fillRect(r,i+o/3,s,o/3),n.fillRect(r+s/3,i,s/3,o);break;case"sc":n.fillRect(r,i+o/2-1,s,2),n.fillRect(r+s/2-1,i,2,o);break;default:n.fillRect(r,i,s,o)}};function jv(n,e){if(!e||e.length===0)return`banner_${n}_empty`;let t=e.map(r=>`${r.Pattern??"bs"}_${r.Color??0}`).join(",");return`banner_${n}_${t}`}var Yv=(n,e,t=(r,i)=>je(r,i))=>{let i=t(Aa*1,Ea*1),s=i.getContext("2d");if(s){if(s.imageSmoothingEnabled=!1,e?.Patterns&&e.Patterns.length>0)for(let o of e.Patterns){let v=o.Color??0,a=o.Pattern??"bs",l=xa[v]||xa[0];Nv(s,a,l,0,0,Aa*1,Ea*1)}return i}},vr=new Map;function Ra(n,e,t){let r=Wv(e),i=jv(r,t?.Patterns),s=vr.get(i);if(s)return s.refCount++,s.texture;let o=Yv(r,t);if(!o)return;let v=new qe.Texture(o);return v.magFilter=qe.NearestFilter,v.minFilter=qe.NearestFilter,v.needsUpdate=!0,vr.set(i,{texture:v,refCount:1}),v}function ka(n){for(let[e,t]of vr.entries())if(t.texture===n){t.refCount--,t.refCount<=0&&(t.texture.dispose(),vr.delete(e));return}}function Ta(n,e,t,r){let v,a,l;t?(v=(-14.6+13.4)/2/16-.5,a=1-14.75/16-.5,l=1/2):(v=(1.4+29.4)/2/16,a=1-7.25/16-.5,l=0);let c=new qe.Mesh(new qe.PlaneGeometry(.85,1.75),new qe.MeshBasicMaterial({map:r,transparent:!0}));c.renderOrder=999;let u=.5/16,f=.25/16;t?c.position.set(0,v,a+f+.004):c.position.set(0,v,a+u/2+.004);let p=new qe.Group;return p.rotation.set(0,-qe.MathUtils.degToRad(e*(t?90:45/2)),0),p.add(c),p.bannerTexture=r,p.position.set(n.x+.5,n.y+l,n.z+.5),p}var yt=class yt{constructor(e,t,r,i,s=3){this.worldRenderer=e;this.scene=t;this.material=r;this.worldHeight=i;d(this,"meshPool",[]);d(this,"activeSections",new Map);d(this,"sectionObjects",{});d(this,"waitingChunksToDisplay",{});d(this,"pendingNearReveal",new Map);d(this,"nearRevealTimers",new Map);d(this,"nearRevealGraceTimers",new Map);d(this,"poolSize");d(this,"maxPoolSize");d(this,"minPoolSize");d(this,"signHeadsRenderer");d(this,"chunkBoxMaterial",new $.MeshBasicMaterial({color:0,transparent:!0,opacity:0}));d(this,"cubeShaderMaterial",null);d(this,"globalBlockBuffer",null);d(this,"shaderSectionRaycastBoxes",new Map);d(this,"blockRaycastVisitGen",new Uint16Array(4096));d(this,"blockRaycastVisitStamp",1);d(this,"hits",0);d(this,"misses",0);d(this,"bypassPooling",!1);d(this,"renderTimes",[]);d(this,"maxRenderTimeSamples",30);d(this,"_performanceOverrideDistance");d(this,"lastPerformanceCheck",0);d(this,"performanceCheckInterval",2e3);this.updateViewDistance(s),this.signHeadsRenderer=new sn(e),this.initializePool()}get performanceOverrideDistance(){return this._performanceOverrideDistance??0}set performanceOverrideDistance(e){this._performanceOverrideDistance=e,this.updateSectionsVisibility()}initializePool(){for(let e=0;e<this.poolSize;e++){let t=new $.BufferGeometry,r=new $.Mesh(t,this.material);r.visible=!1,r.matrixAutoUpdate=!1,r.name="pooled-section-mesh";let i={mesh:r,inUse:!1,lastUsedTime:0};this.meshPool.push(i)}}sectionHasRenderableContent(e){return e.positions.length>0?!0:this.isShaderCubesGpuEnabled()?(e.shaderCubes?.count??0)>0:!1}isShaderCubesGpuEnabled(){return this.worldRenderer.shaderCubeBlocksEnabled()}syncCubeShaderUniforms(){if(!this.isShaderCubesGpuEnabled())return;let e=this.cubeShaderMaterial??this.getCubeShaderMaterial();if(!e)return;let t=this.material.map??null;e.uniforms.u_atlas.value=t;let r=nr();if(!r)return;let{tintPalette:i}=r;i.isReady()||i.createTexture(),e.uniforms.u_tintPalette.value=i.getTexture(),e.uniforms.u_debugMode.value=this.worldRenderer.worldRendererConfig.shaderCubeDebugMode??0,e.needsUpdate=!0}getCubeShaderMaterial(){return this.isShaderCubesGpuEnabled()?(this.cubeShaderMaterial||(this.cubeShaderMaterial=$1(),this.syncCubeShaderUniforms()),this.cubeShaderMaterial):null}getGlobalBlockBuffer(){let e=this.getCubeShaderMaterial();return e?(this.globalBlockBuffer||(this.globalBlockBuffer=new or(e,this.scene)),this.globalBlockBuffer):null}shouldDeferShaderToPerSection(e){let t=this.worldRenderer.getModule("futuristicReveal");return t?t.isInInitialRevealCampaign?.()?!0:t.shouldUseRevealEffect?.(e)===!0:!1}migrateDeferredShaderToGlobal(e){let t=this.sectionObjects[e];if(!t?.deferredShaderCubes)return;let{words:r,count:i}=t.deferredShaderCubes,s=t.worldX,o=t.worldY,v=t.worldZ;s!==void 0&&o!==void 0&&v!==void 0&&this.registerShaderSectionRaycastBox(e,r,i,s,o,v),this.getGlobalBlockBuffer()?.addSection(e,r,i);let l=t.mesh===t.shaderMesh;t.shaderMesh&&(Zi(t.shaderMesh),t.remove(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,l&&(t.mesh=void 0)}registerShaderSectionRaycastBox(e,t,r,i,s,o){let v=wa(t,r,i,s,o);v?this.shaderSectionRaycastBoxes.set(e,{box:v,sectionCenterX:i,sectionCenterY:s,sectionCenterZ:o}):this.shaderSectionRaycastBoxes.delete(e)}unregisterShaderSectionRaycastBox(e){this.shaderSectionRaycastBoxes.delete(e)}raycastShaderSectionAABBs(e,t,r,i=80){let s=e.x,o=e.y,v=e.z,a=t.x,l=t.y,c=t.z,u=i*i,f=r,p=!1;this.blockRaycastVisitStamp++,this.blockRaycastVisitStamp>=65535&&(this.blockRaycastVisitGen.fill(0),this.blockRaycastVisitStamp=1);for(let[g,y]of this.shaderSectionRaycastBoxes){let A=this.sectionObjects[g];if(A&&!A.visible)continue;let{box:b}=y,_=b.cx-s,S=b.cy-o,C=b.cz-v;if(_*_+S*S+C*C>u)continue;let M=tn(s,o,v,a,l,c,b.minX,b.minY,b.minZ,b.maxX,b.maxY,b.maxZ,f);if(M===void 0&&ar(s,o,v,b.minX,b.minY,b.minZ,b.maxX,b.maxY,b.maxZ)){let P=this.globalBlockBuffer,B=P?.getSectionSlot(g);if(P&&B)M=rn(P.getW0(),B.start,B.count,1,y.sectionCenterX,y.sectionCenterY,y.sectionCenterZ,s,o,v,a,l,c,f,this.blockRaycastVisitGen,this.blockRaycastVisitStamp);else{let H=this.sectionObjects[g]?.deferredShaderCubes;H&&(M=rn(H.words,0,H.count,Xt,y.sectionCenterX,y.sectionCenterY,y.sectionCenterZ,s,o,v,a,l,c,f,this.blockRaycastVisitGen,this.blockRaycastVisitStamp))}}M!==void 0&&M<f&&(f=M,p=!0)}return p?f:void 0}updateSection(e,t){let r=t.positions.length>0,i=t.shaderCubes,s=this.isShaderCubesGpuEnabled()&&(i?.count??0)>0;if(!r&&!s)return this.releaseSection(e),null;let o=this.sectionObjects[e];o&&this.cleanupSection(e),r||this.releasePooledMesh(e);let v;if(r){let A=this.activeSections.get(e);if(!A){if(A=this.acquireMesh(),!A)return null;this.activeSections.set(e,A),A.sectionKey=e}let{mesh:b}=A;this.updateGeometryAttribute(b.geometry,"position",t.positions,3),this.updateGeometryAttribute(b.geometry,"normal",t.normals,3),this.updateGeometryAttribute(b.geometry,"color",t.colors,3),this.updateGeometryAttribute(b.geometry,"uv",t.uvs,2),b.geometry.index=new $.BufferAttribute(t.indices,1),b.geometry.boundingBox=new $.Box3(new $.Vector3(-8,-8,-8),new $.Vector3(8,8,8)),b.geometry.boundingSphere=new $.Sphere(new $.Vector3(0,0,0),Math.sqrt(3*8**2)),this.worldRenderer.sceneOrigin.track(b,{updateMatrix:!0}),b.position.set(t.sx,t.sy,t.sz),b.updateMatrix(),b.visible=!0,b.name="mesh",A.lastUsedTime=performance.now(),v=b}let a=s?this.getCubeShaderMaterial():null,l,c=s&&this.shouldDeferShaderToPerSection(e);s&&i&&(c&&a?(l=sr(i,a),l.visible=!0):this.getGlobalBlockBuffer()?.addSection(e,i.words,i.count)),o=new $.Group,v&&(o.add(v),o.mesh=v),l&&(o.add(l),o.shaderMesh=l,i&&(o.deferredShaderCubes={words:i.words,count:i.count}),o.mesh||(o.mesh=l)),s&&i&&this.registerShaderSectionRaycastBox(e,i.words,i.count,t.sx,t.sy,t.sz);let u=0;r&&(u+=t.positions.length/3/4),s&&i&&(u+=i.count),o.tilesCount=u,o.blocksCount=t.blocksCount,o.worldX=t.sx,o.worldY=t.sy,o.worldZ=t.sz,o.sectionKey=e,o.name="chunk";try{if(Object.keys(t.signs).length>0){let A=new $.Group;A.name="signs";for(let[b,{isWall:_,isHanging:S,rotation:C}]of Object.entries(t.signs)){let M=this.worldRenderer.blockEntities[b];if(!M)continue;let[P,B,H]=b.split(","),G=this.signHeadsRenderer.renderSign(new nn(+P,+B,+H),C,_,S,lr.simplify(M));G&&A.add(G)}o.add(A),o.signsContainer=A}if(Object.keys(t.heads).length>0){let A=new $.Group;A.name="heads";for(let[b,{isWall:_,rotation:S}]of Object.entries(t.heads)){let C=this.worldRenderer.blockEntities[b];if(!C)continue;let[M,P,B]=b.split(","),H=this.signHeadsRenderer.renderHead(new nn(+M,+P,+B),S,_,lr.simplify(C));H&&A.add(H)}o.add(A),o.headsContainer=A}if(Object.keys(t.banners).length>0){let A=new $.Group;A.name="banners",o.bannersContainer=A,o.add(A);for(let[b,{isWall:_,rotation:S,blockName:C}]of Object.entries(t.banners)){let M=this.worldRenderer.blockEntities[b];if(!M)continue;let[P,B,H]=b.split(","),G=Ra(this.worldRenderer,C,lr.simplify(M));if(!G)continue;let O=Ta(new nn(+P,+B,+H),S,_,G),{x:j,y:J,z:Z}=O.position;this.worldRenderer.sceneOrigin.track(O),O.position.set(j,J,Z),A.add(O)}}}catch{}this.sectionObjects[e]=o,this.scene.add(o),o.matrixAutoUpdate=!1,this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&this.updateBoxHelper(e,!0);let f=e.split(","),p=`${f[0]},${f[2]}`,g=!!this.worldRenderer.displayOptions?.inWorldRenderingConfig?._renderByChunks,y=!!this.worldRenderer.worldRendererConfig?.wasmMesher;if((g||y)&&!this.worldRenderer.finishedChunks[p]){o.visible=!1,o._waitingForChunkDisplay=!0;let A=this.waitingChunksToDisplay[p]??(this.waitingChunksToDisplay[p]=[]);A.includes(e)||A.push(e)}return o}finishChunkDisplay(e){if(!this.waitingChunksToDisplay[e]){this.tryRevealPending();return}if(this.isWasmGateActive()&&this.isBlockedByNearer(e,0)){this.pendingNearReveal.set(e,Date.now()),this.armNearRevealTimer(e),this.armExpectedGraceTimer(e),this.tryRevealPending();return}this.flushChunkDisplay(e),this.tryRevealPending()}flushChunkDisplay(e){let t=this.waitingChunksToDisplay[e];if(this.pendingNearReveal.delete(e),this.clearNearRevealTimer(e),this.clearExpectedGraceTimer(e),!!t){for(let r of t){let i=this.sectionObjects[r];i&&(i._waitingForChunkDisplay=!1,i.visible=!0)}delete this.waitingChunksToDisplay[e]}}tryRevealPending(){if(this.pendingNearReveal.size===0)return;let e=Date.now();for(let[t,r]of[...this.pendingNearReveal])this.isBlockedByNearer(t,e-r)||this.flushChunkDisplay(t)}onChunkRemovedFromGate(e){this.pendingNearReveal.delete(e),this.clearNearRevealTimer(e),this.clearExpectedGraceTimer(e),delete this.waitingChunksToDisplay[e],this.tryRevealPending()}isWasmGateActive(){return!!this.worldRenderer.worldRendererConfig?.wasmMesher}isBlockedByNearer(e,t){let r=this.worldRenderer.viewerChunkPosition;if(!r)return!1;let i=e.split(",");if(i.length!==2)return!1;let s=Number(i[0]),o=Number(i[1]),v=Math.floor(r.x/16),a=Math.floor(r.z/16),l=(s>>4)-v,c=(o>>4)-a,u=l*l+c*c;if(u===0)return!1;let f=this.worldRenderer.finishedChunks,p=this.worldRenderer.loadedChunks,g=this.worldRenderer.viewDistance;if(t<yt.EXPECTED_NEAR_GRACE_MS&&g>0){let A=g*g,b=Math.min(g,Math.ceil(Math.sqrt(Math.max(0,u-1))));for(let _=-b;_<=b;_++)for(let S=-b;S<=b;S++){let C=_*_+S*S;if(C>=u||C>A)continue;let M=v+_<<4,P=a+S<<4,B=`${M},${P}`;if(B!==e&&p[B]&&!f[B])return!0}return!1}for(let A in p){if(A===e||f[A])continue;let b=A.split(",");if(b.length!==2)continue;let _=(Number(b[0])>>4)-v,S=(Number(b[1])>>4)-a;if(_*_+S*S<u)return!0}return!1}armNearRevealTimer(e){if(this.nearRevealTimers.has(e))return;let t=setTimeout(()=>{this.nearRevealTimers.delete(e),this.pendingNearReveal.has(e)&&(this.flushChunkDisplay(e),this.tryRevealPending())},yt.NEAR_REVEAL_TIMEOUT_MS);this.nearRevealTimers.set(e,t)}clearNearRevealTimer(e){let t=this.nearRevealTimers.get(e);t&&(clearTimeout(t),this.nearRevealTimers.delete(e))}armExpectedGraceTimer(e){if(this.nearRevealGraceTimers.has(e))return;let t=setTimeout(()=>{this.nearRevealGraceTimers.delete(e),this.pendingNearReveal.has(e)&&this.tryRevealPending()},yt.EXPECTED_NEAR_GRACE_MS+50);this.nearRevealGraceTimers.set(e,t)}clearExpectedGraceTimer(e){let t=this.nearRevealGraceTimers.get(e);t&&(clearTimeout(t),this.nearRevealGraceTimers.delete(e))}cleanupSection(e){let t=this.sectionObjects[e];if(t){if(t._waitingForChunkDisplay){let r=e.split(","),i=`${r[0]},${r[2]}`,s=this.waitingChunksToDisplay[i];if(s){let o=s.indexOf(e);o!==-1&&s.splice(o,1),s.length===0&&delete this.waitingChunksToDisplay[i]}}if(t.bannersContainer&&(t.bannersContainer.traverse(r=>{r.bannerTexture&&ka(r.bannerTexture)}),this.disposeContainer(t.bannersContainer)),this.globalBlockBuffer?.removeSection(e),this.unregisterShaderSectionRaycastBox(e),t.shaderMesh&&(Zi(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,t.signsContainer&&this.disposeContainer(t.signsContainer),t.headsContainer&&this.disposeContainer(t.headsContainer),this.worldRenderer.sceneOrigin.removeAndUntrackAll(t),this.scene.remove(t),t.boxHelper){this.worldRenderer.sceneOrigin.removeAndUntrack(t.boxHelper),this.scene.remove(t.boxHelper),t.boxHelper.geometry.dispose();let r=t.boxHelper.material;if(Array.isArray(r))for(let i of r)i.dispose();else r.dispose();t.boxHelper=void 0}delete this.sectionObjects[e]}}releasePooledMesh(e){let t=this.activeSections.get(e);t&&(t.mesh.visible=!1,t.inUse=!1,t.sectionKey=void 0,t.lastUsedTime=0,this.clearGeometry(t.mesh.geometry),this.activeSections.delete(e),this.cleanupExcessMeshes())}releaseSection(e){this.cleanupSection(e);let t=this.activeSections.get(e);return t?(t.mesh.visible=!1,t.inUse=!1,t.sectionKey=void 0,t.lastUsedTime=0,this.clearGeometry(t.mesh.geometry),this.activeSections.delete(e),this.cleanupExcessMeshes(),!0):!1}getSectionObject(e){return this.sectionObjects[e]}updateBoxHelper(e,t,r=this.chunkBoxMaterial){let i=this.sectionObjects[e];if(i?.mesh)if(t){if(!i.boxHelper){let s=new $.Mesh(new $.BoxGeometry(16,16,16),r),o=new $.BoxHelper(s,16776960);o.name="helper";let v=i.worldX??0,a=i.worldY??0,l=i.worldZ??0;this.worldRenderer.sceneOrigin.track(o,{updateMatrix:!0}),o.position.set(v,a,l),o.updateMatrix(),this.scene.add(o),i.boxHelper=o}i.boxHelper.visible=!0}else i.boxHelper&&(i.boxHelper.visible=!1)}updateAllBoxHelpers(e){for(let t of Object.keys(this.sectionObjects))this.updateBoxHelper(t,e)}cleanSignChunkTextures(e,t){this.signHeadsRenderer.cleanChunkTextures(e,t)}getSectionMesh(e){return this.activeSections.get(e)?.mesh}hasSection(e){return this.activeSections.has(e)}updateViewDistance(e){let t=(e*2+1)**2,r=this.worldHeight/16,i=5;if(this.minPoolSize=Math.floor(t*i),this.maxPoolSize=Math.floor(t*r)+1,this.poolSize??(this.poolSize=this.minPoolSize),this.minPoolSize>this.poolSize){let s=Math.min(this.minPoolSize,this.maxPoolSize);this.expandPool(s)}}getStats(){let e=this.meshPool.filter(i=>!i.inUse).length,t=this.hits+this.misses>0?(this.hits/(this.hits+this.misses)*100).toFixed(1):"0",r=this.getEstimatedMemoryUsage();return{poolSize:this.poolSize,activeCount:this.activeSections.size,freeCount:e,hitRate:`${t}%`,hits:this.hits,misses:this.misses,memoryUsage:r}}getTotalTiles(){return Object.values(this.sectionObjects).reduce((e,t)=>e+(t.tilesCount||0),0)}getTotalBlocks(){return Object.values(this.sectionObjects).reduce((e,t)=>e+(t.blocksCount||0),0)}getEstimatedMemoryUsage(){let e=0,t=0,r=0,i=0,s=0,o=0,v=0,a=this.globalBlockBuffer?.mesh.geometry;if(a)for(let c of["a_w0","a_w1","a_w2","a_w3"]){let u=a.getAttribute(c);if(u){let f=u.array.byteLength;v+=f,e+=f}}for(let c of Object.values(this.sectionObjects)){let u=c.shaderMesh?.geometry;if(u)for(let f of["a_w0","a_w1","a_w2","a_w3"]){let p=u.getAttribute(f);if(p){let g=p.array.byteLength;v+=g,e+=g}}}for(let c of this.meshPool)if(c.inUse&&c.mesh.geometry){let{geometry:u}=c.mesh,f=u.getAttribute("position");if(f){let A=f.array.byteLength;t+=A,e+=A}let p=u.getAttribute("normal");if(p){let A=p.array.byteLength;r+=A,e+=A}let g=u.getAttribute("color");if(g){let A=g.array.byteLength;i+=A,e+=A}let y=u.getAttribute("uv");if(y){let A=y.array.byteLength;s+=A,e+=A}if(u.index){let A=u.index.array.byteLength;o+=A,e+=A}}return{total:`${(e/(1024*1024)).toFixed(2)} MB`,breakdown:{position:`${(t/(1024*1024)).toFixed(2)} MB`,normal:`${(r/(1024*1024)).toFixed(2)} MB`,color:`${(i/(1024*1024)).toFixed(2)} MB`,uv:`${(s/(1024*1024)).toFixed(2)} MB`,index:`${(o/(1024*1024)).toFixed(2)} MB`,shaderInstances:`${(v/(1024*1024)).toFixed(2)} MB`}}}dispose(){let e=[...this.activeSections.keys()];for(let t of e)this.releaseSection(t);this.signHeadsRenderer.dispose();for(let t of this.meshPool)t.mesh.geometry.dispose();this.meshPool.length=0,this.activeSections.clear(),this.chunkBoxMaterial.dispose(),this.shaderSectionRaycastBoxes.clear(),this.globalBlockBuffer?.dispose(),this.globalBlockBuffer=null,this.cubeShaderMaterial?.dispose(),this.cubeShaderMaterial=null,this.pendingNearReveal.clear();for(let t of this.nearRevealTimers.values())clearTimeout(t);this.nearRevealTimers.clear();for(let t of this.nearRevealGraceTimers.values())clearTimeout(t);this.nearRevealGraceTimers.clear()}acquireMesh(){if(this.bypassPooling){let t={mesh:new $.Mesh(new $.BufferGeometry,this.material),inUse:!0,lastUsedTime:performance.now()};return this.meshPool.push(t),this.poolSize++,t}for(let t of this.meshPool)if(!t.inUse)return t.inUse=!0,t.lastUsedTime=performance.now(),this.hits++,t;this.misses++;let e=Math.min(this.poolSize+16,this.maxPoolSize);e<=this.meshPool.length&&(e=this.meshPool.length+8,this.maxPoolSize=e),this.expandPool(e);for(let t=this.meshPool.length-1;t>=0;t--){let r=this.meshPool[t];if(!r.inUse)return r.inUse=!0,r.lastUsedTime=performance.now(),r}throw new Error("ChunkMeshManager: Failed to acquire mesh after pool expansion")}expandPool(e){let t=this.meshPool.length;this.poolSize=e;for(let r=t;r<e;r++){let i=new $.BufferGeometry,s=new $.Mesh(i,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(e,t,r,i){let s=e.getAttribute(t);s&&s.count===r.length/i?(s.array.set(r),s.needsUpdate=!0):e.setAttribute(t,new $.BufferAttribute(r,i))}clearGeometry(e){let t=["position","normal","color","uv"];for(let r of t)e.hasAttribute(r)&&e.deleteAttribute(r);e.index&&e.setIndex(null),e.boundingBox=null,e.boundingSphere=null}cleanupExcessMeshes(){if(this.poolSize>this.maxPoolSize){let e=this.meshPool.filter(t=>!t.inUse).length;if(e>0){let t=Math.min(this.poolSize-this.maxPoolSize,e);for(let r=0;r<t;r++){let i=this.meshPool.findIndex(s=>!s.inUse);i!==-1&&(this.meshPool[i].mesh.geometry.dispose(),this.meshPool.splice(i,1),this.poolSize--)}}}}disposeContainer(e){ke(e,!0)}recordRenderTime(e){this.renderTimes.push(e),this.renderTimes.length>this.maxRenderTimeSamples&&this.renderTimes.shift();let t=performance.now();t-this.lastPerformanceCheck>this.performanceCheckInterval&&(this.checkPerformance(),this.lastPerformanceCheck=t)}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((e,t)=>e+t,0)/this.renderTimes.length}checkPerformance(){if(this.renderTimes.length<this.maxRenderTimeSamples)return;let e=this.getAverageRenderTime(),t=16.67,r=t*1.5;if(e>r){let i=this.worldRenderer.viewDistance,s=Math.max(1,Math.floor(i*.8));(!this.performanceOverrideDistance||s<this.performanceOverrideDistance)&&(this.performanceOverrideDistance=s)}else if(this.performanceOverrideDistance&&e<t*1.1){let i=this.worldRenderer.viewDistance,s=Math.min(i,this.performanceOverrideDistance+1);s!==this.performanceOverrideDistance&&(this.performanceOverrideDistance=s>=i?void 0:s)}}updateSectionsVisibility(){let e=this.worldRenderer.cameraSectionPos;for(let[t,r]of Object.entries(this.sectionObjects)){if(r._waitingForChunkDisplay){r.visible=!1;continue}if(!this.performanceOverrideDistance){r.visible=!0;continue}let[i,s,o]=t.split(",").map(Number),v={x:i/16,y:s/16,z:o/16},a=v.x-e.x,l=v.z-e.z,c=Math.floor(Math.hypot(a,l));r.visible=c<=this.performanceOverrideDistance}}};d(yt,"NEAR_REVEAL_TIMEOUT_MS",5e3),d(yt,"EXPECTED_NEAR_GRACE_MS",1500);var K5=yt,sn=class{constructor(e){this.worldRendererThree=e;d(this,"chunkTextures",new Map)}dispose(){for(let[,e]of this.chunkTextures)for(let t of Object.keys(e))e[t].dispose();this.chunkTextures.clear()}renderHead(e,t,r,i){let s;if(i.SkullOwner?s=i.SkullOwner.Properties?.textures?.[0]?.Value:s=i.profile?.properties?.find(o=>o.name==="textures")?.value,!!s)try{let v=JSON.parse(z.from(s,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:a}=this.worldRendererThree.worldRendererConfig;a&&(v=v?.replace("http://textures.minecraft.net/",a).replace("https://textures.minecraft.net/",a));let l=F0(this.worldRendererThree,v,z0.head),c=new $.Group;return r&&l.position.set(0,.3125,.3125),l.position.y-=23/16,c.add(l),this.worldRendererThree.sceneOrigin.track(c),c.position.set(e.x+.5,e.y+.045,e.z+.5),c.rotation.set(0,-$.MathUtils.degToRad(t*(r?90:45/2)),0),c.scale.set(.8,.8,.8),c}catch{}}renderSign(e,t,r,i,s){let o=this.getSignTexture(e,s,i);if(!o)return;let v=new $.Mesh(new $.PlaneGeometry(1,1),new $.MeshBasicMaterial({map:o,transparent:!0}));v.renderOrder=999;let a=7/16,l=i?1.3:1;v.scale.set(1*l,a*l,1*l);let c=(i?2:1.5)/16,u=.25/16;r&&!i?v.position.set(0,0,-.5+c+u+1e-4):v.position.set(0,0,c/2+1e-4);let f=new $.Group;f.rotation.set(0,-$.MathUtils.degToRad(t*(r?90:45/2)),0),f.add(v);let p=(i?10:8)/16,g=(i?0:r?4.333:9.333)/16,y=p/2+g;return this.worldRendererThree.sceneOrigin.track(f),f.position.set(e.x+.5,e.y+y,e.z+.5),f}getSignTexture(e,t,r,i=!1){let s=Ot(e),o=this.chunkTextures.get(`${s[0]},${s[1]}`);o||(o={},this.chunkTextures.set(`${s[0]},${s[1]}`,o));let v=`${e.x},${e.y},${e.z}`;if(o[v])return o[v];let a=Qv(this.worldRendererThree.version),l=g1(t,r,a);if(!l)return;let c=new $.Texture(l);return c.magFilter=$.NearestFilter,c.minFilter=$.NearestFilter,c.needsUpdate=!0,o[v]=c,c}cleanChunkTextures(e,t){let r=`${Math.floor(e/16)},${Math.floor(t/16)}`,i=this.chunkTextures.get(r);if(i)for(let s of Object.keys(i))i[s].dispose(),delete i[s]}};E();x();k();R();E();x();k();R();import*as G0 from"three";var cr={},Ma=!1;function Kv(){if(Ma)return;let n=globalThis.loadedData?.tints;if(n){for(let e of Object.keys(n))cr[e]=Jv(n[e]);Ma=!0}}function Jv(n){let e={},t=Sa(n.default??16777215);if(n.data)for(let r of n.data){let i=Sa(r.color);for(let s of r.keys)e[s]=i}return new Proxy(e,{get(r,i){return r[i]??t}})}function Sa(n){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255]}function Ca(n,e){return Kv(),n==="grass_block"?[1,1,1]:n==="redstone_wire"?[1,1,1]:n==="birch_leaves"||n==="spruce_leaves"||n==="lily_pad"?cr.constant?.[n]??[1,1,1]:n.includes("leaves")||n==="vine"?cr.foliage?.[e]??[1,1,1]:["short_grass","tall_grass","fern","large_fern","sugar_cane","grass"].includes(n)?cr.grass?.[e]??[1,1,1]:[1,1,1]}var Zv=512,on=1/20,an=class{constructor(e){this.worldRenderer=e;d(this,"particles",[]);d(this,"sharedMaterial");d(this,"enabled",!1);d(this,"tickAccumulator",0);d(this,"nextParticleIndex",0);d(this,"render",e=>{if(!this.enabled)return;for(this.tickAccumulator+=e;this.tickAccumulator>=on;)this.tickAccumulator-=on,this.tickPhysics();let t=this.tickAccumulator/on;this.updateVisuals(t)})}enable(){this.enabled||(this.enabled=!0,this.ensureMaterial())}disable(){this.enabled&&(this.enabled=!1)}dispose(){for(let e of this.particles)e.active&&this.worldRenderer.sceneOrigin.removeAndUntrack(e.mesh),e.mesh.geometry.dispose();this.particles=[],this.sharedMaterial?.dispose(),this.sharedMaterial=void 0,this.nextParticleIndex=0}spawnBlockBreakParticles(e,t,r,i,s,o="plains"){if(!this.enabled)return;let v=this.resolveBlockTexture(i);if(!v)return;let a=Ca(i,o);for(let l=0;l<4;l++)for(let c=0;c<4;c++)for(let u=0;u<4;u++){let f=e+(l+.5)/4,p=t+(c+.5)/4,g=r+(u+.5)/4,y=f-e-.5,A=p-t-.5,b=g-r-.5;y+=(Math.random()*2-1)*.4,A+=(Math.random()*2-1)*.4,b+=(Math.random()*2-1)*.4;let _=(Math.random()+Math.random()+1)*.15,S=Math.sqrt(y*y+A*A+b*b),C=y/S*_*.4,M=A/S*_*.4+.1,P=b/S*_*.4,B=Math.floor(4/(Math.random()*.9+.1));this.createParticle(f,p,g,C,M,P,B,v,s,e,r,1,a)}}tickPhysics(){for(let e of this.particles){if(!e.active)continue;if(e.prevX=e.x,e.prevY=e.y,e.prevZ=e.z,e.age++,e.age>=e.maxAge){this.deactivateParticle(e);continue}e.yd-=.04,e.x+=e.xd,e.y+=e.yd,e.z+=e.zd;let t=this.getFloorY(e);e.y<=t?(e.y=t,e.yd=0,e.onGround=!0):e.onGround=!1,e.xd*=.98,e.yd*=.98,e.zd*=.98,e.onGround&&(e.xd*=.7,e.zd*=.7)}}updateVisuals(e){let t=this.worldRenderer.camera.position;for(let r of this.particles){if(!r.active)continue;let i=r.prevX+(r.x-r.prevX)*e,s=r.prevY+(r.y-r.prevY)*e,o=r.prevZ+(r.z-r.prevZ)*e;r.mesh.position.set(i,s,o),r.mesh.lookAt(t.x,t.y,t.z)}}spawnCrackParticle(e,t,r,i,s,o,v="plains"){if(!this.enabled)return;let a=this.resolveBlockTexture(s);if(!a)return;let l=Ca(s,v),c=e+Math.random()*.8+.1,u=t+Math.random()*.8+.1,f=r+Math.random()*.8+.1;switch(i){case 0:u=t-.1;break;case 1:u=t+1+.1;break;case 2:f=r-.1;break;case 3:f=r+1+.1;break;case 4:c=e-.1;break;case 5:c=e+1+.1;break}let p=(Math.random()*2-1)*.4*.2,g=(Math.random()*2-1)*.4*.2+.1*.2,y=(Math.random()*2-1)*.4*.2,A=Math.floor(4/(Math.random()*.9+.1));this.createParticle(c,u,f,p,g,y,A,a,o,e,r,.6,l)}createParticle(e,t,r,i,s,o,v,a,l,c,u,f=1,p=[1,1,1]){this.ensureMaterial();let g=this.findInactiveParticle();g||(this.particles.length<Zv?g=this.allocateParticle():g=this.recycleOldest());let y=Math.floor(Math.random()*4),A=Math.floor(Math.random()*4),b=a.u+y/4*a.su,_=a.v+A/4*a.sv,S=a.su/4,C=a.sv/4;this.setGeometryUVs(g.mesh.geometry,b,_,S,C),g.active=!0,g.x=e,g.y=t,g.z=r,g.prevX=e,g.prevY=t,g.prevZ=r,g.xd=i,g.yd=s,g.zd=o,g.age=0,g.maxAge=v,g.onGround=!1,g.floorMap=l,g.blockX=Math.floor(c),g.blockZ=Math.floor(u);let M=.1*(.5+Math.random()*.5)*2*f;g.mesh.scale.set(M,M,M),g.mesh.position.set(e,t,r),g.mesh.visible=!0;let P=.6*p[0],B=.6*p[1],H=.6*p[2],G=new Float32Array([P,B,H,P,B,H,P,B,H,P,B,H]),O=g.mesh.geometry.getAttribute("color");O?(O.set(G),O.needsUpdate=!0):g.mesh.geometry.setAttribute("color",new G0.Float32BufferAttribute(G,3)),this.worldRenderer.sceneOrigin.addAndTrack(g.mesh)}allocateParticle(){let e=new G0.PlaneGeometry(1,1),t=new G0.Mesh(e,this.sharedMaterial);t.visible=!1;let r={mesh:t,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(r),r}findInactiveParticle(){for(let e=0;e<this.particles.length;e++){let t=(this.nextParticleIndex+e)%this.particles.length;if(!this.particles[t].active)return this.nextParticleIndex=(t+1)%this.particles.length,this.particles[t]}}recycleOldest(){let e=this.particles[0];for(let t of this.particles)t.age>e.age&&(e=t);return this.deactivateParticle(e),e}deactivateParticle(e){e.active&&(e.active=!1,e.mesh.visible=!1,this.worldRenderer.sceneOrigin.removeAndUntrack(e.mesh))}getFloorY(e){let t=Math.floor(e.x)-e.blockX,r=Math.floor(e.z)-e.blockZ;return t=Math.max(-2,Math.min(2,t)),r=Math.max(-2,Math.min(2,r)),e.floorMap[(r+2)*5+(t+2)]}resolveBlockTexture(e){let t=this.worldRenderer.resourcesManager.currentResources;if(!t)return null;let r=t.blocksAtlasJson,i=r.textures;if(i[e])return this.extractUV(i[e],r);for(let s of["_side","_top","_front","_0",""]){let o=e+s;if(i[o])return this.extractUV(i[o],r)}for(let s of Object.keys(i))if(s.startsWith(e))return this.extractUV(i[s],r);return null}extractUV(e,t){return{u:e.u,v:e.v,su:e.su??t.suSv,sv:e.sv??t.suSv}}setGeometryUVs(e,t,r,i,s){let o=e.getAttribute("uv");o.setXY(0,t,r),o.setXY(1,t+i,r),o.setXY(2,t,r+s),o.setXY(3,t+i,r+s),o.needsUpdate=!0}ensureMaterial(){if(this.sharedMaterial)return;let e=this.worldRenderer.material.map;e&&(this.sharedMaterial=new G0.MeshBasicMaterial({map:e,vertexColors:!0,transparent:!0,alphaTest:.1}))}},Ba={id:"blockBreakParticles",controller:an,enabledDefault:!0,cannotBeDisabled:!0,requiresHeightmap:!1};E();x();k();R();var vn=class{constructor(e){this.worldRenderer=e;d(this,"enabled",!1);d(this,"lastBobWalkDist",0);d(this,"lastBobTickTime",0);d(this,"render",()=>{if(!this.enabled)return;let e=this.worldRenderer.displayOptions.inWorldRenderingConfig,{perspective:t}=this.worldRenderer.playerStateReactive;if(e.viewBobbing&&t==="first_person"&&!this.worldRenderer.playerStateUtils.isSpectator()){this.worldRenderer.playerStateReactive.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=performance.now(),this.lastBobWalkDist=this.worldRenderer.playerStateReactive.walkDist);let i=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:i})}else this.worldRenderer.cameraShake.setCameraBobInput(null)})}enable(){this.enabled=!0}disable(){this.enabled=!1,this.worldRenderer.cameraShake.setCameraBobInput(null);let{perspective:e}=this.worldRenderer.playerStateReactive;e==="first_person"&&this.worldRenderer.camera.position.set(0,0,0)}dispose(){this.disable()}},Pa={id:"cameraBobbing",controller:vn,enabledDefault:!0,cannotBeDisabled:!0};E();x();k();R();import*as Ie from"three";var ln=2e3,Ia=32,Ha=32,dr=12,Oa=24,ur=1.2,qv=-5;var cn=class{constructor(e){this.worldRenderer=e;d(this,"instancedMesh");d(this,"geometry");d(this,"material");d(this,"particles",[]);d(this,"enabled",!1);d(this,"dummy",new Ie.Matrix4);d(this,"tempPosition",new Ie.Vector3);d(this,"tempQuaternion",new Ie.Quaternion);d(this,"tempScale",new Ie.Vector3);d(this,"render",e=>{if(!this.enabled||!this.instancedMesh||!this.material)return;this.syncMaterialToSceneFog();let t=this.worldRenderer.getCameraPosition();this.instancedMesh.position.set(0,0,0);let r=this.worldRenderer.reactiveState.world.heightmaps,{dummy:i,tempPosition:s,tempQuaternion:o,tempScale:v}=this,a=NaN,l=NaN,c;for(let u=0;u<ln;u++){let f=this.particles[u];this.instancedMesh.getMatrixAt(u,i),i.decompose(s,o,v),s.addScaledVector(f.velocity,e);let p=s.y,g=Math.sqrt(s.x*s.x+s.z*s.z),y=t.x+s.x,A=t.y+s.y,b=t.z+s.z,_=Math.floor(y/16),S=Math.floor(b/16);(_!==a||S!==l)&&(c=r[`${_},${S}`],a=_,l=S);let C=(Math.floor(y)%16+16)%16,M=(Math.floor(b)%16+16)%16,P=c?.[M*16+C];if(g>Ia||P!==void 0&&P!==-32768&&A<=P+1+f.despawnOffset||p<qv){this.respawnParticle(s);let H=dr+Math.random()*(Oa-dr);f.velocity.set((Math.random()-.5)*ur,-H,(Math.random()-.5)*ur),f.despawnOffset=Math.random()*.5}i.compose(s,o,v),this.instancedMesh.setMatrixAt(u,i)}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 e=this.worldRenderer.scene.fog;e instanceof Ie.Fog||e instanceof Ie.FogExp2?this.material.color.copy(e.color):this.material.color.set(13426158),this.material.fog=!0}createRain(){this.geometry=new Ie.BoxGeometry(.03,.3,.03),this.material=new Ie.MeshBasicMaterial({color:13426158,transparent:!0,opacity:.35,depthWrite:!0,fog:!0}),this.instancedMesh=new Ie.InstancedMesh(this.geometry,this.material,ln),this.instancedMesh.name="rain-particles",this.instancedMesh.frustumCulled=!1,this.syncMaterialToSceneFog();let e=new Ie.Matrix4,t=new Ie.Vector3;for(let r=0;r<ln;r++){this.respawnParticle(t),t.y=Math.random()*Ha,e.setPosition(t),this.instancedMesh.setMatrixAt(r,e);let i=dr+Math.random()*(Oa-dr);this.particles.push({velocity:new Ie.Vector3((Math.random()-.5)*ur,-i,(Math.random()-.5)*ur),age:0,despawnOffset:Math.random()*.5})}this.instancedMesh.instanceMatrix.needsUpdate=!0,this.worldRenderer.scene.add(this.instancedMesh)}respawnParticle(e){let t=Math.random()*Math.PI*2,r=Math.random()*Ia;e.set(Math.cos(t)*r,Ha,Math.sin(t)*r)}},Da={id:"rain",controller:cn,enabledDefault:!1,requiresHeightmap:!0};E();x();k();R();import*as Ae from"three";var Fa=new Ae.Color(13/255,234/255,238/255),Xv=9;var $v=350,e9=650;var t9=120,r9=280,dn=class{constructor(e){this.worldRenderer=e;d(this,"pendingGeometries",new Map);d(this,"revealingSections",new Map);d(this,"finishedChunkCount",0);d(this,"revealTriggered",!1);d(this,"revealStartTime",0);d(this,"enabled",!1);d(this,"onWorldSwitchedCb",null);d(this,"patched",!1);d(this,"initialWaveDone",!1);d(this,"initialRevealWaveSettled",!1);d(this,"wireframeMaterial");d(this,"wireframeGlowMaterial");d(this,"pulseTime",0);d(this,"revealedChunks",new Set);d(this,"originalFinishChunk",null);d(this,"originalDestroy",null);d(this,"originalSceneAdd",null);d(this,"originalHandleWorkerMessage",null);d(this,"render",e=>{this.enabled&&this.update(e*1e3)});this.wireframeMaterial=new Ae.LineBasicMaterial({color:Fa,transparent:!0,opacity:1,blending:Ae.AdditiveBlending,depthWrite:!1}),this.wireframeGlowMaterial=new Ae.LineBasicMaterial({color:Fa,transparent:!0,opacity:.55,blending:Ae.AdditiveBlending,depthWrite:!1})}isFuturisticRevealConfigured(){return this.worldRenderer.worldRendererConfig.futuristicReveal===!0}isInInitialRevealCampaign(){return this.enabled&&!this.initialRevealWaveSettled}autoEnableCheck(){return this.isFuturisticRevealConfigured()}enable(){if(this.isFuturisticRevealConfigured()&&!(this.enabled&&this.patched)){if(this.enabled&&!this.patched){this.patchWorldRenderer();return}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 e=this.worldRenderer;this.onWorldSwitchedCb=()=>this.reset(),e.onWorldSwitched.push(this.onWorldSwitchedCb),this.originalFinishChunk=e.finishChunk.bind(e),e.finishChunk=t=>{this.originalFinishChunk(t),this.onChunkFinished(t)},this.originalDestroy=e.destroy.bind(e),e.destroy=()=>{this.dispose(),this.originalDestroy()},this.originalHandleWorkerMessage=e.handleWorkerMessage.bind(e),e.handleWorkerMessage=t=>{this.originalHandleWorkerMessage(t),this.enabled&&t?.type==="geometry"&&Promise.resolve().then(()=>{try{this.registerSection(t.key,t.geometry)}catch{}})},this.originalSceneAdd=e.scene.add.bind(e.scene),e.scene.add=(...t)=>{let r=this.originalSceneAdd(...t);for(let i of t)this.checkAndPatchMesh(i);return r}}unpatchWorldRenderer(){let e=this.worldRenderer;if(this.originalFinishChunk&&(e.finishChunk=this.originalFinishChunk,this.originalFinishChunk=null),this.originalDestroy&&(e.destroy=this.originalDestroy,this.originalDestroy=null),this.originalHandleWorkerMessage&&(e.handleWorkerMessage=this.originalHandleWorkerMessage,this.originalHandleWorkerMessage=null),this.originalSceneAdd&&(e.scene.add=this.originalSceneAdd,this.originalSceneAdd=null),this.onWorldSwitchedCb){let t=e.onWorldSwitched.indexOf(this.onWorldSwitchedCb);t!==-1&&e.onWorldSwitched.splice(t,1),this.onWorldSwitchedCb=null}this.patched=!1}checkAndPatchMesh(e){if(e instanceof Ae.Mesh&&(e.name==="mesh"||e.name==="shaderMesh")){let t=this.findSectionKeyForMesh(e);t&&this.shouldUseRevealEffect(t)&&(e.visible=!1,e.hiddenByReveal=!0)}for(let t of e.children)this.checkAndPatchMesh(t)}findSectionKeyForMesh(e){let t=e;for(;t;){let{sectionKey:p}=t;if(p&&this.worldRenderer.chunkMeshManager.sectionObjects[p]===t)return p;t=t.parent}let r=this.worldRenderer.sceneOrigin.getWorldPosition(e),i=r?.x??this.worldRenderer.sceneOrigin.toWorldX(e.position.x),s=r?.y??this.worldRenderer.sceneOrigin.toWorldY(e.position.y),o=r?.z??this.worldRenderer.sceneOrigin.toWorldZ(e.position.z),v=16,a=this.worldRenderer.getSectionHeight(),l=Math.floor(i/v)*v,c=Math.floor(s/a)*a,u=Math.floor(o/v)*v,f=`${l},${c},${u}`;return this.worldRenderer.chunkMeshManager.sectionObjects[f]?f:null}get scene(){return this.worldRenderer.realScene}getCameraPosition(){return this.worldRenderer.getCameraPosition()}sectionHasRevealContent(e){return(e.wireframePositions?.length??0)>0||(e.positions?.length??0)>0?!0:(e.shaderCubes?.count??0)>0}getSectionRenderMeshes(e){let t=this.worldRenderer.chunkMeshManager.sectionObjects[e];if(!t)return[];let r=[];for(let i of["mesh","shaderMesh"]){let s=t.children.find(o=>o.name===i);s instanceof Ae.Mesh&&r.push(s)}return r}hideSectionRenderMeshes(e){let t=this.getSectionRenderMeshes(e);for(let r of t)r.visible=!1,r.hiddenByReveal=!0;return t}setMeshFadeOpacity(e,t){if(e.name==="shaderMesh"){e.visible=t>.001;return}let r=e.material;if(!Array.isArray(r))if(r.originalMaterial)r.opacity=t,r.transparent=!0,r.needsUpdate=!0;else{r.originalMaterial=r;let i=r.clone();i.transparent=!0,i.opacity=t,i.needsUpdate=!0,e.material=i}}restoreMeshMaterial(e){let t=e.originalMaterial;if(!t)return;let r=e.material;e.material=t,r!==t&&r.dispose(),delete e.originalMaterial}onChunkFinished(e){this.finishedChunkCount++,!this.revealTriggered&&this.finishedChunkCount>=Xv&&this.triggerReveal()}registerSection(e,t){if(!(this.revealedChunks.has(e)||this.revealingSections.has(e))){if(this.revealTriggered&&this.initialWaveDone){this.revealedChunks.add(e);return}this.revealTriggered?this.startSectionReveal(e,t):this.pendingGeometries.set(e,t)}}shouldUseRevealEffect(e){return!this.enabled||this.revealTriggered&&this.initialWaveDone?!1:!this.revealedChunks.has(e)&&!this.revealingSections.has(e)}triggerReveal(){this.revealTriggered=!0,this.initialWaveDone=!0,this.revealStartTime=performance.now();let e=this.getCameraPosition(),t=[...this.pendingGeometries.entries()];this.pendingGeometries.clear();let r=t.map(([s,o])=>{let v=Math.hypot(o.sx-e.x,o.sy-e.y,o.sz-e.z);return{key:s,geometry:o,distance:v}}).sort((s,o)=>s.distance-o.distance),i=r.at(-1)?.distance||1;for(let{key:s,geometry:o,distance:v}of r){let a=v/i*1500;setTimeout(()=>{!this.revealedChunks.has(s)&&!this.revealingSections.has(s)&&this.startSectionReveal(s,o)},a)}}startSectionReveal(e,t){if(!this.sectionHasRevealContent(t)||this.revealingSections.has(e)||this.revealedChunks.has(e))return;let r=this.createWireframeGeometry(t),i=this.worldRenderer.chunkMeshManager.globalBlockBuffer,s=i?.hasSection(e)?i.takeSectionData(e):void 0,o=this.hideSectionRenderMeshes(e),v=new Ae.LineSegments(r,this.wireframeMaterial.clone());this.worldRenderer.sceneOrigin.track(v),v.position.set(t.sx,t.sy,t.sz),v.name="scifi-wireframe",v.renderOrder=1e3;let a=new Ae.LineSegments(r.clone(),this.wireframeGlowMaterial.clone());this.worldRenderer.sceneOrigin.track(a),a.position.set(t.sx,t.sy,t.sz),a.scale.set(1.02,1.02,1.02),a.name="scifi-glow",a.renderOrder=999;let l=new Ae.Group;l.add(v),l.add(a),l.name="scifi-reveal-group",l.sectionKey=e,this.scene.add(l);let c=this.initialWaveDone?t9:$v,u=this.initialWaveDone?r9:e9,f={key:e,wireframeGroup:l,revealStartTime:performance.now(),phase:"wireframe",renderMeshRefs:o,globalShaderRestore:s,wireframeMs:c,revealMs:u};setTimeout(()=>{for(let p of this.getSectionRenderMeshes(e))p.hiddenByReveal||this.hideSectionRenderMeshes(e)},0),this.revealingSections.set(e,f)}createSectionBoundsWireframe(){let r=[[-8,-8,-8],[8,-8,-8],[-8,8,-8],[8,8,-8],[-8,-8,8],[8,-8,8],[-8,8,8],[8,8,8]],i=[[0,1],[1,3],[3,2],[2,0],[4,5],[5,7],[7,6],[6,4],[0,4],[1,5],[2,6],[3,7]],s=[];for(let[v,a]of i)s.push(...r[v],...r[a]);let o=new Ae.BufferGeometry;return o.setAttribute("position",new Ae.Float32BufferAttribute(s,3)),o}createWireframeGeometry(e){if(e.wireframePositions&&e.wireframePositions.length>0){let v=new Ae.BufferGeometry;return v.setAttribute("position",new Ae.Float32BufferAttribute(e.wireframePositions,3)),v}let t=e.positions,r=e.indices;if(!t?.length||!r?.length)return this.createSectionBoundsWireframe();let i=[],s=new Set;for(let v=0;v<r.length;v+=3){let a=r[v],l=r[v+1],c=r[v+2];this.addEdge(t,a,l,i,s),this.addEdge(t,l,c,i,s),this.addEdge(t,c,a,i,s)}let o=new Ae.BufferGeometry;return o.setAttribute("position",new Ae.Float32BufferAttribute(i,3)),o}addEdge(e,t,r,i,s){let o=Math.min(t,r),v=Math.max(t,r),a=`${o}-${v}`;s.has(a)||(s.add(a),i.push(e[t*3],e[t*3+1],e[t*3+2],e[r*3],e[r*3+1],e[r*3+2]))}update(e){if(!this.enabled||this.revealingSections.size===0)return;this.pulseTime+=e*.001;let t=performance.now(),r=.6+.4*Math.sin(this.pulseTime*4),i=[];for(let[s,o]of this.revealingSections){let v=t-o.revealStartTime;if(o.phase==="wireframe"){let a=o.wireframeGroup.children[0],l=o.wireframeGroup.children[1];if(a?.material){let c=a.material;c.opacity=r;let u=.85+.15*Math.sin(this.pulseTime*6+v*.002);c.color.setRGB(13/255*u,234/255*u,238/255*u)}if(l?.material){let c=l.material;c.opacity=r*.4}if(v>o.wireframeMs){o.phase="transitioning",o.renderMeshRefs=this.getSectionRenderMeshes(s);for(let c of o.renderMeshRefs)c.visible=!0,this.setMeshFadeOpacity(c,0)}}else if(o.phase==="transitioning"){let a=v-o.wireframeMs,l=Math.min(1,a/o.revealMs),c=1-(1-l)**3,u=o.wireframeGroup.children[0],f=o.wireframeGroup.children[1];if(u?.material){let p=u.material;p.opacity=1-c}if(f?.material){let p=f.material;p.opacity=(1-c)*.55}for(let p of o.renderMeshRefs)this.setMeshFadeOpacity(p,c);l>=1&&(o.phase="complete",i.push(o))}}for(let s of i)this.completeReveal(s)}completeReveal(e){this.revealingSections.delete(e.key),this.revealedChunks.add(e.key),this.revealTriggered&&this.revealingSections.size===0&&(this.initialRevealWaveSettled=!0);for(let t of e.renderMeshRefs)this.restoreMeshMaterial(t),t.visible=!0,delete t.hiddenByReveal;this.worldRenderer.chunkMeshManager.migrateDeferredShaderToGlobal(e.key),e.globalShaderRestore&&this.worldRenderer.chunkMeshManager.globalBlockBuffer?.addSection(e.key,e.globalShaderRestore.words,e.globalShaderRestore.count),this.disposeWireframeGroup(e.wireframeGroup)}disposeWireframeGroup(e){this.worldRenderer.sceneOrigin.removeAndUntrackAll(e);let t=[];e.traverse(r=>{t.push(r)});for(let r of t){let i=r;if(i.geometry&&i.geometry.dispose(),i.material){let s=i.material;if(Array.isArray(s))for(let o of s)o.dispose();else s&&typeof s.dispose=="function"&&s.dispose()}}e.clear()}reset(){for(let e of this.revealingSections.values())this.disposeWireframeGroup(e.wireframeGroup);this.pendingGeometries.clear(),this.revealingSections.clear(),this.revealedChunks.clear(),this.finishedChunkCount=0,this.revealTriggered=!1,this.initialWaveDone=!1,this.initialRevealWaveSettled=!1,this.revealStartTime=0,this.pulseTime=0}forceCompleteAll(){let e=[...this.revealingSections.values()];for(let t of e){t.renderMeshRefs=this.getSectionRenderMeshes(t.key);for(let r of t.renderMeshRefs)this.restoreMeshMaterial(r),r.visible=!0,delete r.hiddenByReveal;this.completeReveal(t)}}debugGetWireframeGroups(){let e=[];return this.scene.traverse(t=>{t.name==="scifi-reveal-group"&&e.push(t)}),e}debugForceCleanup(){let e=this.debugGetWireframeGroups();for(let t of e)this.disposeWireframeGroup(t);for(let t of this.revealingSections.values())this.disposeWireframeGroup(t.wireframeGroup);this.revealingSections.clear()}debugStatus(){let e=this.debugGetWireframeGroups(),t=new Set(this.revealingSections.keys()),r=e.filter(i=>!t.has(i.sectionKey));return{revealTriggered:this.revealTriggered,finishedChunkCount:this.finishedChunkCount,pendingGeometries:this.pendingGeometries.size,revealingSections:this.revealingSections.size,revealedChunks:this.revealedChunks.size,wireframeGroupsInScene:e.length,orphanedWireframeGroups:r.length,orphanedKeys:r.map(i=>i.sectionKey),sections:[...this.revealingSections.entries()].map(([i,s])=>({key:i,phase:s.phase,renderMeshCount:s.renderMeshRefs.length,wireframeInScene:s.wireframeGroup.parent!==null}))}}debugLog(){}},za={id:"futuristicReveal",controller:dn,enabledDefault:!0};E();x();k();R();import*as Me from"three";var i9=parseInt(Me.REVISION.replaceAll(/\D+/g,""),10),un=class extends Me.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
|
|
21488
|
+
`,Ke={textureSize:128,gravity:new re.Vector3(0,-.005,0),friction:.998,defaultParticleSize:300,maxActiveFireworks:5},G5=n=>{let t=n*3;return{x:t,y:t+1,z:t+2}},V5=n=>{let t=n*4;return{r:t,g:t+1,b:t+2,a:t+3}},pt=(n=0,e=0)=>Math.floor(Math.random()*(n+1-e))+e,Ev=(n,e,t,r)=>{n.save();let i=n.createRadialGradient(e,e,0,e,e,e);i.addColorStop(0,"rgba(255,255,255,1.0)"),i.addColorStop(.5,"rgba(255,255,255,0.5)"),i.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=i,n.fillRect(0,0,t,r),n.restore()},xv=()=>{let n=Ke.textureSize,e=We(n,n),t=e.getContext("2d"),r=n/2;Ev(t,r,e.width,e.height);let i=new re.Texture(e);return i.needsUpdate=!0,i},Rv=(n,e,t,r,i=Ke.defaultParticleSize)=>{let s=new re.BufferGeometry,o=[],a=[],v=[],l=[],c=[],u=Math.random()>.3?"single":"multiple",h=pt(100,20)*.01,p=()=>pt(100,1)*.01,g="red",y=Math.random();y>.66?g="red":y>.33?g="green":g="blue";for(let b=0;b<n;b++){let w=new re.Vector3(0,0,0);if(o.push(w.x,w.y,w.z),a.push(e[b].x,e[b].y,e[b].z),t==="seed"){let S=e[b].y**2*.04;b===0&&(S*=1.1),l.push(S),c.push(S*.017),v.push(1,1,1,1)}else if(t==="trail"){let S=Math.random()*.1+.1;l.push(S),c.push(S*.017),v.push(1,1,1,1)}else{let S=pt(i,10)*.001;if(l.push(S),c.push(S*.017),u==="multiple")v.push(p(),p(),p(),1);else switch(g){case"red":v.push(h,.1,.1,1);break;case"green":v.push(.1,h,.1,1);break;case"blue":v.push(.1,.1,h,1);break}}}s.setAttribute("position",new re.Float32BufferAttribute(o,3)),s.setAttribute("velocity",new re.Float32BufferAttribute(a,3)),s.setAttribute("color",new re.Float32BufferAttribute(v,4)),s.setAttribute("adjustSize",new re.Float32BufferAttribute(l,1)),s.setAttribute("mass",new re.Float32BufferAttribute(c,1));let A=new re.RawShaderMaterial({uniforms:{size:{value:Ke.textureSize},texture:{value:r}},transparent:!0,depthWrite:!1,blending:re.AdditiveBlending,vertexShader:wv,fragmentShader:Av});return new re.Points(s,A)},N5=class{constructor(e,t,r,i,s){d(this,"particleNum");d(this,"timerStartFading");d(this,"mesh");this.particleNum=e,this.timerStartFading=10,this.mesh=Rv(e,t,r,i,s)}update(e){this.timerStartFading>0&&(this.timerStartFading-=.3);let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=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:u}=G5(v);r.array[c]+=e.y-s.array[v],r.array[l]*=Ke.friction,r.array[u]*=Ke.friction,r.array[c]*=Ke.friction,t.array[l]+=r.array[l],t.array[c]+=r.array[c],t.array[u]+=r.array[u];let{a:h}=V5(v);this.timerStartFading<=0&&(i.array[h]*=o()-a(i.array[h]),i.array[h]<.001&&(i.array[h]=0))}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}disposeAll(){this.mesh.geometry.dispose(),this.mesh.material.dispose()}},Gi=class extends N5{constructor(e,t,r){super(e,t,"seed",r)}update(e){let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.99:.96,a=u=>Math.random()>.3?0:(1-u)*.1,v=()=>Math.random()>.5?.05:-.05,l=()=>Math.random()>.1,c=Ke.friction*.98;for(let u=0;u<this.particleNum;u++){let{x:h,y:p,z:g}=G5(u);r.array[p]+=e.y-s.array[u],r.array[h]*=c,r.array[g]*=c,r.array[p]*=c,t.array[h]+=r.array[h],t.array[p]+=r.array[p],t.array[g]+=r.array[g],l()&&(t.array[h]+=v()),l()&&(t.array[g]+=v());let{a:y}=V5(u);i.array[y]*=o()-a(i.array[y]),i.array[y]<.001&&(i.array[y]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},Vi=class extends N5{constructor(e,t,r){super(e,t,"trail",r)}update(e){let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=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:u,z:h}=G5(l);r.array[u]+=e.y-s.array[l],r.array[c]*=Ke.friction,r.array[h]*=Ke.friction,r.array[u]*=Ke.friction,t.array[c]+=r.array[c],t.array[u]+=r.array[u],t.array[h]+=r.array[h],v()&&(t.array[c]+=a()),v()&&(t.array[h]+=a());let{a:p}=V5(l);i.array[p]*=o(),i.array[p]<.001&&(i.array[p]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},W5=class{constructor(e,t=Ke.defaultParticleSize,r){d(this,"meshGroup");d(this,"isExplode");d(this,"petalsNum");d(this,"life");d(this,"seed");d(this,"flowerSizeRate");d(this,"flower");d(this,"texture");d(this,"particleSize");this.meshGroup=new re.Group,this.isExplode=!1,this.texture=e,this.particleSize=t;let i=400,s=150;this.petalsNum=pt(i,s),this.life=150,this.seed=this.getSeed(r),this.meshGroup.add(this.seed.mesh),this.flowerSizeRate=re.MathUtils.mapLinear(this.petalsNum,s,i,.4,.7)}getSeed(e){let r=[];for(let s=0;s<40;s++){let a=s===0?Math.random()*2.5+.9:Math.random()*2+.4,v=0;r.push(new re.Vector3(0,a,v))}let i=new Gi(40,r,this.texture);if(e)i.mesh.position.set(0,0,0);else{let s=Math.random()*80-40,o=-50,a=Math.random()*80-40;i.mesh.position.set(s,o,a)}return i}explode(e){this.isExplode=!0,this.flower=this.getFlower(e),this.meshGroup.add(this.flower.mesh),this.meshGroup.remove(this.seed.mesh),this.seed.disposeAll()}getFlower(e){let t=this.petalsNum,r=[],i;if(Math.random()>.5)for(let a=0;a<t;a++){i=pt(120,60)*.01;let v=re.MathUtils.degToRad(Math.random()*180),l=re.MathUtils.degToRad(Math.random()*360),c=Math.sin(v)*Math.cos(l)*i,u=Math.sin(v)*Math.sin(l)*i,h=Math.cos(v)*i,p=new re.Vector3(c,u,h);p.multiplyScalar(this.flowerSizeRate),r.push(p)}else{let a=180/t,v=360*(Math.random()*20+1)/t,l=v,c=v;i=pt(120,60)*.01;for(let u=0;u<t;u++){let h=Math.sin(re.MathUtils.degToRad(a*u)),p=Math.cos(re.MathUtils.degToRad(a*u))*i,g=Math.cos(re.MathUtils.degToRad(l*u))*h*i,y=Math.sin(re.MathUtils.degToRad(c*u))*h*i,A=new re.Vector3(g,y,p);A.multiplyScalar(this.flowerSizeRate),r.push(A)}}let o=new N5(t,r,"default",this.texture,this.particleSize);return o.mesh.position.set(e.x,e.y,e.z),o}update(e){this.isExplode?(this.flower.update(e),this.life>0&&(this.life-=1)):this.drawTail()}drawTail(){this.seed.update(Ke.gravity);let e=this.seed.mesh.geometry.attributes.position,t=this.seed.mesh.geometry.attributes.velocity,r=0;for(let u=0,h=t.array.length;u<h;u++){let p=t.array[u];u%3===1&&p>0&&r++}if(!(r===0))return;let{x:s,y:o,z:a}=this.seed.mesh.position,v=new re.Vector3(s,o,a),l=0,c;for(let u=0,h=e.array.length;u<h;u++){let p=e.array[u];u%3===1&&p>l&&(l=p,c=new re.Vector3(e.array[u-1],p,e.array[u+2]))}c&&(v.add(c),this.explode(v))}},Kt=class extends W5{constructor(t,r=Ke.defaultParticleSize,i){super(t,r,i);d(this,"tailMeshGroup");d(this,"tails");let s=150,o=100;this.petalsNum=pt(s,o),this.flowerSizeRate=re.MathUtils.mapLinear(this.petalsNum,o,s,.4,.7),this.tailMeshGroup=new re.Group,this.tails=[]}explode(t){this.isExplode=!0,this.flower=this.getFlower(t),this.tails=this.getTail(),this.meshGroup.add(this.flower.mesh),this.meshGroup.add(this.tailMeshGroup)}getTail(){let t=[],i=this.flower.mesh.geometry.attributes.color;for(let s=0;s<this.petalsNum;s++){let o=[];for(let M=0;M<20;M++)o.push(new re.Vector3(0,0,0));let a=new Vi(20,o,this.texture),{r:v,g:l,b:c,a:u}=V5(s),h=i.array[v],p=i.array[l],g=i.array[c],y=i.array[u],A=a.mesh.geometry.attributes.position,b=a.mesh.geometry.attributes.color;for(let M=0;M<A.count;M++){let I=V5(M);b.array[I.r]=h,b.array[I.g]=p,b.array[I.b]=g,b.array[I.a]=y}let{x:w,y:S,z:C}=this.flower.mesh.position;a.mesh.position.set(w,S,C),t.push(a),this.tailMeshGroup.add(a.mesh)}return t}update(t){if(this.isExplode){this.flower.update(t);let r=this.flower.mesh.geometry.attributes.position;for(let i=0,s=this.tails.length;i<s;i++){let o=this.tails[i];o.update(t);let{x:a,y:v,z:l}=G5(i),c=new re.Vector3(r.array[a],r.array[v],r.array[l]),u=o.mesh.geometry.attributes.position,h=o.mesh.geometry.attributes.velocity;for(let p=0;p<u.count;p++){let g=G5(p),y=new re.Vector3,A=new re.Vector3(u.array[g.x],u.array[g.y],u.array[g.z]),b=new re.Vector3(h.array[g.x],h.array[g.y],h.array[g.z]);y.subVectors(c,A);let w=y.sub(b);w.normalize(),w.multiplyScalar(Math.random()*3e-4*this.life),h.array[g.x]+=w.x,h.array[g.y]+=w.y,h.array[g.z]+=w.z}h.needsUpdate=!0}this.life>0&&(this.life-=1.2)}else this.drawTail()}},K1=class{constructor(e,t,r){d(this,"fireworksInstances");d(this,"scene");d(this,"sceneOrigin");d(this,"texture");d(this,"particleSize");d(this,"maxFireworks");this.fireworksInstances=[],this.scene=e,this.sceneOrigin=t,this.texture=xv(),this.particleSize=r?.defaultParticleSize??Ke.defaultParticleSize,this.maxFireworks=r?.maxActiveFireworks??Ke.maxActiveFireworks}launchFirework(e){if(this.fireworksInstances.length>=this.maxFireworks)return;let t=e?.particleSize??this.particleSize,r=e?.position,i;e?.forceRich?i=new Kt(this.texture,t,r):e?.forceBasic?i=new W5(this.texture,t,r):i=Math.random()>.5?new W5(this.texture,t,r):new Kt(this.texture,t,r),this.fireworksInstances.push(i),r?(this.sceneOrigin.addAndTrack(i.meshGroup),i.meshGroup.position.set(r.x,r.y,r.z)):this.scene.add(i.meshGroup)}repositionAll(){}update(){let e=[];for(let t=this.fireworksInstances.length-1;t>=0;t--){let r=this.fireworksInstances[t];r.update(Ke.gravity),r.isExplode&&e.push(t)}for(let t=0,r=e.length;t<r;t++){let i=e[t],s=this.fireworksInstances[i];if(s&&(s.meshGroup.remove(s.seed.mesh),s.seed.disposeAll(),s.life<=0)){if(this.sceneOrigin.removeAndUntrack(s.meshGroup),s instanceof Kt&&s.tailMeshGroup)for(let o of s.tails)o.disposeAll();s.flower?.disposeAll(),this.fireworksInstances.splice(i,1)}}}clear(){for(let e of this.fireworksInstances)if(this.sceneOrigin.removeAndUntrack(e.meshGroup),e.seed.disposeAll(),e.flower&&e.flower.disposeAll(),e instanceof Kt)for(let t of e.tails)t.disposeAll();this.fireworksInstances=[]}dispose(){this.clear(),this.texture.dispose()}};E();x();k();R();var ta=Symbol("tracked-proxy"),kv=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"]),J1=class{constructor(e){d(this,"scene");d(this,"_x",0);d(this,"_y",0);d(this,"_z",0);d(this,"_tracked",new Set);d(this,"_worldCoords",new WeakMap);d(this,"_originalPositions",new WeakMap);d(this,"_trackOptions",new WeakMap);this.scene=e}get x(){return this._x}get y(){return this._y}get z(){return this._z}update(e,t,r){this._x=e,this._y=t,this._z=r;for(let i of this._tracked){let s=this._worldCoords.get(i);this._originalPositions.get(i).set(s.x-e,s.y-t,s.z-r),this._trackOptions.get(i)?.updateMatrix&&i.updateMatrix()}}track(e,t){let r=this._originalPositions.get(e)??e.position,i={x:0,y:0,z:0};this._originalPositions.set(e,r),this._worldCoords.set(e,i),t?this._trackOptions.set(e,t):this._trackOptions.delete(e);let s=this,o=t,a=new Proxy(r,{get(v,l,c){if(l===ta)return i;if(l==="set")return(h,p,g)=>(i.x=h,i.y=p,i.z=g,v.set(h-s._x,p-s._y,g-s._z),o?.updateMatrix&&e.updateMatrix(),c);if(l==="copy")return h=>{let p=h[ta],g=p?p.x:h.x,y=p?p.y:h.y,A=p?p.z:h.z;return i.x=g,i.y=y,i.z=A,v.set(g-s._x,y-s._y,A-s._z),o?.updateMatrix&&e.updateMatrix(),c};if(l==="setX")return h=>(i.x=h,v.x=h-s._x,o?.updateMatrix&&e.updateMatrix(),c);if(l==="setY")return h=>(i.y=h,v.y=h-s._y,o?.updateMatrix&&e.updateMatrix(),c);if(l==="setZ")return h=>(i.z=h,v.z=h-s._z,o?.updateMatrix&&e.updateMatrix(),c);if(typeof l=="string"&&kv.has(l))return()=>{throw new Error(`Cannot call position.${l}() on a tracked object. Use position.set(x, y, z) instead.`)};let u=v[l];return typeof u=="function"?u.bind(v):u},set(v,l,c){return l==="x"?(i.x=c,v.x=c-s._x,o?.updateMatrix&&e.updateMatrix(),!0):l==="y"?(i.y=c,v.y=c-s._y,o?.updateMatrix&&e.updateMatrix(),!0):l==="z"?(i.z=c,v.z=c-s._z,o?.updateMatrix&&e.updateMatrix(),!0):(v[l]=c,!0)}});Object.defineProperty(e,"position",{value:a,configurable:!0,enumerable:!0}),this._tracked.add(e)}untrack(e){let t=this._originalPositions.get(e);t&&(Object.defineProperty(e,"position",{value:t,configurable:!0,enumerable:!0}),this._tracked.delete(e),this._worldCoords.delete(e),this._originalPositions.delete(e),this._trackOptions.delete(e))}addAndTrack(e,t){this.track(e,t),this.scene.add(e)}removeAndUntrack(e){this.untrack(e),e.removeFromParent()}removeAndUntrackAll(e){e.traverse(t=>{this.untrack(t)}),e.removeFromParent()}getWorldPosition(e){let t=this._worldCoords.get(e);return t?{x:t.x,y:t.y,z:t.z}:void 0}clear(){for(let e of this._tracked)this.untrack(e)}get trackedCount(){return this._tracked.size}toSceneX(e){return e-this._x}toSceneY(e){return e-this._y}toSceneZ(e){return e-this._z}toWorldX(e){return e+this._x}toWorldY(e){return e+this._y}toWorldZ(e){return e+this._z}};Ki();E();x();k();R();qt();gt();Yi();import Vv from"prismarine-chat";import*as X from"three";import*as or from"prismarine-nbt";import{Vec3 as Xi}from"vec3";E();x();k();R();gt();qt();import*as u0 from"three";var Ov=2e6,Ji=aa(),ir=class{constructor(e,t){d(this,"mesh");d(this,"capacityFaces");d(this,"w0");d(this,"w1");d(this,"w2");d(this,"w3");d(this,"sectionSlots",new Map);d(this,"freeList",[]);d(this,"highWatermark",0);d(this,"dirtyMin",1/0);d(this,"dirtyMax",-1);this.capacityFaces=Ov,this.w0=new Uint32Array(this.capacityFaces),this.w1=new Uint32Array(this.capacityFaces),this.w2=new Uint32Array(this.capacityFaces),this.w3=new Uint32Array(this.capacityFaces);let r=new u0.InstancedBufferGeometry,i=new Float32Array(Z1*3);r.setAttribute("position",new u0.BufferAttribute(i,3));let s=o=>{let a=new u0.InstancedBufferAttribute(o,1);return a.setUsage(u0.DynamicDrawUsage),a};r.setAttribute("a_w0",s(this.w0)),r.setAttribute("a_w1",s(this.w1)),r.setAttribute("a_w2",s(this.w2)),r.setAttribute("a_w3",s(this.w3)),r.instanceCount=0,this.mesh=new u0.Mesh(r,e),this.mesh.name="globalShaderCubes",this.mesh.frustumCulled=!1,this.mesh.matrixAutoUpdate=!1,this.mesh.matrix.identity(),this.mesh.position.set(0,0,0),t.add(this.mesh)}addSection(e,t,r){if(r<=0){this.removeSection(e);return}this.sectionSlots.has(e)&&this.removeSection(e),r>this.capacityFaces&&this.growCapacity(r);let i=this.takeFreeSlot(r);i||(this.highWatermark+r>this.capacityFaces&&this.growCapacity(this.highWatermark+r),i={start:this.highWatermark,count:r},this.highWatermark+=r);let s=4;for(let o=0;o<r;o++){let a=i.start+o,v=o*s;this.w0[a]=t[v],this.w1[a]=t[v+1],this.w2[a]=t[v+2],this.w3[a]=t[v+3]}this.sectionSlots.set(e,i),this.markDirty(i.start,i.start+r-1),this.mesh.geometry.instanceCount=this.highWatermark}hasSection(e){return this.sectionSlots.has(e)}getSectionSlot(e){return this.sectionSlots.get(e)}getW0(){return this.w0}takeSectionData(e){let t=this.sectionSlots.get(e);if(!t)return;let r=4,i=new Uint32Array(t.count*r);for(let s=0;s<t.count;s++){let o=t.start+s,a=s*r;i[a]=this.w0[o],i[a+1]=this.w1[o],i[a+2]=this.w2[o],i[a+3]=this.w3[o]}return this.removeSection(e),{words:i,count:t.count}}removeSection(e){let t=this.sectionSlots.get(e);if(t){for(let r=t.start;r<t.start+t.count;r++)this.w0[r]=0,this.w1[r]=0,this.w2[r]=Ji,this.w3[r]=0;this.markDirty(t.start,t.start+t.count-1),this.sectionSlots.delete(e),this.insertFreeSlot(t),this.shrinkHighWatermark(),this.mesh.geometry.instanceCount=this.highWatermark}}uploadDirtyRange(){if(this.dirtyMin>this.dirtyMax)return;let e=this.dirtyMin,t=this.dirtyMax-this.dirtyMin+1,r=this.mesh.geometry;for(let i of["a_w0","a_w1","a_w2","a_w3"]){let s=r.getAttribute(i);s.updateRange.offset=e,s.updateRange.count=t,s.needsUpdate=!0}this.dirtyMin=1/0,this.dirtyMax=-1}setCameraOrigin(e,t,r){let i=Math.floor(e),s=Math.floor(t),o=Math.floor(r),a=this.mesh.material.uniforms.u_cameraOrigin;a?.value?.set&&a.value.set(i,s,o);let v=this.mesh.material.uniforms.u_cameraOriginFrac;v?.value?.set&&v.value.set(e-i,t-s,r-o)}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.dirtyMin=1/0,this.dirtyMax=-1,this.w0.fill(0),this.w1.fill(0),this.w2.fill(Ji),this.w3.fill(0),this.mesh.geometry.instanceCount=0}dispose(){this.mesh.parent?.remove(this.mesh),this.mesh.geometry.dispose(),this.reset()}markDirty(e,t){e<this.dirtyMin&&(this.dirtyMin=e),t>this.dirtyMax&&(this.dirtyMax=t)}takeFreeSlot(e){for(let t=0;t<this.freeList.length;t++){let r=this.freeList[t];if(r.count>=e){if(this.freeList.splice(t,1),r.count===e)return r;let i={start:r.start,count:e};return this.insertFreeSlot({start:r.start+e,count:r.count-e}),i}}}insertFreeSlot(e){this.freeList.push(e),this.freeList.sort((t,r)=>t.start-r.start),this.mergeFreeList()}mergeFreeList(){if(this.freeList.length<2)return;let e=[],t=this.freeList[0];for(let r=1;r<this.freeList.length;r++){let i=this.freeList[r];t.start+t.count===i.start?t={start:t.start,count:t.count+i.count}:(e.push(t),t=i)}e.push(t),this.freeList=e}shrinkHighWatermark(){for(;this.highWatermark>0;){let e=this.highWatermark-1,t=this.freeList.find(i=>i.start<=e&&i.start+i.count>e);if(!t||t.start+t.count!==this.highWatermark)break;this.highWatermark=t.start;let r=this.freeList.indexOf(t);this.freeList.splice(r,1)}}growCapacity(e){let t=this.capacityFaces;for(;t<e;)t*=2;let r=new Uint32Array(t),i=new Uint32Array(t),s=new Uint32Array(t),o=new Uint32Array(t);r.set(this.w0),i.set(this.w1),s.set(this.w2),o.set(this.w3),s.fill(Ji,this.w0.length),this.w0=r,this.w1=i,this.w2=s,this.w3=o,this.capacityFaces=t;let a=this.mesh.geometry,v=(l,c)=>{let u=a.getAttribute(c);u&&(a.deleteAttribute(c),"dispose"in u&&typeof u.dispose=="function"&&u.dispose());let h=new u0.InstancedBufferAttribute(l,1);h.setUsage(u0.DynamicDrawUsage),a.setAttribute(c,h)};v(this.w0,"a_w0"),v(this.w1,"a_w1"),v(this.w2,"a_w2"),v(this.w3,"a_w3"),this.dirtyMin=0,this.dirtyMax=this.highWatermark-1}};E();x();k();R();qt();gt();function ma(n,e,t,r,i){if(e<=0)return;let s=t-8,o=r-8,a=i-8,v=Jt,l=16,c=16,u=16,h=-1,p=-1,g=-1;for(let M=0;M<e;M++){let I=n[M*v],B=I&(1<<c0.LX_BITS)-1,H=I>>c0.LY_SHIFT&(1<<c0.LY_BITS)-1,G=I>>c0.LZ_SHIFT&(1<<c0.LZ_BITS)-1;B<l&&(l=B),H<c&&(c=H),G<u&&(u=G),B>h&&(h=B),H>p&&(p=H),G>g&&(g=G)}if(h<0)return;let y=s+l,A=o+c,b=a+u,w=s+h+1,S=o+p+1,C=a+g+1;return{minX:y,minY:A,minZ:b,maxX:w,maxY:S,maxZ:C,cx:(y+w)*.5,cy:(A+S)*.5,cz:(b+C)*.5}}function nr(n,e,t,r,i,s,o,a,v){return n>=r&&n<=o&&e>=i&&e<=a&&t>=s&&t<=v}function qi(n,e,t,r,i,s,o,a,v,l,c,u,h){if(nr(n,e,t,o,a,v,l,c,u))return;let p=0,g=h;if(Math.abs(r)<1e-8){if(n<o||n>l)return}else{let y=1/r,A=(o-n)*y,b=(l-n)*y;if(A>b){let w=A;A=b,b=w}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}if(Math.abs(i)<1e-8){if(e<a||e>c)return}else{let y=1/i,A=(a-e)*y,b=(c-e)*y;if(A>b){let w=A;A=b,b=w}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}if(Math.abs(s)<1e-8){if(t<v||t>u)return}else{let y=1/s,A=(v-t)*y,b=(u-t)*y;if(A>b){let w=A;A=b,b=w}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}return p<=g&&p>=0?p:void 0}function Dv(n,e,t,r,i,s,o,a,v,l,c,u,h){let p=h;if(Math.abs(r)>=1e-8){let g=r>0?(l-n)/r:(o-n)/r;g>1e-6&&(p=Math.min(p,g))}else if(n<o||n>l)return;if(Math.abs(i)>=1e-8){let g=i>0?(c-e)/i:(a-e)/i;g>1e-6&&(p=Math.min(p,g))}else if(e<a||e>c)return;if(Math.abs(s)>=1e-8){let g=s>0?(u-t)/s:(v-t)/s;g>1e-6&&(p=Math.min(p,g))}else if(t<v||t>u)return;return p<=h?p:void 0}function Zi(n,e,t,r,i,s,o,a,v,l,c,u,h,p,g,y){let A=i-8,b=s-8,w=o-8,S=p,C=!1;for(let M=0;M<t;M++){let I=n[e+M*r],B=I&(1<<c0.LX_BITS)-1,H=I>>c0.LY_SHIFT&(1<<c0.LY_BITS)-1,G=I>>c0.LZ_SHIFT&(1<<c0.LZ_BITS)-1,O=B+(H<<4)+(G<<8);if(g[O]===y)continue;g[O]=y;let j=A+B,J=b+H,q=w+G,$=j+1,ue=J+1,le=q+1,ce;nr(a,v,l,j,J,q,$,ue,le)?ce=Dv(a,v,l,c,u,h,j,J,q,$,ue,le,S):ce=qi(a,v,l,c,u,h,j,J,q,$,ue,le,S),ce!==void 0&&ce<S&&(S=ce,C=!0)}return C?S:void 0}E();x();k();R();import*as Ze from"three";var pa=20,ga=40,Fv={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},ba={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 zv(n){let e=n.replace("_wall_banner","_banner");return Fv[e]??15}var Lv=(n,e,t,r,i,s,o)=>{switch(n.fillStyle=t,e){case"bs":n.fillRect(r,i,s,o);break;case"ls":n.fillRect(r,i,s/3,o);break;case"rs":n.fillRect(r+s*2/3,i,s/3,o);break;case"ts":n.fillRect(r,i,s,o/3);break;case"ms":n.fillRect(r,i+o/3,s,o/3);break;case"drs":n.fillRect(r,i,s/2,o/2);break;case"dls":n.fillRect(r+s/2,i,s/2,o/2);break;case"ss":for(let a=0;a<s;a+=2)n.fillRect(r+a,i,1,o);break;case"cr":n.fillRect(r,i+o/3,s,o/3),n.fillRect(r+s/3,i,s/3,o);break;case"sc":n.fillRect(r,i+o/2-1,s,2),n.fillRect(r+s/2-1,i,2,o);break;default:n.fillRect(r,i,s,o)}};function Uv(n,e){if(!e||e.length===0)return`banner_${n}_empty`;let t=e.map(r=>`${r.Pattern??"bs"}_${r.Color??0}`).join(",");return`banner_${n}_${t}`}var Gv=(n,e,t=(r,i)=>We(r,i))=>{let i=t(pa*1,ga*1),s=i.getContext("2d");if(s){if(s.imageSmoothingEnabled=!1,e?.Patterns&&e.Patterns.length>0)for(let o of e.Patterns){let a=o.Color??0,v=o.Pattern??"bs",l=ba[a]||ba[0];Lv(s,v,l,0,0,pa*1,ga*1)}return i}},sr=new Map;function ya(n,e,t){let r=zv(e),i=Uv(r,t?.Patterns),s=sr.get(i);if(s)return s.refCount++,s.texture;let o=Gv(r,t);if(!o)return;let a=new Ze.Texture(o);return a.magFilter=Ze.NearestFilter,a.minFilter=Ze.NearestFilter,a.needsUpdate=!0,sr.set(i,{texture:a,refCount:1}),a}function _a(n){for(let[e,t]of sr.entries())if(t.texture===n){t.refCount--,t.refCount<=0&&(t.texture.dispose(),sr.delete(e));return}}function wa(n,e,t,r){let a,v,l;t?(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 Ze.Mesh(new Ze.PlaneGeometry(.85,1.75),new Ze.MeshBasicMaterial({map:r,transparent:!0}));c.renderOrder=999;let u=.5/16,h=.25/16;t?c.position.set(0,a,v+h+.004):c.position.set(0,a,v+u/2+.004);let p=new Ze.Group;return p.rotation.set(0,-Ze.MathUtils.degToRad(e*(t?90:45/2)),0),p.add(c),p.bannerTexture=r,p.position.set(n.x+.5,n.y+l,n.z+.5),p}var bt=class bt{constructor(e,t,r,i,s=3){this.worldRenderer=e;this.scene=t;this.material=r;this.worldHeight=i;d(this,"meshPool",[]);d(this,"activeSections",new Map);d(this,"sectionObjects",{});d(this,"waitingChunksToDisplay",{});d(this,"pendingNearReveal",new Map);d(this,"nearRevealTimers",new Map);d(this,"nearRevealGraceTimers",new Map);d(this,"poolSize");d(this,"maxPoolSize");d(this,"minPoolSize");d(this,"signHeadsRenderer");d(this,"chunkBoxMaterial",new X.MeshBasicMaterial({color:0,transparent:!0,opacity:0}));d(this,"cubeShaderMaterial",null);d(this,"globalBlockBuffer",null);d(this,"shaderSectionRaycastBoxes",new Map);d(this,"blockRaycastVisitGen",new Uint16Array(4096));d(this,"blockRaycastVisitStamp",1);d(this,"hits",0);d(this,"misses",0);d(this,"bypassPooling",!1);d(this,"renderTimes",[]);d(this,"maxRenderTimeSamples",30);d(this,"_performanceOverrideDistance");d(this,"lastPerformanceCheck",0);d(this,"performanceCheckInterval",2e3);this.updateViewDistance(s),this.signHeadsRenderer=new $i(e),this.initializePool()}get performanceOverrideDistance(){return this._performanceOverrideDistance??0}set performanceOverrideDistance(e){this._performanceOverrideDistance=e,this.updateSectionsVisibility()}initializePool(){for(let e=0;e<this.poolSize;e++){let t=new X.BufferGeometry,r=new X.Mesh(t,this.material);r.visible=!1,r.matrixAutoUpdate=!1,r.name="pooled-section-mesh";let i={mesh:r,inUse:!1,lastUsedTime:0};this.meshPool.push(i)}}sectionHasRenderableContent(e){return e.positions.length>0?!0:this.isShaderCubesGpuEnabled()?(e.shaderCubes?.count??0)>0:!1}isShaderCubesGpuEnabled(){return this.worldRenderer.shaderCubeBlocksEnabled()}syncCubeShaderUniforms(){if(!this.isShaderCubesGpuEnabled())return;let e=this.cubeShaderMaterial??this.getCubeShaderMaterial();if(!e)return;let t=this.material.map??null;e.uniforms.u_atlas.value=t;let r=tr();if(!r)return;let{tintPalette:i}=r;i.isReady()||i.createTexture(),e.uniforms.u_tintPalette.value=i.getTexture(),e.uniforms.u_debugMode.value=this.worldRenderer.worldRendererConfig.shaderCubeDebugMode??0,e.needsUpdate=!0}getCubeShaderMaterial(){return this.isShaderCubesGpuEnabled()?(this.cubeShaderMaterial||(this.cubeShaderMaterial=q1(),this.syncCubeShaderUniforms()),this.cubeShaderMaterial):null}getGlobalBlockBuffer(){let e=this.getCubeShaderMaterial();return e?(this.globalBlockBuffer||(this.globalBlockBuffer=new ir(e,this.scene)),this.globalBlockBuffer):null}shouldDeferShaderToPerSection(e){let t=this.worldRenderer.getModule("futuristicReveal");return t?t.isInInitialRevealCampaign?.()?!0:t.shouldUseRevealEffect?.(e)===!0:!1}migrateDeferredShaderToGlobal(e){let t=this.sectionObjects[e];if(!t?.deferredShaderCubes)return;let{words:r,count:i}=t.deferredShaderCubes,s=t.worldX,o=t.worldY,a=t.worldZ;s!==void 0&&o!==void 0&&a!==void 0&&this.registerShaderSectionRaycastBox(e,r,i,s,o,a),this.getGlobalBlockBuffer()?.addSection(e,r,i);let l=t.mesh===t.shaderMesh;t.shaderMesh&&(ji(t.shaderMesh),t.remove(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,l&&(t.mesh=void 0)}registerShaderSectionRaycastBox(e,t,r,i,s,o){let a=ma(t,r,i,s,o);a?this.shaderSectionRaycastBoxes.set(e,{box:a,sectionCenterX:i,sectionCenterY:s,sectionCenterZ:o}):this.shaderSectionRaycastBoxes.delete(e)}unregisterShaderSectionRaycastBox(e){this.shaderSectionRaycastBoxes.delete(e)}raycastShaderSectionAABBs(e,t,r,i=80){let s=e.x,o=e.y,a=e.z,v=t.x,l=t.y,c=t.z,u=i*i,h=r,p=!1;this.blockRaycastVisitStamp++,this.blockRaycastVisitStamp>=65535&&(this.blockRaycastVisitGen.fill(0),this.blockRaycastVisitStamp=1);for(let[g,y]of this.shaderSectionRaycastBoxes){let A=this.sectionObjects[g];if(A&&!A.visible)continue;let{box:b}=y,w=b.cx-s,S=b.cy-o,C=b.cz-a;if(w*w+S*S+C*C>u)continue;let M=qi(s,o,a,v,l,c,b.minX,b.minY,b.minZ,b.maxX,b.maxY,b.maxZ,h);if(M===void 0&&nr(s,o,a,b.minX,b.minY,b.minZ,b.maxX,b.maxY,b.maxZ)){let I=this.globalBlockBuffer,B=I?.getSectionSlot(g);if(I&&B)M=Zi(I.getW0(),B.start,B.count,1,y.sectionCenterX,y.sectionCenterY,y.sectionCenterZ,s,o,a,v,l,c,h,this.blockRaycastVisitGen,this.blockRaycastVisitStamp);else{let H=this.sectionObjects[g]?.deferredShaderCubes;H&&(M=Zi(H.words,0,H.count,Jt,y.sectionCenterX,y.sectionCenterY,y.sectionCenterZ,s,o,a,v,l,c,h,this.blockRaycastVisitGen,this.blockRaycastVisitStamp))}}M!==void 0&&M<h&&(h=M,p=!0)}return p?h:void 0}updateSection(e,t){let r=t.positions.length>0,i=t.shaderCubes,s=this.isShaderCubesGpuEnabled()&&(i?.count??0)>0;if(!r&&!s)return this.releaseSection(e),null;let o=this.sectionObjects[e];o&&this.cleanupSection(e),r||this.releasePooledMesh(e);let a;if(r){let A=this.activeSections.get(e);if(!A){if(A=this.acquireMesh(),!A)return null;this.activeSections.set(e,A),A.sectionKey=e}let{mesh:b}=A;this.updateGeometryAttribute(b.geometry,"position",t.positions,3),this.updateGeometryAttribute(b.geometry,"normal",t.normals,3),this.updateGeometryAttribute(b.geometry,"color",t.colors,3),this.updateGeometryAttribute(b.geometry,"uv",t.uvs,2),b.geometry.index=new X.BufferAttribute(t.indices,1),b.geometry.boundingBox=new X.Box3(new X.Vector3(-8,-8,-8),new X.Vector3(8,8,8)),b.geometry.boundingSphere=new X.Sphere(new X.Vector3(0,0,0),Math.sqrt(3*8**2)),this.worldRenderer.sceneOrigin.track(b,{updateMatrix:!0}),b.position.set(t.sx,t.sy,t.sz),b.updateMatrix(),b.visible=!0,b.name="mesh",A.lastUsedTime=performance.now(),a=b}let v=s?this.getCubeShaderMaterial():null,l,c=s&&this.shouldDeferShaderToPerSection(e);s&&i&&(c&&v?(l=rr(i,v),l.visible=!0):this.getGlobalBlockBuffer()?.addSection(e,i.words,i.count)),o=new X.Group,a&&(o.add(a),o.mesh=a),l&&(o.add(l),o.shaderMesh=l,i&&(o.deferredShaderCubes={words:i.words,count:i.count}),o.mesh||(o.mesh=l)),s&&i&&this.registerShaderSectionRaycastBox(e,i.words,i.count,t.sx,t.sy,t.sz);let u=0;r&&(u+=t.positions.length/3/4),s&&i&&(u+=i.count),o.tilesCount=u,o.blocksCount=t.blocksCount,o.worldX=t.sx,o.worldY=t.sy,o.worldZ=t.sz,o.sectionKey=e,o.name="chunk";try{if(Object.keys(t.signs).length>0){let A=new X.Group;A.name="signs";for(let[b,{isWall:w,isHanging:S,rotation:C}]of Object.entries(t.signs)){let M=this.worldRenderer.blockEntities[b];if(!M)continue;let[I,B,H]=b.split(","),G=this.signHeadsRenderer.renderSign(new Xi(+I,+B,+H),C,w,S,or.simplify(M));G&&A.add(G)}o.add(A),o.signsContainer=A}if(Object.keys(t.heads).length>0){let A=new X.Group;A.name="heads";for(let[b,{isWall:w,rotation:S}]of Object.entries(t.heads)){let C=this.worldRenderer.blockEntities[b];if(!C)continue;let[M,I,B]=b.split(","),H=this.signHeadsRenderer.renderHead(new Xi(+M,+I,+B),S,w,or.simplify(C));H&&A.add(H)}o.add(A),o.headsContainer=A}if(Object.keys(t.banners).length>0){let A=new X.Group;A.name="banners",o.bannersContainer=A,o.add(A);for(let[b,{isWall:w,rotation:S,blockName:C}]of Object.entries(t.banners)){let M=this.worldRenderer.blockEntities[b];if(!M)continue;let[I,B,H]=b.split(","),G=ya(this.worldRenderer,C,or.simplify(M));if(!G)continue;let O=wa(new Xi(+I,+B,+H),S,w,G),{x:j,y:J,z:q}=O.position;this.worldRenderer.sceneOrigin.track(O),O.position.set(j,J,q),A.add(O)}}}catch{}this.sectionObjects[e]=o,this.scene.add(o),o.matrixAutoUpdate=!1,this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&this.updateBoxHelper(e,!0);let h=e.split(","),p=`${h[0]},${h[2]}`,g=!!this.worldRenderer.displayOptions?.inWorldRenderingConfig?._renderByChunks,y=!!this.worldRenderer.worldRendererConfig?.wasmMesher;if((g||y)&&!this.worldRenderer.finishedChunks[p]){o.visible=!1,o._waitingForChunkDisplay=!0;let A=this.waitingChunksToDisplay[p]??(this.waitingChunksToDisplay[p]=[]);A.includes(e)||A.push(e)}return o}finishChunkDisplay(e){if(!this.waitingChunksToDisplay[e]){this.tryRevealPending();return}if(this.isWasmGateActive()&&this.isBlockedByNearer(e,0)){this.pendingNearReveal.set(e,Date.now()),this.armNearRevealTimer(e),this.armExpectedGraceTimer(e),this.tryRevealPending();return}this.flushChunkDisplay(e),this.tryRevealPending()}flushChunkDisplay(e){let t=this.waitingChunksToDisplay[e];if(this.pendingNearReveal.delete(e),this.clearNearRevealTimer(e),this.clearExpectedGraceTimer(e),!!t){for(let r of t){let i=this.sectionObjects[r];i&&(i._waitingForChunkDisplay=!1,i.visible=!0)}delete this.waitingChunksToDisplay[e]}}tryRevealPending(){if(this.pendingNearReveal.size===0)return;let e=Date.now();for(let[t,r]of[...this.pendingNearReveal])this.isBlockedByNearer(t,e-r)||this.flushChunkDisplay(t)}onChunkRemovedFromGate(e){this.pendingNearReveal.delete(e),this.clearNearRevealTimer(e),this.clearExpectedGraceTimer(e),delete this.waitingChunksToDisplay[e],this.tryRevealPending()}isWasmGateActive(){return!!this.worldRenderer.worldRendererConfig?.wasmMesher}isBlockedByNearer(e,t){let r=this.worldRenderer.viewerChunkPosition;if(!r)return!1;let i=e.split(",");if(i.length!==2)return!1;let s=Number(i[0]),o=Number(i[1]),a=Math.floor(r.x/16),v=Math.floor(r.z/16),l=(s>>4)-a,c=(o>>4)-v,u=l*l+c*c;if(u===0)return!1;let h=this.worldRenderer.finishedChunks,p=this.worldRenderer.loadedChunks,g=this.worldRenderer.viewDistance;if(t<bt.EXPECTED_NEAR_GRACE_MS&&g>0){let A=g*g,b=Math.min(g,Math.ceil(Math.sqrt(Math.max(0,u-1))));for(let w=-b;w<=b;w++)for(let S=-b;S<=b;S++){let C=w*w+S*S;if(C>=u||C>A)continue;let M=a+w<<4,I=v+S<<4,B=`${M},${I}`;if(B!==e&&p[B]&&!h[B])return!0}return!1}for(let A in p){if(A===e||h[A])continue;let b=A.split(",");if(b.length!==2)continue;let w=(Number(b[0])>>4)-a,S=(Number(b[1])>>4)-v;if(w*w+S*S<u)return!0}return!1}armNearRevealTimer(e){if(this.nearRevealTimers.has(e))return;let t=setTimeout(()=>{this.nearRevealTimers.delete(e),this.pendingNearReveal.has(e)&&(this.flushChunkDisplay(e),this.tryRevealPending())},bt.NEAR_REVEAL_TIMEOUT_MS);this.nearRevealTimers.set(e,t)}clearNearRevealTimer(e){let t=this.nearRevealTimers.get(e);t&&(clearTimeout(t),this.nearRevealTimers.delete(e))}armExpectedGraceTimer(e){if(this.nearRevealGraceTimers.has(e))return;let t=setTimeout(()=>{this.nearRevealGraceTimers.delete(e),this.pendingNearReveal.has(e)&&this.tryRevealPending()},bt.EXPECTED_NEAR_GRACE_MS+50);this.nearRevealGraceTimers.set(e,t)}clearExpectedGraceTimer(e){let t=this.nearRevealGraceTimers.get(e);t&&(clearTimeout(t),this.nearRevealGraceTimers.delete(e))}cleanupSection(e){let t=this.sectionObjects[e];if(t){if(t._waitingForChunkDisplay){let r=e.split(","),i=`${r[0]},${r[2]}`,s=this.waitingChunksToDisplay[i];if(s){let o=s.indexOf(e);o!==-1&&s.splice(o,1),s.length===0&&delete this.waitingChunksToDisplay[i]}}if(t.bannersContainer&&(t.bannersContainer.traverse(r=>{r.bannerTexture&&_a(r.bannerTexture)}),this.disposeContainer(t.bannersContainer)),this.globalBlockBuffer?.removeSection(e),this.unregisterShaderSectionRaycastBox(e),t.shaderMesh&&(ji(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,t.signsContainer&&this.disposeContainer(t.signsContainer),t.headsContainer&&this.disposeContainer(t.headsContainer),this.worldRenderer.sceneOrigin.removeAndUntrackAll(t),this.scene.remove(t),t.boxHelper){this.worldRenderer.sceneOrigin.removeAndUntrack(t.boxHelper),this.scene.remove(t.boxHelper),t.boxHelper.geometry.dispose();let r=t.boxHelper.material;if(Array.isArray(r))for(let i of r)i.dispose();else r.dispose();t.boxHelper=void 0}delete this.sectionObjects[e]}}releasePooledMesh(e){let t=this.activeSections.get(e);t&&(t.mesh.visible=!1,t.inUse=!1,t.sectionKey=void 0,t.lastUsedTime=0,this.clearGeometry(t.mesh.geometry),this.activeSections.delete(e),this.cleanupExcessMeshes())}releaseSection(e){this.cleanupSection(e);let t=this.activeSections.get(e);return t?(t.mesh.visible=!1,t.inUse=!1,t.sectionKey=void 0,t.lastUsedTime=0,this.clearGeometry(t.mesh.geometry),this.activeSections.delete(e),this.cleanupExcessMeshes(),!0):!1}getSectionObject(e){return this.sectionObjects[e]}updateBoxHelper(e,t,r=this.chunkBoxMaterial){let i=this.sectionObjects[e];if(i?.mesh)if(t){if(!i.boxHelper){let s=new X.Mesh(new X.BoxGeometry(16,16,16),r),o=new X.BoxHelper(s,16776960);o.name="helper";let a=i.worldX??0,v=i.worldY??0,l=i.worldZ??0;this.worldRenderer.sceneOrigin.track(o,{updateMatrix:!0}),o.position.set(a,v,l),o.updateMatrix(),this.scene.add(o),i.boxHelper=o}i.boxHelper.visible=!0}else i.boxHelper&&(i.boxHelper.visible=!1)}updateAllBoxHelpers(e){for(let t of Object.keys(this.sectionObjects))this.updateBoxHelper(t,e)}cleanSignChunkTextures(e,t){this.signHeadsRenderer.cleanChunkTextures(e,t)}getSectionMesh(e){return this.activeSections.get(e)?.mesh}hasSection(e){return this.activeSections.has(e)}updateViewDistance(e){let t=(e*2+1)**2,r=this.worldHeight/16,i=5;if(this.minPoolSize=Math.floor(t*i),this.maxPoolSize=Math.floor(t*r)+1,this.poolSize??(this.poolSize=this.minPoolSize),this.minPoolSize>this.poolSize){let s=Math.min(this.minPoolSize,this.maxPoolSize);this.expandPool(s)}}getStats(){let e=this.meshPool.filter(i=>!i.inUse).length,t=this.hits+this.misses>0?(this.hits/(this.hits+this.misses)*100).toFixed(1):"0",r=this.getEstimatedMemoryUsage();return{poolSize:this.poolSize,activeCount:this.activeSections.size,freeCount:e,hitRate:`${t}%`,hits:this.hits,misses:this.misses,memoryUsage:r}}getTotalTiles(){return Object.values(this.sectionObjects).reduce((e,t)=>e+(t.tilesCount||0),0)}getTotalBlocks(){return Object.values(this.sectionObjects).reduce((e,t)=>e+(t.blocksCount||0),0)}getEstimatedMemoryUsage(){let e=0,t=0,r=0,i=0,s=0,o=0,a=0,v=this.globalBlockBuffer?.mesh.geometry;if(v)for(let c of["a_w0","a_w1","a_w2","a_w3"]){let u=v.getAttribute(c);if(u){let h=u.array.byteLength;a+=h,e+=h}}for(let c of Object.values(this.sectionObjects)){let u=c.shaderMesh?.geometry;if(u)for(let h of["a_w0","a_w1","a_w2","a_w3"]){let p=u.getAttribute(h);if(p){let g=p.array.byteLength;a+=g,e+=g}}}for(let c of this.meshPool)if(c.inUse&&c.mesh.geometry){let{geometry:u}=c.mesh,h=u.getAttribute("position");if(h){let A=h.array.byteLength;t+=A,e+=A}let p=u.getAttribute("normal");if(p){let A=p.array.byteLength;r+=A,e+=A}let g=u.getAttribute("color");if(g){let A=g.array.byteLength;i+=A,e+=A}let y=u.getAttribute("uv");if(y){let A=y.array.byteLength;s+=A,e+=A}if(u.index){let A=u.index.array.byteLength;o+=A,e+=A}}return{total:`${(e/(1024*1024)).toFixed(2)} MB`,breakdown:{position:`${(t/(1024*1024)).toFixed(2)} MB`,normal:`${(r/(1024*1024)).toFixed(2)} MB`,color:`${(i/(1024*1024)).toFixed(2)} MB`,uv:`${(s/(1024*1024)).toFixed(2)} MB`,index:`${(o/(1024*1024)).toFixed(2)} MB`,shaderInstances:`${(a/(1024*1024)).toFixed(2)} MB`}}}dispose(){let e=[...this.activeSections.keys()];for(let t of e)this.releaseSection(t);this.signHeadsRenderer.dispose();for(let t of this.meshPool)t.mesh.geometry.dispose();this.meshPool.length=0,this.activeSections.clear(),this.chunkBoxMaterial.dispose(),this.shaderSectionRaycastBoxes.clear(),this.globalBlockBuffer?.dispose(),this.globalBlockBuffer=null,this.cubeShaderMaterial?.dispose(),this.cubeShaderMaterial=null,this.pendingNearReveal.clear();for(let t of this.nearRevealTimers.values())clearTimeout(t);this.nearRevealTimers.clear();for(let t of this.nearRevealGraceTimers.values())clearTimeout(t);this.nearRevealGraceTimers.clear()}acquireMesh(){if(this.bypassPooling){let t={mesh:new X.Mesh(new X.BufferGeometry,this.material),inUse:!0,lastUsedTime:performance.now()};return this.meshPool.push(t),this.poolSize++,t}for(let t of this.meshPool)if(!t.inUse)return t.inUse=!0,t.lastUsedTime=performance.now(),this.hits++,t;this.misses++;let e=Math.min(this.poolSize+16,this.maxPoolSize);e<=this.meshPool.length&&(e=this.meshPool.length+8,this.maxPoolSize=e),this.expandPool(e);for(let t=this.meshPool.length-1;t>=0;t--){let r=this.meshPool[t];if(!r.inUse)return r.inUse=!0,r.lastUsedTime=performance.now(),r}throw new Error("ChunkMeshManager: Failed to acquire mesh after pool expansion")}expandPool(e){let t=this.meshPool.length;this.poolSize=e;for(let r=t;r<e;r++){let i=new X.BufferGeometry,s=new X.Mesh(i,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(e,t,r,i){let s=e.getAttribute(t);s&&s.count===r.length/i?(s.array.set(r),s.needsUpdate=!0):e.setAttribute(t,new X.BufferAttribute(r,i))}clearGeometry(e){let t=["position","normal","color","uv"];for(let r of t)e.hasAttribute(r)&&e.deleteAttribute(r);e.index&&e.setIndex(null),e.boundingBox=null,e.boundingSphere=null}cleanupExcessMeshes(){if(this.poolSize>this.maxPoolSize){let e=this.meshPool.filter(t=>!t.inUse).length;if(e>0){let t=Math.min(this.poolSize-this.maxPoolSize,e);for(let r=0;r<t;r++){let i=this.meshPool.findIndex(s=>!s.inUse);i!==-1&&(this.meshPool[i].mesh.geometry.dispose(),this.meshPool.splice(i,1),this.poolSize--)}}}}disposeContainer(e){Re(e,!0)}recordRenderTime(e){this.renderTimes.push(e),this.renderTimes.length>this.maxRenderTimeSamples&&this.renderTimes.shift();let t=performance.now();t-this.lastPerformanceCheck>this.performanceCheckInterval&&(this.checkPerformance(),this.lastPerformanceCheck=t)}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((e,t)=>e+t,0)/this.renderTimes.length}checkPerformance(){if(this.renderTimes.length<this.maxRenderTimeSamples)return;let e=this.getAverageRenderTime(),t=16.67,r=t*1.5;if(e>r){let i=this.worldRenderer.viewDistance,s=Math.max(1,Math.floor(i*.8));(!this.performanceOverrideDistance||s<this.performanceOverrideDistance)&&(this.performanceOverrideDistance=s)}else if(this.performanceOverrideDistance&&e<t*1.1){let i=this.worldRenderer.viewDistance,s=Math.min(i,this.performanceOverrideDistance+1);s!==this.performanceOverrideDistance&&(this.performanceOverrideDistance=s>=i?void 0:s)}}updateSectionsVisibility(){let e=this.worldRenderer.cameraSectionPos;for(let[t,r]of Object.entries(this.sectionObjects)){if(r._waitingForChunkDisplay){r.visible=!1;continue}if(!this.performanceOverrideDistance){r.visible=!0;continue}let[i,s,o]=t.split(",").map(Number),a={x:i/16,y:s/16,z:o/16},v=a.x-e.x,l=a.z-e.z,c=Math.floor(Math.hypot(v,l));r.visible=c<=this.performanceOverrideDistance}}};d(bt,"NEAR_REVEAL_TIMEOUT_MS",5e3),d(bt,"EXPECTED_NEAR_GRACE_MS",1500);var j5=bt,$i=class{constructor(e){this.worldRendererThree=e;d(this,"chunkTextures",new Map)}dispose(){for(let[,e]of this.chunkTextures)for(let t of Object.keys(e))e[t].dispose();this.chunkTextures.clear()}renderHead(e,t,r,i){let s;if(i.SkullOwner?s=i.SkullOwner.Properties?.textures?.[0]?.Value:s=i.profile?.properties?.find(o=>o.name==="textures")?.value,!!s)try{let a=JSON.parse(z.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=D0(this.worldRendererThree,a,F0.head),c=new X.Group;return r&&l.position.set(0,.3125,.3125),l.position.y-=23/16,c.add(l),this.worldRendererThree.sceneOrigin.track(c),c.position.set(e.x+.5,e.y+.045,e.z+.5),c.rotation.set(0,-X.MathUtils.degToRad(t*(r?90:45/2)),0),c.scale.set(.8,.8,.8),c}catch{}}renderSign(e,t,r,i,s){let o=this.getSignTexture(e,s,i);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=i?1.3:1;a.scale.set(1*l,v*l,1*l);let c=(i?2:1.5)/16,u=.25/16;r&&!i?a.position.set(0,0,-.5+c+u+1e-4):a.position.set(0,0,c/2+1e-4);let h=new X.Group;h.rotation.set(0,-X.MathUtils.degToRad(t*(r?90:45/2)),0),h.add(a);let p=(i?10:8)/16,g=(i?0:r?4.333:9.333)/16,y=p/2+g;return this.worldRendererThree.sceneOrigin.track(h),h.position.set(e.x+.5,e.y+y,e.z+.5),h}getSignTexture(e,t,r,i=!1){let s=Ht(e),o=this.chunkTextures.get(`${s[0]},${s[1]}`);o||(o={},this.chunkTextures.set(`${s[0]},${s[1]}`,o));let a=`${e.x},${e.y},${e.z}`;if(o[a])return o[a];let v=Vv(this.worldRendererThree.version),l=h1(t,r,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(e,t){let r=`${Math.floor(e/16)},${Math.floor(t/16)}`,i=this.chunkTextures.get(r);if(i)for(let s of Object.keys(i))i[s].dispose(),delete i[s]}};E();x();k();R();E();x();k();R();import*as U0 from"three";var ar={},Aa=!1;function Nv(){if(Aa)return;let n=globalThis.loadedData?.tints;if(n){for(let e of Object.keys(n))ar[e]=Wv(n[e]);Aa=!0}}function Wv(n){let e={},t=Ea(n.default??16777215);if(n.data)for(let r of n.data){let i=Ea(r.color);for(let s of r.keys)e[s]=i}return new Proxy(e,{get(r,i){return r[i]??t}})}function Ea(n){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255]}function xa(n,e){return Nv(),n==="grass_block"?[1,1,1]:n==="redstone_wire"?[1,1,1]:n==="birch_leaves"||n==="spruce_leaves"||n==="lily_pad"?ar.constant?.[n]??[1,1,1]:n.includes("leaves")||n==="vine"?ar.foliage?.[e]??[1,1,1]:["short_grass","tall_grass","fern","large_fern","sugar_cane","grass"].includes(n)?ar.grass?.[e]??[1,1,1]:[1,1,1]}var jv=512,en=1/20,tn=class{constructor(e){this.worldRenderer=e;d(this,"particles",[]);d(this,"sharedMaterial");d(this,"enabled",!1);d(this,"tickAccumulator",0);d(this,"nextParticleIndex",0);d(this,"render",e=>{if(!this.enabled)return;for(this.tickAccumulator+=e;this.tickAccumulator>=en;)this.tickAccumulator-=en,this.tickPhysics();let t=this.tickAccumulator/en;this.updateVisuals(t)})}enable(){this.enabled||(this.enabled=!0,this.ensureMaterial())}disable(){this.enabled&&(this.enabled=!1)}dispose(){for(let e of this.particles)e.active&&this.worldRenderer.sceneOrigin.removeAndUntrack(e.mesh),e.mesh.geometry.dispose();this.particles=[],this.sharedMaterial?.dispose(),this.sharedMaterial=void 0,this.nextParticleIndex=0}spawnBlockBreakParticles(e,t,r,i,s,o="plains"){if(!this.enabled)return;let a=this.resolveBlockTexture(i);if(!a)return;let v=xa(i,o);for(let l=0;l<4;l++)for(let c=0;c<4;c++)for(let u=0;u<4;u++){let h=e+(l+.5)/4,p=t+(c+.5)/4,g=r+(u+.5)/4,y=h-e-.5,A=p-t-.5,b=g-r-.5;y+=(Math.random()*2-1)*.4,A+=(Math.random()*2-1)*.4,b+=(Math.random()*2-1)*.4;let w=(Math.random()+Math.random()+1)*.15,S=Math.sqrt(y*y+A*A+b*b),C=y/S*w*.4,M=A/S*w*.4+.1,I=b/S*w*.4,B=Math.floor(4/(Math.random()*.9+.1));this.createParticle(h,p,g,C,M,I,B,a,s,e,r,1,v)}}tickPhysics(){for(let e of this.particles){if(!e.active)continue;if(e.prevX=e.x,e.prevY=e.y,e.prevZ=e.z,e.age++,e.age>=e.maxAge){this.deactivateParticle(e);continue}e.yd-=.04,e.x+=e.xd,e.y+=e.yd,e.z+=e.zd;let t=this.getFloorY(e);e.y<=t?(e.y=t,e.yd=0,e.onGround=!0):e.onGround=!1,e.xd*=.98,e.yd*=.98,e.zd*=.98,e.onGround&&(e.xd*=.7,e.zd*=.7)}}updateVisuals(e){let t=this.worldRenderer.camera.position;for(let r of this.particles){if(!r.active)continue;let i=r.prevX+(r.x-r.prevX)*e,s=r.prevY+(r.y-r.prevY)*e,o=r.prevZ+(r.z-r.prevZ)*e;r.mesh.position.set(i,s,o),r.mesh.lookAt(t.x,t.y,t.z)}}spawnCrackParticle(e,t,r,i,s,o,a="plains"){if(!this.enabled)return;let v=this.resolveBlockTexture(s);if(!v)return;let l=xa(s,a),c=e+Math.random()*.8+.1,u=t+Math.random()*.8+.1,h=r+Math.random()*.8+.1;switch(i){case 0:u=t-.1;break;case 1:u=t+1+.1;break;case 2:h=r-.1;break;case 3:h=r+1+.1;break;case 4:c=e-.1;break;case 5:c=e+1+.1;break}let p=(Math.random()*2-1)*.4*.2,g=(Math.random()*2-1)*.4*.2+.1*.2,y=(Math.random()*2-1)*.4*.2,A=Math.floor(4/(Math.random()*.9+.1));this.createParticle(c,u,h,p,g,y,A,v,o,e,r,.6,l)}createParticle(e,t,r,i,s,o,a,v,l,c,u,h=1,p=[1,1,1]){this.ensureMaterial();let g=this.findInactiveParticle();g||(this.particles.length<jv?g=this.allocateParticle():g=this.recycleOldest());let y=Math.floor(Math.random()*4),A=Math.floor(Math.random()*4),b=v.u+y/4*v.su,w=v.v+A/4*v.sv,S=v.su/4,C=v.sv/4;this.setGeometryUVs(g.mesh.geometry,b,w,S,C),g.active=!0,g.x=e,g.y=t,g.z=r,g.prevX=e,g.prevY=t,g.prevZ=r,g.xd=i,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(u);let M=.1*(.5+Math.random()*.5)*2*h;g.mesh.scale.set(M,M,M),g.mesh.position.set(e,t,r),g.mesh.visible=!0;let I=.6*p[0],B=.6*p[1],H=.6*p[2],G=new Float32Array([I,B,H,I,B,H,I,B,H,I,B,H]),O=g.mesh.geometry.getAttribute("color");O?(O.set(G),O.needsUpdate=!0):g.mesh.geometry.setAttribute("color",new U0.Float32BufferAttribute(G,3)),this.worldRenderer.sceneOrigin.addAndTrack(g.mesh)}allocateParticle(){let e=new U0.PlaneGeometry(1,1),t=new U0.Mesh(e,this.sharedMaterial);t.visible=!1;let r={mesh:t,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(r),r}findInactiveParticle(){for(let e=0;e<this.particles.length;e++){let t=(this.nextParticleIndex+e)%this.particles.length;if(!this.particles[t].active)return this.nextParticleIndex=(t+1)%this.particles.length,this.particles[t]}}recycleOldest(){let e=this.particles[0];for(let t of this.particles)t.age>e.age&&(e=t);return this.deactivateParticle(e),e}deactivateParticle(e){e.active&&(e.active=!1,e.mesh.visible=!1,this.worldRenderer.sceneOrigin.removeAndUntrack(e.mesh))}getFloorY(e){let t=Math.floor(e.x)-e.blockX,r=Math.floor(e.z)-e.blockZ;return t=Math.max(-2,Math.min(2,t)),r=Math.max(-2,Math.min(2,r)),e.floorMap[(r+2)*5+(t+2)]}resolveBlockTexture(e){let t=this.worldRenderer.resourcesManager.currentResources;if(!t)return null;let r=t.blocksAtlasJson,i=r.textures;if(i[e])return this.extractUV(i[e],r);for(let s of["_side","_top","_front","_0",""]){let o=e+s;if(i[o])return this.extractUV(i[o],r)}for(let s of Object.keys(i))if(s.startsWith(e))return this.extractUV(i[s],r);return null}extractUV(e,t){return{u:e.u,v:e.v,su:e.su??t.suSv,sv:e.sv??t.suSv}}setGeometryUVs(e,t,r,i,s){let o=e.getAttribute("uv");o.setXY(0,t,r),o.setXY(1,t+i,r),o.setXY(2,t,r+s),o.setXY(3,t+i,r+s),o.needsUpdate=!0}ensureMaterial(){if(this.sharedMaterial)return;let e=this.worldRenderer.material.map;e&&(this.sharedMaterial=new U0.MeshBasicMaterial({map:e,vertexColors:!0,transparent:!0,alphaTest:.1}))}},Ra={id:"blockBreakParticles",controller:tn,enabledDefault:!0,cannotBeDisabled:!0,requiresHeightmap:!1};E();x();k();R();var rn=class{constructor(e){this.worldRenderer=e;d(this,"enabled",!1);d(this,"lastBobWalkDist",0);d(this,"lastBobTickTime",0);d(this,"render",()=>{if(!this.enabled)return;let e=this.worldRenderer.displayOptions.inWorldRenderingConfig,{perspective:t}=this.worldRenderer.playerStateReactive;if(e.viewBobbing&&t==="first_person"&&!this.worldRenderer.playerStateUtils.isSpectator()){this.worldRenderer.playerStateReactive.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=performance.now(),this.lastBobWalkDist=this.worldRenderer.playerStateReactive.walkDist);let i=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:i})}else this.worldRenderer.cameraShake.setCameraBobInput(null)})}enable(){this.enabled=!0}disable(){this.enabled=!1,this.worldRenderer.cameraShake.setCameraBobInput(null);let{perspective:e}=this.worldRenderer.playerStateReactive;e==="first_person"&&this.worldRenderer.camera.position.set(0,0,0)}dispose(){this.disable()}},ka={id:"cameraBobbing",controller:rn,enabledDefault:!0,cannotBeDisabled:!0};E();x();k();R();import*as Pe from"three";var nn=2e3,Ta=32,Ma=32,vr=12,Sa=24,lr=1.2,Yv=-5;var sn=class{constructor(e){this.worldRenderer=e;d(this,"instancedMesh");d(this,"geometry");d(this,"material");d(this,"particles",[]);d(this,"enabled",!1);d(this,"dummy",new Pe.Matrix4);d(this,"tempPosition",new Pe.Vector3);d(this,"tempQuaternion",new Pe.Quaternion);d(this,"tempScale",new Pe.Vector3);d(this,"render",e=>{if(!this.enabled||!this.instancedMesh||!this.material)return;this.syncMaterialToSceneFog();let t=this.worldRenderer.getCameraPosition();this.instancedMesh.position.set(0,0,0);let r=this.worldRenderer.reactiveState.world.heightmaps,{dummy:i,tempPosition:s,tempQuaternion:o,tempScale:a}=this,v=NaN,l=NaN,c;for(let u=0;u<nn;u++){let h=this.particles[u];this.instancedMesh.getMatrixAt(u,i),i.decompose(s,o,a),s.addScaledVector(h.velocity,e);let p=s.y,g=Math.sqrt(s.x*s.x+s.z*s.z),y=t.x+s.x,A=t.y+s.y,b=t.z+s.z,w=Math.floor(y/16),S=Math.floor(b/16);(w!==v||S!==l)&&(c=r[`${w},${S}`],v=w,l=S);let C=(Math.floor(y)%16+16)%16,M=(Math.floor(b)%16+16)%16,I=c?.[M*16+C];if(g>Ta||I!==void 0&&I!==-32768&&A<=I+1+h.despawnOffset||p<Yv){this.respawnParticle(s);let H=vr+Math.random()*(Sa-vr);h.velocity.set((Math.random()-.5)*lr,-H,(Math.random()-.5)*lr),h.despawnOffset=Math.random()*.5}i.compose(s,o,a),this.instancedMesh.setMatrixAt(u,i)}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 e=this.worldRenderer.scene.fog;e instanceof Pe.Fog||e instanceof Pe.FogExp2?this.material.color.copy(e.color):this.material.color.set(13426158),this.material.fog=!0}createRain(){this.geometry=new Pe.BoxGeometry(.03,.3,.03),this.material=new Pe.MeshBasicMaterial({color:13426158,transparent:!0,opacity:.35,depthWrite:!0,fog:!0}),this.instancedMesh=new Pe.InstancedMesh(this.geometry,this.material,nn),this.instancedMesh.name="rain-particles",this.instancedMesh.frustumCulled=!1,this.syncMaterialToSceneFog();let e=new Pe.Matrix4,t=new Pe.Vector3;for(let r=0;r<nn;r++){this.respawnParticle(t),t.y=Math.random()*Ma,e.setPosition(t),this.instancedMesh.setMatrixAt(r,e);let i=vr+Math.random()*(Sa-vr);this.particles.push({velocity:new Pe.Vector3((Math.random()-.5)*lr,-i,(Math.random()-.5)*lr),age:0,despawnOffset:Math.random()*.5})}this.instancedMesh.instanceMatrix.needsUpdate=!0,this.worldRenderer.scene.add(this.instancedMesh)}respawnParticle(e){let t=Math.random()*Math.PI*2,r=Math.random()*Ta;e.set(Math.cos(t)*r,Ma,Math.sin(t)*r)}},Ca={id:"rain",controller:sn,enabledDefault:!1,requiresHeightmap:!0};E();x();k();R();import*as ye from"three";var Ba=new ye.Color(13/255,234/255,238/255),Qv=9;var Kv=350,Jv=650;var qv=120,Zv=280,on=class{constructor(e){this.worldRenderer=e;d(this,"pendingGeometries",new Map);d(this,"revealingSections",new Map);d(this,"finishedChunkCount",0);d(this,"revealTriggered",!1);d(this,"revealStartTime",0);d(this,"enabled",!1);d(this,"onWorldSwitchedCb",null);d(this,"patched",!1);d(this,"initialWaveDone",!1);d(this,"initialRevealWaveSettled",!1);d(this,"wireframeMaterial");d(this,"wireframeGlowMaterial");d(this,"pulseTime",0);d(this,"revealedChunks",new Set);d(this,"originalFinishChunk",null);d(this,"originalDestroy",null);d(this,"originalSceneAdd",null);d(this,"originalHandleWorkerMessage",null);d(this,"render",e=>{this.enabled&&this.update(e*1e3)});this.wireframeMaterial=new ye.LineBasicMaterial({color:Ba,transparent:!0,opacity:1,blending:ye.AdditiveBlending,depthWrite:!1}),this.wireframeGlowMaterial=new ye.LineBasicMaterial({color:Ba,transparent:!0,opacity:.55,blending:ye.AdditiveBlending,depthWrite:!1})}isFuturisticRevealConfigured(){return this.worldRenderer.worldRendererConfig.futuristicReveal===!0}isInInitialRevealCampaign(){return this.enabled&&!this.initialRevealWaveSettled}autoEnableCheck(){return this.isFuturisticRevealConfigured()}enable(){if(this.isFuturisticRevealConfigured()&&!(this.enabled&&this.patched)){if(this.enabled&&!this.patched){this.patchWorldRenderer();return}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 e=this.worldRenderer;this.onWorldSwitchedCb=()=>this.reset(),e.onWorldSwitched.push(this.onWorldSwitchedCb),this.originalFinishChunk=e.finishChunk.bind(e),e.finishChunk=t=>{this.originalFinishChunk(t),this.onChunkFinished(t)},this.originalDestroy=e.destroy.bind(e),e.destroy=()=>{this.dispose(),this.originalDestroy()},this.originalHandleWorkerMessage=e.handleWorkerMessage.bind(e),e.handleWorkerMessage=t=>{this.originalHandleWorkerMessage(t),this.enabled&&t?.type==="geometry"&&Promise.resolve().then(()=>{try{this.registerSection(t.key,t.geometry)}catch{}})},this.originalSceneAdd=e.scene.add.bind(e.scene),e.scene.add=(...t)=>{let r=this.originalSceneAdd(...t);for(let i of t)this.checkAndPatchMesh(i);return r}}unpatchWorldRenderer(){let e=this.worldRenderer;if(this.originalFinishChunk&&(e.finishChunk=this.originalFinishChunk,this.originalFinishChunk=null),this.originalDestroy&&(e.destroy=this.originalDestroy,this.originalDestroy=null),this.originalHandleWorkerMessage&&(e.handleWorkerMessage=this.originalHandleWorkerMessage,this.originalHandleWorkerMessage=null),this.originalSceneAdd&&(e.scene.add=this.originalSceneAdd,this.originalSceneAdd=null),this.onWorldSwitchedCb){let t=e.onWorldSwitched.indexOf(this.onWorldSwitchedCb);t!==-1&&e.onWorldSwitched.splice(t,1),this.onWorldSwitchedCb=null}this.patched=!1}checkAndPatchMesh(e){if(e instanceof ye.Mesh&&(e.name==="mesh"||e.name==="shaderMesh")){let t=this.findSectionKeyForMesh(e);t&&this.shouldUseRevealEffect(t)&&(e.visible=!1,e.hiddenByReveal=!0)}for(let t of e.children)this.checkAndPatchMesh(t)}findSectionKeyForMesh(e){let t=e;for(;t;){let{sectionKey:p}=t;if(p&&this.worldRenderer.chunkMeshManager.sectionObjects[p]===t)return p;t=t.parent}let r=this.worldRenderer.sceneOrigin.getWorldPosition(e),i=r?.x??this.worldRenderer.sceneOrigin.toWorldX(e.position.x),s=r?.y??this.worldRenderer.sceneOrigin.toWorldY(e.position.y),o=r?.z??this.worldRenderer.sceneOrigin.toWorldZ(e.position.z),a=16,v=this.worldRenderer.getSectionHeight(),l=Math.floor(i/a)*a,c=Math.floor(s/v)*v,u=Math.floor(o/a)*a,h=`${l},${c},${u}`;return this.worldRenderer.chunkMeshManager.sectionObjects[h]?h:null}get scene(){return this.worldRenderer.realScene}getCameraPosition(){return this.worldRenderer.getCameraPosition()}sectionHasRevealContent(e){return(e.wireframePositions?.length??0)>0||(e.positions?.length??0)>0?!0:(e.shaderCubes?.count??0)>0}getSectionRenderMeshes(e){let t=this.worldRenderer.chunkMeshManager.sectionObjects[e];if(!t)return[];let r=[];for(let i of["mesh","shaderMesh"]){let s=t.children.find(o=>o.name===i);s instanceof ye.Mesh&&r.push(s)}return r}hideSectionRenderMeshes(e){let t=this.getSectionRenderMeshes(e);for(let r of t)r.visible=!1,r.hiddenByReveal=!0;return t}setMeshFadeOpacity(e,t){if(e.name==="shaderMesh"){e.visible=t>.001;return}let r=e.material;if(!Array.isArray(r))if(r.originalMaterial)r.opacity=t,r.transparent=!0,r.needsUpdate=!0;else{r.originalMaterial=r;let i=r.clone();i.transparent=!0,i.opacity=t,i.needsUpdate=!0,e.material=i}}restoreMeshMaterial(e){let t=e.originalMaterial;if(!t)return;let r=e.material;e.material=t,r!==t&&r.dispose(),delete e.originalMaterial}onChunkFinished(e){this.finishedChunkCount++,!this.revealTriggered&&this.finishedChunkCount>=Qv&&this.triggerReveal()}registerSection(e,t){if(!(this.revealedChunks.has(e)||this.revealingSections.has(e))){if(this.revealTriggered&&this.initialWaveDone){this.revealedChunks.add(e);return}this.revealTriggered?this.startSectionReveal(e,t):this.pendingGeometries.set(e,t)}}shouldUseRevealEffect(e){return!this.enabled||this.revealTriggered&&this.initialWaveDone?!1:!this.revealedChunks.has(e)&&!this.revealingSections.has(e)}triggerReveal(){this.revealTriggered=!0,this.initialWaveDone=!0,this.revealStartTime=performance.now();let e=this.getCameraPosition(),t=[...this.pendingGeometries.entries()];this.pendingGeometries.clear();let r=t.map(([s,o])=>{let a=Math.hypot(o.sx-e.x,o.sy-e.y,o.sz-e.z);return{key:s,geometry:o,distance:a}}).sort((s,o)=>s.distance-o.distance),i=r.at(-1)?.distance||1;for(let{key:s,geometry:o,distance:a}of r){let v=a/i*1500;setTimeout(()=>{!this.revealedChunks.has(s)&&!this.revealingSections.has(s)&&this.startSectionReveal(s,o)},v)}}startSectionReveal(e,t){if(!this.sectionHasRevealContent(t)||this.revealingSections.has(e)||this.revealedChunks.has(e))return;let r=this.createWireframeGeometry(t),i=this.worldRenderer.chunkMeshManager.globalBlockBuffer,s=i?.hasSection(e)?i.takeSectionData(e):void 0,o=this.hideSectionRenderMeshes(e),a=new ye.LineSegments(r,this.wireframeMaterial.clone());this.worldRenderer.sceneOrigin.track(a),a.position.set(t.sx,t.sy,t.sz),a.name="scifi-wireframe",a.renderOrder=1e3;let v=new ye.LineSegments(r.clone(),this.wireframeGlowMaterial.clone());this.worldRenderer.sceneOrigin.track(v),v.position.set(t.sx,t.sy,t.sz),v.scale.set(1.02,1.02,1.02),v.name="scifi-glow",v.renderOrder=999;let l=new ye.Group;l.add(a),l.add(v),l.name="scifi-reveal-group",l.sectionKey=e,this.scene.add(l);let c=this.initialWaveDone?qv:Kv,u=this.initialWaveDone?Zv:Jv,h={key:e,wireframeGroup:l,revealStartTime:performance.now(),phase:"wireframe",renderMeshRefs:o,globalShaderRestore:s,wireframeMs:c,revealMs:u};setTimeout(()=>{for(let p of this.getSectionRenderMeshes(e))p.hiddenByReveal||this.hideSectionRenderMeshes(e)},0),this.revealingSections.set(e,h)}createSectionBoundsWireframe(){let r=[[-8,-8,-8],[8,-8,-8],[-8,8,-8],[8,8,-8],[-8,-8,8],[8,-8,8],[-8,8,8],[8,8,8]],i=[[0,1],[1,3],[3,2],[2,0],[4,5],[5,7],[7,6],[6,4],[0,4],[1,5],[2,6],[3,7]],s=[];for(let[a,v]of i)s.push(...r[a],...r[v]);let o=new ye.BufferGeometry;return o.setAttribute("position",new ye.Float32BufferAttribute(s,3)),o}createWireframeGeometry(e){if(e.wireframePositions&&e.wireframePositions.length>0){let a=new ye.BufferGeometry;return a.setAttribute("position",new ye.Float32BufferAttribute(e.wireframePositions,3)),a}let t=e.positions,r=e.indices;if(!t?.length||!r?.length)return this.createSectionBoundsWireframe();let i=[],s=new Set;for(let a=0;a<r.length;a+=3){let v=r[a],l=r[a+1],c=r[a+2];this.addEdge(t,v,l,i,s),this.addEdge(t,l,c,i,s),this.addEdge(t,c,v,i,s)}let o=new ye.BufferGeometry;return o.setAttribute("position",new ye.Float32BufferAttribute(i,3)),o}addEdge(e,t,r,i,s){let o=Math.min(t,r),a=Math.max(t,r),v=`${o}-${a}`;s.has(v)||(s.add(v),i.push(e[t*3],e[t*3+1],e[t*3+2],e[r*3],e[r*3+1],e[r*3+2]))}update(e){if(!this.enabled||this.revealingSections.size===0)return;this.pulseTime+=e*.001;let t=performance.now(),r=.6+.4*Math.sin(this.pulseTime*4),i=[];for(let[s,o]of this.revealingSections){let a=t-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=r;let u=.85+.15*Math.sin(this.pulseTime*6+a*.002);c.color.setRGB(13/255*u,234/255*u,238/255*u)}if(l?.material){let c=l.material;c.opacity=r*.4}if(a>o.wireframeMs){o.phase="transitioning",o.renderMeshRefs=this.getSectionRenderMeshes(s);for(let c of o.renderMeshRefs)c.visible=!0,this.setMeshFadeOpacity(c,0)}}else if(o.phase==="transitioning"){let v=a-o.wireframeMs,l=Math.min(1,v/o.revealMs),c=1-(1-l)**3,u=o.wireframeGroup.children[0],h=o.wireframeGroup.children[1];if(u?.material){let p=u.material;p.opacity=1-c}if(h?.material){let p=h.material;p.opacity=(1-c)*.55}for(let p of o.renderMeshRefs)this.setMeshFadeOpacity(p,c);l>=1&&(o.phase="complete",i.push(o))}}for(let s of i)this.completeReveal(s)}completeReveal(e){this.revealingSections.delete(e.key),this.revealedChunks.add(e.key),this.revealTriggered&&this.revealingSections.size===0&&(this.initialRevealWaveSettled=!0);for(let t of e.renderMeshRefs)this.restoreMeshMaterial(t),t.visible=!0,delete t.hiddenByReveal;this.worldRenderer.chunkMeshManager.migrateDeferredShaderToGlobal(e.key),e.globalShaderRestore&&this.worldRenderer.chunkMeshManager.globalBlockBuffer?.addSection(e.key,e.globalShaderRestore.words,e.globalShaderRestore.count),this.disposeWireframeGroup(e.wireframeGroup)}disposeWireframeGroup(e){this.worldRenderer.sceneOrigin.removeAndUntrackAll(e);let t=[];e.traverse(r=>{t.push(r)});for(let r of t){let i=r;if(i.geometry&&i.geometry.dispose(),i.material){let s=i.material;if(Array.isArray(s))for(let o of s)o.dispose();else s&&typeof s.dispose=="function"&&s.dispose()}}e.clear()}reset(){for(let e of this.revealingSections.values())this.disposeWireframeGroup(e.wireframeGroup);this.pendingGeometries.clear(),this.revealingSections.clear(),this.revealedChunks.clear(),this.finishedChunkCount=0,this.revealTriggered=!1,this.initialWaveDone=!1,this.initialRevealWaveSettled=!1,this.revealStartTime=0,this.pulseTime=0}forceCompleteAll(){let e=[...this.revealingSections.values()];for(let t of e){t.renderMeshRefs=this.getSectionRenderMeshes(t.key);for(let r of t.renderMeshRefs)this.restoreMeshMaterial(r),r.visible=!0,delete r.hiddenByReveal;this.completeReveal(t)}}debugGetWireframeGroups(){let e=[];return this.scene.traverse(t=>{t.name==="scifi-reveal-group"&&e.push(t)}),e}debugForceCleanup(){let e=this.debugGetWireframeGroups();for(let t of e)this.disposeWireframeGroup(t);for(let t of this.revealingSections.values())this.disposeWireframeGroup(t.wireframeGroup);this.revealingSections.clear()}debugStatus(){let e=this.debugGetWireframeGroups(),t=new Set(this.revealingSections.keys()),r=e.filter(i=>!t.has(i.sectionKey));return{revealTriggered:this.revealTriggered,finishedChunkCount:this.finishedChunkCount,pendingGeometries:this.pendingGeometries.size,revealingSections:this.revealingSections.size,revealedChunks:this.revealedChunks.size,wireframeGroupsInScene:e.length,orphanedWireframeGroups:r.length,orphanedKeys:r.map(i=>i.sectionKey),sections:[...this.revealingSections.entries()].map(([i,s])=>({key:i,phase:s.phase,renderMeshCount:s.renderMeshRefs.length,wireframeInScene:s.wireframeGroup.parent!==null}))}}debugLog(){}},Pa={id:"futuristicReveal",controller:on,enabledDefault:!0};E();x();k();R();import*as Te from"three";var Xv=parseInt(Te.REVISION.replaceAll(/\D+/g,""),10),an=class extends Te.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
|
|
21489
21489
|
uniform float time;
|
|
21490
21490
|
attribute float size;
|
|
21491
21491
|
varying vec3 vColor;
|
|
@@ -21504,8 +21504,8 @@ void main() {
|
|
|
21504
21504
|
gl_FragColor = vec4(vColor, 1.0);
|
|
21505
21505
|
|
|
21506
21506
|
#include <tonemapping_fragment>
|
|
21507
|
-
#include <${
|
|
21508
|
-
}`})}},fn=class{constructor(e){this.worldRenderer=e;d(this,"points");d(this,"clock",new Me.Clock);d(this,"enabled",!1);d(this,"currentTime");d(this,"enablementCheck",()=>this.currentTime?this.currentTime>13500&&this.currentTime<23e3:!1);d(this,"render",e=>{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(e){this.currentTime=e,this.enabled&&this.updateVisibility()}updateVisibility(){if(!this.enabled)return;let e=this.enablementCheck?.()??!1;e&&!this.points?this.createStars():!e&&this.points&&this.removeStars()}createStars(){if(this.points)return;let e=80,t=50,r=7e3,i=7,s=10,o=new Me.BufferGeometry,v=y=>new Me.Vector3().setFromSpherical(new Me.Spherical(y,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),a=[],l=[],c=Array.from({length:r},()=>(.5+.5*Math.random())*i),u=new Me.Color,f=e+t,p=t/r;for(let y=0;y<r;y++)f-=p*Math.random(),a.push(...v(f).toArray()),u.setHSL(y/r,s,.9),l.push(u.r,u.g,u.b);o.setAttribute("position",new Me.Float32BufferAttribute(a,3)),o.setAttribute("color",new Me.Float32BufferAttribute(l,3)),o.setAttribute("size",new Me.Float32BufferAttribute(c,1));let g=new un;g.blending=Me.AdditiveBlending,g.depthTest=!0,g.depthWrite=!1,g.transparent=!0,this.points=new Me.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)}},La={id:"starfield",controller:fn,enabledDefault:!0,cannotBeDisabled:!0};var Ua={starfield:La,futuristicReveal:za,rain:Da,cameraBobbing:Pa,blockBreakParticles:Ba};var _t=class _t extends y1{constructor(t,r,i){if(!i.resourcesManager)throw new Error("resourcesManager is required in displayOptions");super(i.resourcesManager,i,r);this.renderer=t;this.initOptions=r;this.displayOptions=i;d(this,"outputFormat","threeJs");d(this,"chunkMeshManager");d(this,"chunkTextures",new Map);d(this,"signsCache",new Map);d(this,"cameraSectionPos",new V0(0,0,0));d(this,"holdingBlock");d(this,"holdingBlockLeft");d(this,"scene",new Q.Scene);d(this,"ambientLight",new Q.AmbientLight(13421772));d(this,"directionalLight",new Q.DirectionalLight(16777215,.5));d(this,"entities",new U1(this,globalThis.mcData));d(this,"performanceMonitor");d(this,"cameraGroupVr");d(this,"material",new Q.MeshBasicMaterial({vertexColors:!0,transparent:!0,alphaTest:.1}));d(this,"itemsTexture");d(this,"cursorBlock");d(this,"onRender",[]);d(this,"lastRenderTime",0);d(this,"animatedFov",0);d(this,"lastFovAnimTime",0);d(this,"cameraShake");d(this,"cameraContainer");d(this,"media");d(this,"waypoints");d(this,"cinimaticScript");d(this,"camera");d(this,"renderTimeAvg",0);d(this,"pendingSectionUpdates",new Map);d(this,"pendingSectionBufferStartTimes",new Map);d(this,"modules",{});d(this,"sectionsOffsetsAnimations",{});d(this,"fountains",[]);d(this,"fireworksLegacy");d(this,"DEBUG_RAYCAST",!1);d(this,"skyboxRenderer");d(this,"fireworks");d(this,"sceneOrigin",new X1(this.scene));d(this,"cameraWorldPos",{x:0,y:0,z:0});d(this,"_cameraPositionAccessWarned",!1);d(this,"_tmpCameraPos",new Q.Vector3);d(this,"currentPosTween");d(this,"currentRotTween");d(this,"_tpDirection",new Q.Vector3);d(this,"_tpPitchQuat",new Q.Quaternion);d(this,"_tpYawQuat",new Q.Quaternion);d(this,"_tpFinalQuat",new Q.Quaternion);d(this,"_tpScenePos",new Q.Vector3);d(this,"_tpAxisX",new Q.Vector3(1,0,0));d(this,"_tpAxisY",new Q.Vector3(0,1,0));d(this,"_tpRaycaster",new Q.Raycaster);d(this,"_tpChunkWorldPos",new Q.Vector3);d(this,"debugOverlayAdded",!1);d(this,"debugRaycastHelper");d(this,"debugHitPoint");d(this,"prevFramePerspective",null);this.performanceMonitor=new d5(this.reactiveState.world.instabilityFactors),this.renderer=t;let s=_t.getRendererInfo(t)??"...";i.rendererState.renderer=s,this.chunkMeshManager=new K5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.onRenderDistanceChanged=o=>{this.chunkMeshManager.updateViewDistance(o)},this.cursorBlock=new G1(this),this.holdingBlock=V5(this),this.holdingBlockLeft=V5(this,!0);for(let o of Object.values(Ua))this.registerModule(o);this.skyboxRenderer=new Z1(this.realScene,!1,null),this.skyboxRenderer.init(),this.addDebugOverlay(),this.resetScene(),this.init(),this.soundSystem=new W1(this),this.cameraShake=new N1(this,this.onRender),this.media=new j1(this),this.fireworksLegacy=new K1(this),this.waypoints=new Q1(this),this.cinimaticScript=new J1(this,(o,v,a)=>this.setCinimaticCamera(o,v,a),o=>this.setCinimaticFov(o),()=>({position:new V0(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",o=>{this.finishChunk(o)}),this.worldSwitchActions(),this.initializeModules()}isShaderCubeBlocksEnabled(){return this.worldRendererConfig.shaderCubeBlocks===!0&&!!this.renderer?.capabilities?.isWebGL2}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(t){if(t.id in this.modules)return;let r=new t.controller(this),i={manifest:t,controller:r,enabled:!1,toggle:()=>this.toggleModule(t.id)};this.modules[t.id]=i,t.enabledDefault&&this.toggleModule(t.id,!0)}enableModule(t){let r=this.modules[t];r&&(r.enabled||(r.enabled=!0,r.controller.enable(),r.controller.render&&this.onRender.push(r.controller.render)))}disableModule(t){let r=this.modules[t];if(r&&!r.manifest.cannotBeDisabled&&r.enabled&&(r.enabled=!1,r.controller.disable(),r.controller.render)){let i=this.onRender.indexOf(r.controller.render);i>-1&&this.onRender.splice(i,1)}}toggleModule(t,r){let i=this.modules[t];if(!i)return!1;let s=r!==void 0?r:!i.enabled;if(s===i.enabled)return i.enabled;if(!s&&i.manifest.cannotBeDisabled)return!0;if(i.enabled=s,s)i.controller.enable(),i.controller.render&&!this.onRender.includes(i.controller.render)&&this.onRender.push(i.controller.render);else if(i.controller.disable(),i.controller.render){let o=this.onRender.indexOf(i.controller.render);o>-1&&this.onRender.splice(o,1)}return s}disposeModules(){for(let t of Object.values(this.modules))t.controller.dispose();this.modules={}}initializeModules(){this.updateModulesFromConfig()}getModule(t){return this.modules[t]?.controller}anyModuleRequiresHeightmap(){return Object.values(this.modules).some(t=>t.enabled&&t.manifest.requiresHeightmap)}get cameraObject(){return this.cameraGroupVr??this.cameraContainer}_wrapCameraPositionWithWarning(){let t=this.camera.position,r=this,i=20,s=(a,l,c)=>Math.abs(a)>i||Math.abs(l)>i||Math.abs(c)>i,o=()=>{!r._cameraPositionAccessWarned&&typeof D<"u"},v=new Proxy(t,{set(a,l,c){return(l==="x"||l==="y"||l==="z")&&typeof c=="number"&&Math.abs(c)>i&&o(),a[l]=c,!0},get(a,l,c){let u=a[l];return l==="set"?function(f,p,g){return s(f,p,g)&&o(),a.set(f,p,g)}:l==="setX"||l==="setY"||l==="setZ"?function(f){return Math.abs(f)>i&&o(),a[l](f)}:l==="copy"?function(f){return s(f.x,f.y,f.z)&&o(),a.copy(f)}:typeof u=="function"?u.bind(a):u}});Object.defineProperty(this.camera,"position",{value:v,configurable:!0,enumerable:!0})}worldSwitchActions(){this.onWorldSwitched.push(()=>{this.protocolCustomBlocks.clear(),this.sectionsOffsetsAnimations={},this.waypoints.clear(),this.cinimaticScript.stopScript(),this.fireworks.clear()})}downloadWorldGeometry(){Xi(this,new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraShake.getBaseRotation(),"world-geometry.json")}updateEntity(t,r=!1){let i={rotation:{head:{x:t.headPitch??t.pitch,y:t.headYaw,z:0}}};r?this.entities.updateEntityPosition(t,!1,i):this.entities.update(t,i)}updatePlayerEntity(t){this.entities.handlePlayerEntity(t)}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 t=this.renderer.getSize(new Q.Vector2);this.camera=new Q.PerspectiveCamera(75,t.x/t.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",t=>{this.skyboxRenderer.updateWaterState(t,this.playerStateReactive.waterBreathing)}),this.onReactivePlayerStateUpdated("waterBreathing",t=>{this.skyboxRenderer.updateWaterState(this.playerStateReactive.inWater,t)}),this.onReactivePlayerStateUpdated("ambientLight",t=>{t&&(this.ambientLight.intensity=t)}),this.onReactivePlayerStateUpdated("directionalLight",t=>{t&&(this.directionalLight.intensity=t)}),this.onReactivePlayerStateUpdated("lookingAtBlock",t=>{this.cursorBlock.setHighlightCursorBlock(t?new V0(t.x,t.y,t.z):null,t?.shapes)}),this.onReactivePlayerStateUpdated("diggingBlock",t=>{this.cursorBlock.updateBreakAnimation(t?{x:t.x,y:t.y,z:t.z}:void 0,t?.stage??null,t?.mergedShape)}),this.onReactivePlayerStateUpdated("perspective",t=>{let r=new V0(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z);this.updateCamera(r,this.cameraShake.getBaseRotation().yaw,this.cameraShake.getBaseRotation().pitch)})}watchReactiveConfig(){super.watchReactiveConfig(),this.onReactiveConfigUpdated("showChunkBorders",r=>{this.updateShowChunksBorder(r)}),this.onReactiveConfigUpdated("defaultSkybox",r=>{this.skyboxRenderer.updateDefaultSkybox(r)}),this.onReactiveConfigUpdated("shaderCubeDebugMode",()=>{this.chunkMeshManager.syncCubeShaderUniforms()}),this.onReactiveConfigUpdated("futuristicReveal",()=>{this.updateModulesFromConfig()});let t=this.displayOptions.inWorldRenderingConfig.handRenderer;this.onReactiveConfigUpdated("handRenderer",r=>{if(r===t)return;t=r;let i=this.holdingBlock.ready,s=this.holdingBlockLeft.ready;this.holdingBlock.dispose(),this.holdingBlockLeft.dispose(),this.holdingBlock=V5(this),this.holdingBlockLeft=V5(this,!0),i&&(this.holdingBlock.ready=!0,this.holdingBlock.updateItem()),s&&(this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem())}),this.onReactiveConfigUpdated("*",()=>{this.updateModulesFromConfig()}),this.updateModulesFromConfig()}updateModulesFromConfig(){let{moduleStates:t}=this.worldRendererConfig;for(let[r,i]of Object.entries(this.modules)){let s=t[r];if(s==="enabled"){i.enabled||this.toggleModule(r,!0);continue}if(s==="disabled"){i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1);continue}if(s==="auto"||s===void 0)if(i.controller.autoEnableCheck){let o=i.controller.autoEnableCheck();o&&!i.enabled?this.toggleModule(r,!0):!o&&i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1)}else{let o=i.manifest.enabledDefault??!1;o&&!i.enabled?this.toggleModule(r,!0):!o&&i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1)}}}changeHandSwingingState(t,r=!1){let i=r?this.holdingBlockLeft:this.holdingBlock;t?i.startSwing():i.stopSwing()}async updateAssetsData(){let t=this.resourcesManager.currentResources,r=this.material.map,i=this.itemsTexture,s=H0(t.blocksAtlasImage);s.needsUpdate=!0,s.flipY=!1,this.material.map=s,this.chunkMeshManager.syncCubeShaderUniforms();let o=H0(t.itemsAtlasImage);o.needsUpdate=!0,o.flipY=!1,this.itemsTexture=o,r&&r.dispose(),i&&i.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(t){this.realScene.background=new Q.Color(t[0],t[1],t[2])}changeCardinalLight(t){this.worldRendererConfig.cardinalLight=t}timeUpdated(t){let r=this.getModule("starfield");r?.updateTimeOfDay&&r.updateTimeOfDay(t),this.skyboxRenderer.updateTime(t)}biomeUpdated(t){t?.temperature!==void 0&&this.skyboxRenderer.updateTemperature(t.temperature)}biomeReset(){this.skyboxRenderer.updateTemperature(ji)}getItemRenderData(t,r){return ra(t,r,this.resourcesManager,this.playerStateReactive)}async demoModel(){let t=cursorBlockRel(0,1,0).position,r=await T5();Fs(r,t);let i=new Q.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}demoItem(){let t=cursorBlockRel(0,1,0).position,{mesh:r}=this.entities.getItemMesh({itemId:541},{});r.position.set(t.x+.5,t.y+.5,t.z+.5);let i=new Q.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}addDebugOverlay(){if(this.debugOverlayAdded)return;this.debugOverlayAdded=!0;let t=ct("debug-overlay",80,0,void 0,{className:lt});setInterval(()=>{if(t.setVisibility(this.displayAdvancedStats),this.displayAdvancedStats){let r=a=>new Intl.NumberFormat("en-US",{}).format(a),i=a=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(a),s="";s+=`TE: ${r(this.renderer.info.memory.textures)} `,s+=`F: ${i(this.tilesRendered)} `,s+=`B: ${i(this.blocksRendered)} `,s+=`MEM: ${this.chunkMeshManager.getEstimatedMemoryUsage().total} `;let o=this.chunkMeshManager.getStats();s+=`POOL: ${o.activeCount}/${o.poolSize} `;let v=Rr(this.reactiveState.world.instabilityFactors);v&&(s+=`PF: ${v} `),t.updateText(s),this.backendInfoReport=s}},200)}updatePosDataChunk(t){let r=this.sectionObjects[t];if(!r)return;let[i,s,o]=t.split(",").map(c=>Math.floor(+c/16)),a=500-(Math.abs(i-this.cameraSectionPos.x)+Math.abs(s-this.cameraSectionPos.y)+Math.abs(o-this.cameraSectionPos.z)),l=r.mesh??r.shaderMesh??r.children.find(c=>c.name==="mesh"||c.name==="shaderMesh");l&&(l.renderOrder=a)}updateViewerPosition(t){this.viewerChunkPosition=t}cameraSectionPositionUpdate(){for(let t in this.sectionObjects)this.sectionObjects[t]&&this.updatePosDataChunk(t)}getDir(t,r){return t===r?0:t<r?1:-1}finishChunk(t){this.chunkMeshManager.finishChunkDisplay(t)}applyPendingSectionUpdates(){if(this.pendingSectionUpdates.size===0)return;let t=performance.now(),r=this.getSectionHeight(),i=[];for(let s of this.pendingSectionUpdates.keys()){let o=this.pendingSectionBufferStartTimes.get(s)??t;if(t-o<_t.MAX_SECTION_UPDATE_BUFFER_MS){let[a,l,c]=s.split(",").map(Number),u=[`${a-16},${l},${c}`,`${a+16},${l},${c}`,`${a},${l-r},${c}`,`${a},${l+r},${c}`,`${a},${l},${c-16}`,`${a},${l},${c+16}`],f=!1;for(let p of u)if(this.sectionsWaiting.has(p)&&!this.pendingSectionUpdates.has(p)&&this.sectionObjects[p]){f=!0;break}if(f)continue}i.push(s)}if(i.length!==0)for(let s of i){let o=this.pendingSectionUpdates.get(s);this.pendingSectionUpdates.delete(s),this.pendingSectionBufferStartTimes.delete(s);let v=o.key.split(","),a=`${v[0]},${v[2]}`;if(!this.loadedChunks[a]||!this.active){this.chunkMeshManager.releaseSection(o.key);continue}if(!this.chunkMeshManager.sectionHasRenderableContent(o.geometry)){this.chunkMeshManager.releaseSection(o.key);continue}this.chunkMeshManager.updateSection(o.key,o.geometry),this.updatePosDataChunk(o.key)}}clearPendingSectionUpdatesForChunk(t,r){for(let i of[...this.pendingSectionUpdates.keys()])i.startsWith(`${t},`)&&i.endsWith(`,${r}`)&&(this.pendingSectionUpdates.delete(i),this.pendingSectionBufferStartTimes.delete(i))}handleWorkerMessage(t){if(t.type==="geometry"){let r=t.key.split(","),i=`${r[0]},${r[2]}`;if(!this.loadedChunks[i]||!this.active){this.pendingSectionUpdates.delete(t.key),this.pendingSectionBufferStartTimes.delete(t.key);return}if(this.sectionObjects[t.key]){this.pendingSectionUpdates.set(t.key,t),this.pendingSectionBufferStartTimes.has(t.key)||this.pendingSectionBufferStartTimes.set(t.key,performance.now());return}if(!this.chunkMeshManager.sectionHasRenderableContent(t.geometry)){this.chunkMeshManager.releaseSection(t.key);return}this.chunkMeshManager.updateSection(t.key,t.geometry),this.updatePosDataChunk(t.key)}}getSignTexture(t,r,i,s=!1){let o=Ot(t),v=this.chunkTextures.get(`${o[0]},${o[1]}`);v||(v={},this.chunkTextures.set(`${o[0]},${o[1]}`,v));let a=`${t.x},${t.y},${t.z}`;if(v[a])return v[a];let l=n9(this.version),c=g1(r,i,l);if(!c)return;let u=new Q.Texture(c);return u.magFilter=Q.NearestFilter,u.minFilter=Q.NearestFilter,u.needsUpdate=!0,v[a]=u,u}getCameraPosition(t){return(t??this._tmpCameraPos).set(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z)}getSectionCameraPosition(){let t=this.getCameraPosition();return new V0(Math.floor(t.x/16),Math.floor(t.y/16),Math.floor(t.z/16))}updateCameraSectionPos(){let t=this.getSectionCameraPosition();this.cameraSectionPos.equals(t)||(this.cameraSectionPos=t,this.cameraSectionPositionUpdate())}setFirstPersonCamera(t,r,i){let s=this.playerStateReactive.eyeHeight;this.updateCamera(t?.offset(0,s,0)??null,r,i),this.updateCameraSectionPos()}getThirdPersonCamera(t,r,i){t??(t=new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z));let s=this.playerStateReactive.perspective==="third_person_back",o=4,v=this._tpDirection.set(0,0,-1),a=this._tpPitchQuat.setFromAxisAngle(this._tpAxisX,i),l=this._tpYawQuat.setFromAxisAngle(this._tpAxisY,r),c=this._tpFinalQuat.multiplyQuaternions(l,a);v.applyQuaternion(c),s&&v.multiplyScalar(-1),this.DEBUG_RAYCAST&&this.debugRaycast(t,v,o);let u=this._tpScenePos.set(this.sceneOrigin.toSceneX(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z)),f=this._tpRaycaster;f.set(u,v),f.far=o;let p=80,g=p*p,y=t.x,A=t.y,b=t.z,_=[];for(let B of Object.values(this.sectionObjects)){if(B.name!=="chunk"||!B.visible||B.worldX===void 0)continue;let H=B.worldX-y,G=B.worldY-A,O=B.worldZ-b;if(H*H+G*G+O*O>g)continue;let j=B.children.find(J=>J.name==="mesh"||J.name==="shaderMesh");j&&_.push(j)}let S=f.intersectObjects(_,!1),C=o;S.length>0&&(C=Math.max(.5,S[0].distance-.2));let M=this.chunkMeshManager.raycastShaderSectionAABBs(t,v,C,p);return M!==void 0&&(C=Math.max(.5,M-.2)),new V0(t.x+v.x*C,t.y+v.y*C,t.z+v.z*C)}debugRaycast(t,r,i){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(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z));this.debugRaycastHelper=new Q.ArrowHelper(r.clone().normalize(),s,i,16711680,i*.1,i*.05),this.realScene.add(this.debugRaycastHelper);let o=new Q.SphereGeometry(.2,8,8),v=new Q.MeshBasicMaterial({color:65280});this.debugHitPoint=new Q.Mesh(o,v),this.debugHitPoint.position.copy(s).add(r.clone().multiplyScalar(i)),this.realScene.add(this.debugHitPoint)}setCinimaticCamera(t,r,i){this.cameraWorldPos.x=t.x,this.cameraWorldPos.y=t.y,this.cameraWorldPos.z=t.z,this.sceneOrigin.update(t.x,t.y,t.z),this.cameraObject.position.set(0,0,0),this.cameraShake.setBaseRotation(i,r),this.updateCameraSectionPos()}setCinimaticFov(t){this.animatedFov=t,this.camera.fov=t,this.camera.updateProjectionMatrix()}updateSmoothFov(){if(this.cinimaticScript.running)return;let t=this.displayOptions.inWorldRenderingConfig.fov,r=this.playerStateReactive.fovMultiplier,i=t*(Number.isFinite(r)?r:1),s=performance.now();if(this.animatedFov===0&&(this.animatedFov=i),Math.abs(this.animatedFov-i)>=.01){let o=s-this.lastFovAnimTime,v=Math.min(o/_t.FOV_TRANSITION_MS,1),a=l=>1-(1-l)**3;this.animatedFov+=(i-this.animatedFov)*a(v),Math.abs(this.animatedFov-i)<.01&&(this.animatedFov=i)}else this.animatedFov=i;this.lastFovAnimTime=s,this.camera.fov!==this.animatedFov&&(this.camera.fov=this.animatedFov,this.camera.updateProjectionMatrix())}updateCamera(t,r,i){if(!this.cinimaticScript.running){if(t){this.renderer.xr.isPresenting&&(t.y-=this.camera.position.y),this.currentPosTween?.stop();let s=this.displayOptions.inWorldRenderingConfig.instantCameraUpdate?0:this.playerStateUtils.isSpectatingEntity()?150:50;this.currentPosTween=new De(this.cameraWorldPos).to({x:t.x,y:t.y,z:t.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,v=Math.PI/2;s.yaw<v&&r>Math.PI+v?o=-Math.PI*2:r<v&&s.yaw>Math.PI+v&&(o=Math.PI*2),this.currentRotTween?.stop(),this.currentRotTween=new De(s).to({pitch:i,yaw:r+o},100).onUpdate(a=>this.cameraShake.setBaseRotation(a.pitch,a.yaw-o)).start()}else{this.currentRotTween?.stop(),this.cameraShake.setBaseRotation(i,r);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),v=this.getThirdPersonCamera(o,r,i),a=o.distanceTo(new Q.Vector3(v.x,v.y,v.z)),l=s==="third_person_back"?a:-a;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:t,chunksRenderBelowOverride:r,chunksRenderDistanceOverride:i,chunksRenderAboveEnabled:s,chunksRenderBelowEnabled:o,chunksRenderDistanceEnabled:v}=this.reactiveDebugParams,a=this.getSectionHeight(),l=this.cameraSectionPos.y*a;if(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay&&t!==void 0||r!==void 0||i!==void 0)for(let[c,u]of Object.entries(this.sectionObjects)){if(u._waitingForChunkDisplay)continue;let[f,p,g]=c.split(",").map(Number),y=s&&t!==void 0?p<=l+t:o&&r!==void 0?p>=l-r:v&&i!==void 0?Math.abs(p-l)<=i:!0;u.visible=y}else this.chunkMeshManager.updateSectionsVisibility()}render(t=!1){if(this.currentRenderedFrames++,this.reactiveDebugParams.stopRendering)return;this.debugChunksVisibilityOverride();let r=performance.now();this.lastRendered=performance.now();let i=this.lastRenderTime>0?Math.min(Math.max((r-this.lastRenderTime)/1e3,0),.1):1/60;this.lastRenderTime=r,this.cursorBlock.render(),this.updateSectionOffsets();let s=this.getCameraPosition();if(this.skyboxRenderer.update(s,this.viewDistance),this.updateSmoothFov(),t){let u=this.renderer.getSize(new Q.Vector2);this.camera.aspect=u.width/u.height,this.camera.updateProjectionMatrix()}let o=0;if(!this.reactiveDebugParams.disableEntities){let u=performance.now();this.entities.render(),o=performance.now()-u}let v=this.cameraGroupVr instanceof Q.Group?this.cameraGroupVr.children.find(u=>u instanceof Q.PerspectiveCamera):this.camera;this.applyPendingSectionUpdates();let a=this.chunkMeshManager.globalBlockBuffer;a&&(a.setCameraOrigin(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),a.uploadDirtyRange()),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 u of this.fountains)this.sectionObjects[u.sectionId]&&!this.sectionObjects[u.sectionId].foutain&&(u.createParticles(this.sectionObjects[u.sectionId]),this.sectionObjects[u.sectionId].foutain=!0),u.render();this.waypoints.render(),this.fireworks.update();for(let u of this.onRender)u(i);let c=performance.now()-r;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:o,loadedTextureCount:this.renderer.info.memory.textures,fps:this.lastFps})}renderHead(t,r,i,s){let o;if(s.SkullOwner?o=s.SkullOwner.Properties?.textures?.[0]?.Value:o=s.profile?.properties?.find(v=>v.name==="textures")?.value,!!o)try{let a=JSON.parse(z.from(o,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:l}=this.worldRendererConfig;l&&(a=a?.replace("http://textures.minecraft.net/",l).replace("https://textures.minecraft.net/",l));let c=F0(this,a,z0.head),u=new Q.Group;return i&&c.position.set(0,.3125,.3125),c.position.y-=23/16,u.add(c),this.sceneOrigin.track(u),u.position.set(t.x+.5,t.y+.045,t.z+.5),u.rotation.set(0,-Q.MathUtils.degToRad(r*(i?90:45/2)),0),u.scale.set(.8,.8,.8),u}catch{}}renderSign(t,r,i,s,o){let v=this.getSignTexture(t,o,s);if(!v)return;let a=new Q.Mesh(new Q.PlaneGeometry(1,1),new Q.MeshBasicMaterial({map:v,transparent:!0}));a.renderOrder=999;let l=7/16,c=s?1.3:1;a.scale.set(1*c,l*c,1*c);let u=(s?2:1.5)/16,f=.25/16;i&&!s?a.position.set(0,0,-.5+u+f+1e-4):a.position.set(0,0,u/2+1e-4);let p=new Q.Group;p.rotation.set(0,-Q.MathUtils.degToRad(r*(i?90:45/2)),0),p.add(a);let g=(s?10:8)/16,y=(s?0:i?4.333:9.333)/16,A=g/2+y;return this.sceneOrigin.track(p),p.position.set(t.x+.5,t.y+A,t.z+.5),p}lightUpdate(t,r){for(let i=this.worldSizeParams.minY;i<this.worldSizeParams.worldHeight;i+=16)this.setSectionDirty(new V0(t,i,r))}rerenderAllChunks(){for(let t of Object.keys(this.sectionObjects)){let[r,i,s]=t.split(",").map(Number);this.setSectionDirty(new V0(r,i,s))}}updateShowChunksBorder(t){this.chunkMeshManager.updateAllBoxHelpers(t)}resetWorld(){super.resetWorld(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.chunkMeshManager=new K5(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(t,r=!1){let[i,s,o]=Jr(t);return Object.fromEntries(Object.entries(this.sectionObjects).map(([v,a])=>{let[l,c,u]=v.split(",").map(Number),[f,p,g]=Jr({x:l,y:c,z:u});return[r?`${f-i},${p-s},${g-o}`:`${f-i},${g-o}`,a]}))}cleanChunkTextures(t,r){let i=this.chunkTextures.get(`${Math.floor(t/16)},${Math.floor(r/16)}`)??{};for(let s of Object.keys(i))i[s].dispose(),delete i[s];this.chunkMeshManager.cleanSignChunkTextures(t,r)}readdChunks(){for(let t of Object.keys(this.sectionObjects))this.scene.remove(this.sectionObjects[t]);setTimeout(()=>{for(let t of Object.keys(this.sectionObjects))this.scene.add(this.sectionObjects[t])},500)}disableUpdates(t=this.scene.children){for(let r of t)r.matrixWorldNeedsUpdate=!1,this.disableUpdates(r.children??[])}removeColumn(t,r){super.removeColumn(t,r),this.cleanChunkTextures(t,r),this.clearPendingSectionUpdatesForChunk(t,r);let i=this.getSectionHeight(),s=this.worldMinYRender;for(let o=s;o<this.worldSizeParams.worldHeight;o+=i){let v=`${t},${o},${r}`;this.chunkMeshManager.sectionObjects[v]&&this.chunkMeshManager.releaseSection(v)}this.chunkMeshManager.onChunkRemovedFromGate(`${t},${r}`)}updateViewerPosition(t){super.updateViewerPosition(t),this.chunkMeshManager.pendingNearReveal.size>0&&this.chunkMeshManager.tryRevealPending()}onViewerChunkPositionChanged(){this.chunkMeshManager.tryRevealPending()}setSectionDirty(...t){let[r]=t;this.cleanChunkTextures(r.x,r.z),super.setSectionDirty(...t)}static getRendererInfo(t){try{let r=t.getContext();return`${r.getParameter(r.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(t){let i=this.getSectionHeight(),s,o,v,a=this.sceneOrigin.getWorldPosition(t);a?(s=a.x,o=a.y,v=a.z):(s=this.sceneOrigin.toWorldX(t.position.x),o=this.sceneOrigin.toWorldY(t.position.y),v=this.sceneOrigin.toWorldZ(t.position.z));let l=Math.floor(s/16)*16,c=Math.floor(v/16)*16,u=Math.floor(o/i)*i,f=`${l},${c}`,p=`${l},${u},${c}`;return!!this.finishedChunks[f]||!!this.sectionObjects[p]}handleUserClick(t){this.media.handleUserClick(t)}updateSectionOffsets(){let t=performance.now();for(let[r,i]of Object.entries(this.sectionsOffsetsAnimations)){let s=(t-i.time)/1e3;i.time=t,i.currentOffsetX+=i.speedX*s,i.currentOffsetY+=i.speedY*s,i.currentOffsetZ+=i.speedZ*s,i.limitX!==void 0&&(i.speedX>0?i.currentOffsetX=Math.min(i.currentOffsetX,i.limitX):i.currentOffsetX=Math.max(i.currentOffsetX,i.limitX)),i.limitY!==void 0&&(i.speedY>0?i.currentOffsetY=Math.min(i.currentOffsetY,i.limitY):i.currentOffsetY=Math.max(i.currentOffsetY,i.limitY)),i.limitZ!==void 0&&(i.speedZ>0?i.currentOffsetZ=Math.min(i.currentOffsetZ,i.limitZ):i.currentOffsetZ=Math.max(i.currentOffsetZ,i.limitZ));let o=this.sectionObjects[r];o&&(o.position.set(i.currentOffsetX,i.currentOffsetY,i.currentOffsetZ),o.updateMatrix())}}reloadWorld(){this.entities.reloadEntities()}};d(_t,"FOV_TRANSITION_MS",200),d(_t,"MAX_SECTION_UPDATE_BUFFER_MS",500);var wt=_t;E();x();k();R();E();x();k();R();var W0="1.21.4";E();x();k();R();function At(n,e){n.aspect=e.width/e.height,n.updateProjectionMatrix()}E();x();k();R();function hn(n,e=!1){return n?.mode?n.mode:e?"worldBlocks":y0.mode}E();x();k();R();import*as ce from"three";E();x();k();R();function mn(...n){let e=n.filter(r=>r.length>0).join("/"),t=typeof globalThis.location<"u"&&globalThis.location.href?globalThis.location.href:typeof import.meta<"u"&&import.meta.url?import.meta.url:`/${e}`;try{return new URL(e,t).href}catch{return`/${e}`}}var pn=new Date,Ga=pn.getMonth()===11&&pn.getDate()>=24&&pn.getDate()<=26,s9=["panorama_3.webp","panorama_1.webp","panorama_4.webp","panorama_5.webp","panorama_0.webp","panorama_2.webp"],o9=200,e5=class{constructor(e){this.documentRenderer=e;d(this,"scene");d(this,"camera");d(this,"startTimes",new Map);d(this,"time",0);d(this,"panoramaGroup",null);this.scene=new ce.Scene,this.scene.background=new ce.Color(3294568);let t=new ce.AmbientLight(13421772);this.scene.add(t);let r=new ce.DirectionalLight(16777215,.5);r.position.set(1,1,.5).normalize(),r.castShadow=!0,this.scene.add(r),this.camera=new ce.PerspectiveCamera(85,e.canvas.width/e.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}async init(){this.buildCubemap()}update(e,t){t&&At(this.camera,this.documentRenderer.canvas)}dispose(){this.scene.clear(),this.panoramaGroup=null,this.startTimes.clear()}buildCubemap(){let e=new ce.BoxGeometry(1e3,1e3,1e3),t=[];for(let s of s9)(async()=>{let v=mn("background",Ga?"christmas":"",s),a=await ot(v),l=H0(a);l.matrixAutoUpdate=!1,l.matrix.set(-1,0,1,0,1,0,0,0,1),l.wrapS=ce.ClampToEdgeWrapping,l.wrapT=ce.ClampToEdgeWrapping,l.minFilter=ce.LinearFilter,l.magFilter=ce.LinearFilter;let c=new ce.MeshBasicMaterial({map:l,transparent:!0,side:ce.DoubleSide,depthWrite:!1,opacity:0});this.startTimes.set(c,Date.now()),t.push(c)})().catch(v=>{});let r=new ce.Mesh(e,t);r.onBeforeRender=()=>{this.time+=.01,r.rotation.y=Math.PI+this.time*.01,r.rotation.z=Math.sin(-this.time*.001)*.001;for(let s of t){let o=this.startTimes.get(s);if(o){let v=Date.now()-o;s.opacity=Math.min(1,v/o9)}}};let i=new ce.Object3D;if(i.add(r),!Ga)for(let s=0;s<20;s++){let o=new S0("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 v=Math.random()*.01;o.children[0].onBeforeRender=()=>{o.rotation.y+=v,o.rotation.z=Math.cos(r.rotation.y*3)*Math.PI/4-Math.PI/2},i.add(o)}this.scene.add(i),this.panoramaGroup=i}async debugImageInFrontOfCamera(){let e=await ot(mn("background","panorama_0.webp")),t=H0(e),r=new ce.Mesh(new ce.PlaneGeometry(1e3,1e3),new ce.MeshBasicMaterial({map:t}));r.position.set(0,0,-500),this.scene.add(r)}};E();x();k();R();import*as W from"three";var Va=.1,bn={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"]},Wa={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 W.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 W.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 W.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 W.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 e=new W.Color;return n<.4?e.lerpColors(new W.Color(16054527),new W.Color(14215423),n/.4):n<.75?e.lerpColors(new W.Color(14215423),new W.Color(11061488),(n-.4)/.35):e.lerpColors(new W.Color(11061488),new W.Color(9482464),(n-.75)/.25),e},ambient:7899296,dir:13688040,pt1:11061503,pt2:13162751,name:"LIGHT",starColor:15266047,starOpacity:.5,galaxyOpacity:.7,nebulaOpacity:.32,edgeLineColor:10010856,blockOpacity:[.42,.56]}},a9={cruise:{pos:(n,e,t)=>({x:Math.sin(n*.28)*18+Math.cos(n*.11)*7+e*10,y:Math.sin(n*.19)*6+Math.cos(n*.31)*3+t*6,z:0}),look:(n,e,t)=>({x:Math.sin((n+.18)*.28)*18+e*8,y:Math.sin((n+.18)*.19)*6+t*4,z:-25}),roll:(n,e=0)=>e*.05+Math.sin(n*.22)*.015,spd:.18},barrel:{pos:(n,e,t)=>{let i=n*2.4;return{x:Math.cos(i)*10+e*4,y:Math.sin(i)*10+t*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,e,t)=>({x:Math.sin(n*.6)*30+e*8,y:Math.cos(n*.4)*18+t*6,z:Math.sin(n*.3)*12}),look:(n,e,t)=>({x:Math.sin(n*.6+.2)*30+e*6,y:Math.cos(n*.4+.2)*18-8+t*4,z:-35}),roll:(n,e=0)=>e*.08+Math.sin(n*.6)*.12,spd:.3},orbit:{pos:(n,e,t)=>({x:Math.cos(n*.5)*20+e*5,y:Math.sin(n*.25)*10+t*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,e,t)=>({x:Math.sin(n*1.1)*22+Math.sin(n*.37)*8+e*10,y:Math.sin(n*.7)*10+e*4+t*8,z:0}),look:(n,e,t)=>{let r=n+.12;return{x:Math.sin(r*1.1)*22+Math.sin(r*.37)*8+e*8,y:Math.sin(r*.7)*10+t*6,z:-22}},roll:(n,e=0)=>e*.1+Math.sin(n*1.1)*.06,spd:.22}},v9={cruise:1,barrel:1.6,dive:2.2,orbit:.7,snake:1.4},l9=250,fr=1e4,hr=3e3,t5=n=>n[Math.floor(Math.random()*n.length)],gn=n=>"#"+n.toString(16).padStart(6,"0"),Na=n=>{if(typeof document>"u")return null;let e=document.createElement("canvas");e.width=4,e.height=512;let t=e.getContext("2d");if(!t)return null;let r=e.width,i=e.height,s=n.radial?t.createRadialGradient(r/2,i*.32,0,r/2,i*.32,i*.85):t.createLinearGradient(0,0,0,i);s.addColorStop(0,gn(n.top)),n.mid!=null&&s.addColorStop(.45,gn(n.mid)),s.addColorStop(1,gn(n.bottom)),t.fillStyle=s,t.fillRect(0,0,r,i);let o=new W.CanvasTexture(e);return o.needsUpdate=!0,o},Et=class{constructor(e,t={},r){this.documentRenderer=e;this.abortSignal=r;d(this,"scene");d(this,"camera");d(this,"ambient");d(this,"dir");d(this,"pt1");d(this,"pt2");d(this,"blocks",[]);d(this,"bGroup",new W.Group);d(this,"galaxy");d(this,"nebula");d(this,"stars");d(this,"galGeo");d(this,"nebGeo");d(this,"bGeo",new W.BoxGeometry(1,1,1));d(this,"eGeo",new W.EdgesGeometry(this.bGeo));d(this,"curScene");d(this,"curCam");d(this,"blockGroup");d(this,"cameraSpeed");d(this,"blockSpeed");d(this,"camT",0);d(this,"mx",0);d(this,"my",0);d(this,"tmx",0);d(this,"tmy",0);d(this,"transitioning",!1);d(this,"useMinecraftTextures",!1);d(this,"resourcesManager");d(this,"atlasTexture",null);d(this,"blockMaterialPool",new Map);d(this,"gradientSky",null);d(this,"gradientSkyTexture",null);d(this,"disposed",!1);d(this,"animTime",0);d(this,"texturesApplied",!1);d(this,"textureLoadInProgress",!1);d(this,"onAssetsTexturesUpdated");let i=y0;this.curScene=t.initialScene??i.v2Scene,this.curCam=t.initialCamera??i.v2Camera,this.blockGroup=t.initialBlockGroup??i.v2BlockGroup,this.cameraSpeed=t.initialCameraSpeed??_5.camera,this.blockSpeed=t.initialBlockSpeed??_5.block,this.useMinecraftTextures=t.useMinecraftTextures??i.minecraftTextures,this.resourcesManager=t.resourcesManager;let s=Wa[this.curScene];this.scene=new W.Scene,this.scene.fog=new W.FogExp2(s.fog,s.fogD),this.applyScenePalette(s),this.camera=new W.PerspectiveCamera(80,this.documentRenderer.canvas.width/this.documentRenderer.canvas.height,.1,700),this.ambient=new W.AmbientLight(s.ambient,2.5),this.scene.add(this.ambient),this.dir=new W.DirectionalLight(s.dir,4),this.dir.position.set(1,1,0),this.scene.add(this.dir),this.pt1=new W.PointLight(s.pt1,5,100),this.scene.add(this.pt1),this.pt2=new W.PointLight(s.pt2,4,80),this.pt2.position.set(30,20,-30),this.scene.add(this.pt2);for(let f=0;f<l9;f++)this.spawnBlock(s,!0);if(!this.useMinecraftTextures){let f=s.edgeLineColor??62975;for(let p=0;p<40;p++){let g=new W.LineBasicMaterial({color:f,transparent:!0,opacity:.25});t5(this.blocks).mesh.add(new W.LineSegments(this.eGeo,g))}}this.scene.add(this.bGroup);let o=new W.BufferGeometry,v=new Float32Array(5e3*3);for(let f=0;f<5e3*3;f++)v[f]=(Math.random()-.5)*500;o.setAttribute("position",new W.BufferAttribute(v,3)),this.stars=new W.Points(o,new W.PointsMaterial({color:s.starColor??16777215,size:.3,transparent:!0,opacity:s.starOpacity??.7,sizeAttenuation:!0})),this.scene.add(this.stars),this.galGeo=new W.BufferGeometry;let a=new Float32Array(fr*3),l=new Float32Array(fr*3);for(let f=0;f<fr;f++){let p=f%3,g=Math.random(),y=p/3*Math.PI*2+g*Math.PI*5,A=g*90+Math.random()*10,b=(1-g)*18;a[f*3]=Math.cos(y)*A+(Math.random()-.5)*b,a[f*3+1]=(Math.random()-.5)*7,a[f*3+2]=Math.sin(y)*A+(Math.random()-.5)*b-180;let _=.2+g*.8,S=s.galFn(_);l[f*3]=S.r,l[f*3+1]=S.g,l[f*3+2]=S.b}this.galGeo.setAttribute("position",new W.BufferAttribute(a,3)),this.galGeo.setAttribute("color",new W.BufferAttribute(l,3)),this.galaxy=new W.Points(this.galGeo,new W.PointsMaterial({size:.9,vertexColors:!0,transparent:!0,opacity:s.galaxyOpacity??.55,sizeAttenuation:!0})),this.scene.add(this.galaxy),this.nebGeo=new W.BufferGeometry;let c=new Float32Array(hr*3),u=new Float32Array(hr*3);for(let f=0;f<hr;f++){let p=25+Math.random()*110,g=Math.random()*Math.PI*2,y=(Math.random()-.5)*Math.PI*.5;c[f*3]=p*Math.cos(g)*Math.cos(y),c[f*3+1]=p*Math.sin(y)*.6,c[f*3+2]=p*Math.sin(g)*Math.cos(y)-80;let A=new W.Color(t5(s.nebula));u[f*3]=A.r,u[f*3+1]=A.g,u[f*3+2]=A.b}this.nebGeo.setAttribute("position",new W.BufferAttribute(c,3)),this.nebGeo.setAttribute("color",new W.BufferAttribute(u,3)),this.nebula=new W.Points(this.nebGeo,new W.PointsMaterial({size:3,vertexColors:!0,transparent:!0,opacity:s.nebulaOpacity??.3,sizeAttenuation:!0})),this.scene.add(this.nebula),this.addBackgroundTextPlane(),this.setupMouseTracking()}async init(){this.useMinecraftTextures&&this.scheduleMinecraftTextureLoad()}scheduleMinecraftTextureLoad(){!this.useMinecraftTextures||this.disposed||this.texturesApplied||this.textureLoadInProgress||this.tryApplyMinecraftTextures()}attachAssetsListener(){let e=this.resourcesManager;!e||this.onAssetsTexturesUpdated||(this.onAssetsTexturesUpdated=()=>this.scheduleMinecraftTextureLoad(),e.on("assetsTexturesUpdated",this.onAssetsTexturesUpdated))}detachAssetsListener(){let e=this.resourcesManager;!e||!this.onAssetsTexturesUpdated||(e.off("assetsTexturesUpdated",this.onAssetsTexturesUpdated),this.onAssetsTexturesUpdated=void 0)}hasBlockAtlas(e){let t=e.currentResources;return!!(t?.blocksAtlasImage&&t.blocksAtlasJson)}async ensureAtlasReady(e){if(await this.ensureMcDataLoaded(),this.hasBlockAtlas(e))return!0;if(typeof document>"u"&&e!==this.resourcesManager)return!1;e.currentConfig={...e.currentConfig,version:W0,noInventoryGui:!0};try{await e.updateAssetsData?.({})}catch{return!1}return this.hasBlockAtlas(e)}async tryApplyMinecraftTextures(){if(!(this.disposed||!this.useMinecraftTextures||this.texturesApplied)){this.textureLoadInProgress=!0;try{let e=this.resourcesManager??new m0;if(!await this.ensureAtlasReady(e)){this.resourcesManager&&this.attachAssetsListener();return}if(this.disposed)return;this.applyMinecraftTexturesFromAtlas(e),this.texturesApplied=!0,this.detachAssetsListener()}catch{this.useMinecraftTextures=!1,this.detachAssetsListener()}finally{this.textureLoadInProgress=!1}}}applyScenePalette(e){if(this.documentRenderer.renderer.setClearColor(e.bg),e.gradientBg)if(this.scene.background=null,this.gradientSky){if(this.gradientSky.visible=!0,this.gradientSkyTexture&&e.gradientBg){let s=Na(e.gradientBg);s&&(this.gradientSkyTexture.dispose(),this.gradientSkyTexture=s,this.gradientSky.material.map=s,this.gradientSky.material.needsUpdate=!0)}}else{let s=Na(e.gradientBg);s?(this.gradientSkyTexture=s,this.gradientSky=new W.Mesh(new W.PlaneGeometry(900,700),new W.MeshBasicMaterial({map:s,depthWrite:!1,side:W.DoubleSide})),this.gradientSky.position.set(0,0,-280),this.gradientSky.renderOrder=-1e3,this.scene.add(this.gradientSky)):this.scene.background=new W.Color(e.bg)}else this.scene.background=new W.Color(e.bg),this.gradientSky&&(this.gradientSky.visible=!1);this.scene.fog instanceof W.FogExp2&&(this.scene.fog.color.set(e.fog),this.scene.fog.density=e.fogD);let t=this.stars?.material;t&&(t.color.set(e.starColor??16777215),t.opacity=e.starOpacity??.7);let r=this.galaxy?.material;r&&(r.opacity=e.galaxyOpacity??.55);let i=this.nebula?.material;i&&(i.opacity=e.nebulaOpacity??.3)}setupMouseTracking(){let e=r=>{let i=typeof window<"u"?window.innerWidth:this.documentRenderer.canvas.width,s=typeof window<"u"?window.innerHeight:this.documentRenderer.canvas.height;this.tmx=(r.clientX/i-.5)*2,this.tmy=-(r.clientY/s-.5)*2};(typeof document<"u"?document:void 0)?.addEventListener("mousemove",e,{signal:this.abortSignal})}addBackgroundTextPlane(){let r=typeof document<"u"?document.createElement("canvas"):null;if(!r)return;r.width=2048,r.height=768;let i=r.getContext("2d");if(!i)return;i.clearRect(0,0,2048,768),i.save(),i.font="bold 560px Orbitron, sans-serif",i.textAlign="center",i.textBaseline="middle",i.shadowColor="rgba(0,200,255,0.35)",i.shadowBlur=80,i.fillStyle="rgba(255,255,255,0.055)",i.fillText("V2",2048*.28,768*.5),i.restore(),i.save(),i.font="bold 148px Orbitron, sans-serif",i.textAlign="center",i.textBaseline="middle",i.shadowColor="rgba(0,200,255,0.2)",i.shadowBlur=40,i.fillStyle="rgba(255,255,255,0.038)",i.fillText("by ZARDOY",2048*.72,768*.52),i.restore();let s=new W.CanvasTexture(r),o=new W.Mesh(new W.PlaneGeometry(280,105),new W.MeshBasicMaterial({map:s,transparent:!0,opacity:1,depthWrite:!1,side:W.DoubleSide,blending:W.AdditiveBlending}));o.position.set(8,4,-320),this.scene.add(o)}spawnBlock(e,t,r){let i=this.createBlockMaterial(e,r),s=new W.Mesh(this.bGeo,i),o=.3+Math.random()*3;s.scale.setScalar(o),s.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,t?-(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 v={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:r};this.blocks.push(v),this.bGroup.add(s)}createBlockMaterial(e,t){if(this.useMinecraftTextures&&t){let s=this.blockMaterialPool.get(t);if(s)return s.clone()}let[r,i]=e.blockOpacity??[.32,.46];return new W.MeshBasicMaterial({color:t5(e.blocks),transparent:!0,opacity:r+Math.random()*(i-r),depthWrite:!1,blending:W.AdditiveBlending})}removeBlockEdgeLines(){for(let e of this.blocks){let t=e.mesh.children.filter(r=>r instanceof W.LineSegments);for(let r of t){e.mesh.remove(r),r.geometry?.dispose();let i=r.material;Array.isArray(i)?i.forEach(s=>s.dispose()):i.dispose()}}}async ensureMcDataLoaded(){let e=globalThis._LOAD_MC_DATA;e&&await e()}resolveBlockAtlasUv(e,t,r){let i=s=>{let o=t[s];return o?{u:o.u,v:o.v,su:o.su??r.suSv,sv:o.sv??r.suSv}:null};if(t[e])return i(e);for(let s of["_top","_side","_front","_0"]){let o=i(`${e}${s}`);if(o)return o}for(let s of Object.keys(t))if(s.startsWith(e))return i(s);return null}applyMinecraftTexturesFromAtlas(e){let t=e.currentResources;if(!t?.blocksAtlasImage||!t.blocksAtlasJson)throw new Error("Block atlas not available");let r=t.blocksAtlasJson,i=r.textures;this.atlasTexture=H0(t.blocksAtlasImage),this.atlasTexture.flipY=!1,this.atlasTexture.needsUpdate=!0;for(let s of bn[this.blockGroup]){let o=this.resolveBlockAtlasUv(s,i,r);if(!o)continue;let v=this.atlasTexture.clone();v.flipY=!1,v.offset.set(o.u,o.v),v.repeat.set(o.su,o.sv),v.needsUpdate=!0;let a=s.includes("glass"),l=new W.MeshBasicMaterial({map:v,side:W.DoubleSide,transparent:a,opacity:a?.85:1,alphaTest:a?.08:0,depthWrite:!0,toneMapped:!1});this.blockMaterialPool.set(s,l)}if(this.blockMaterialPool.size===0)throw new Error("No block textures resolved from atlas (check block names vs atlas keys)");this.removeBlockEdgeLines();for(let s of this.blocks){let o=t5([...this.blockMaterialPool.keys()]);s.minecraftBlockName=o,s.mesh.material=this.blockMaterialPool.get(o).clone()}}setScene(e){if(!rt.includes(e)||e===this.curScene||this.transitioning)return;this.transitioning=!0,this.curScene=e;let t=Wa[e];setTimeout(()=>{if(this.disposed)return;this.applyScenePalette(t),this.ambient.color.set(t.ambient),this.dir.color.set(t.dir),this.pt1.color.set(t.pt1),this.pt2.color.set(t.pt2);for(let s of this.blocks)this.useMinecraftTextures&&s.minecraftBlockName||s.mesh.material instanceof W.MeshBasicMaterial&&s.mesh.material.color.set(t5(t.blocks));let r=this.nebGeo.attributes.color;for(let s=0;s<hr;s++){let o=new W.Color(t5(t.nebula));r.setXYZ(s,o.r,o.g,o.b)}r.needsUpdate=!0;let i=this.galGeo.attributes.color;for(let s=0;s<fr;s++){let o=.2+Math.random()*.8,v=t.galFn(o);i.setXYZ(s,v.r,v.g,v.b)}i.needsUpdate=!0,this.transitioning=!1},150)}setCamera(e){it.includes(e)&&(this.curCam=e)}setCameraSpeed(e){this.cameraSpeed=Math.max(0,e)}setBlockSpeed(e){this.blockSpeed=Math.max(0,e)}async setBlockGroup(e){if(nt.includes(e)&&e!==this.blockGroup&&(this.blockGroup=e,!(!this.useMinecraftTextures||this.disposed))){for(let t of this.blockMaterialPool.values())t.map?.dispose(),t.dispose();this.blockMaterialPool.clear(),this.texturesApplied=!1,this.scheduleMinecraftTextureLoad()}}getSceneId(){return this.curScene}getCameraId(){return this.curCam}getBlockGroupId(){return this.blockGroup}update(e,t){t&&At(this.camera,this.documentRenderer.canvas);let r=a9[this.curCam],i=this.cameraSpeed,s=this.blockSpeed;this.camT+=e*r.spd*i,this.mx+=(this.tmx-this.mx)*.05,this.my+=(this.tmy-this.my)*.05;let o=this.mx*Va,v=this.my*Va,a=r.pos(this.camT,o,v),l=r.look(this.camT,o,v);this.camera.position.set(a.x,a.y,a.z),this.camera.lookAt(l.x,l.y,l.z),this.camera.rotation.z=r.roll(this.camT,o);let c=v9[this.curCam]*s;this.animTime+=e*1e3*s;for(let u of this.blocks){if(u.mesh.position.z+=u.spd*c*60*e,u.mesh.position.x+=u.dx*60*e*s,u.mesh.position.y+=u.dy*60*e*s,u.mesh.rotation.x+=u.rx*c,u.mesh.rotation.y+=u.ry*c,u.mesh.rotation.z+=u.rz,!this.useMinecraftTextures&&u.mesh.material instanceof W.MeshBasicMaterial){let f=u.mesh.userData.baseOpacity??.38;u.mesh.userData.baseOpacity==null&&(u.mesh.userData.baseOpacity=f);let p=.88+Math.abs(Math.sin(this.animTime*8e-4+u.mesh.position.x*.3))*.12;u.mesh.material.opacity=f*p}u.mesh.position.z>this.camera.position.z+15&&u.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+=e*.006*s,this.nebula.rotation.y-=e*.003*s,this.stars.rotation.y+=e*4e-4*s}dispose(){this.disposed=!0,this.detachAssetsListener(),this.scene.clear(),this.bGeo.dispose(),this.eGeo.dispose(),this.galGeo.dispose(),this.nebGeo.dispose(),this.gradientSkyTexture?.dispose(),this.atlasTexture?.dispose();for(let e of this.blockMaterialPool.values())e.map?.dispose(),e.dispose();this.blockMaterialPool.clear()}};E();x();k();R();import*as i5 from"three";import{Vec3 as Ya}from"vec3";E();x();k();R();import c9 from"prismarine-world";import d9 from"prismarine-chunk";var ja=n=>{let e=c9(n),t=d9(n),r=new e(n).sync,i=u9(r);for(let s of i)if(s.startsWith("set")&&s!=="setColumn"){let o=r[s].bind(r);r[s]=(...v)=>{let a=v[0];a.x!==void 0&&!r.getColumnAt(a)&&r.setColumn(Math.floor(a.x/16),Math.floor(a.z/16),new t(void 0)),o(...v)}}return r};function u9(n){let e=new Set,t=n;do for(let r of Object.getOwnPropertyNames(t))typeof n[r]=="function"&&r!=="constructor"&&e.add(r);while(t=Object.getPrototypeOf(t));return[...e]}var r5=class{constructor(e,t,r){this.documentRenderer=e;this.options=t;this.abortSignal=r;d(this,"_scene");d(this,"_camera");d(this,"worldRenderer");d(this,"WorldRendererClass",wt);this._scene=new i5.Scene,this._scene.background=new i5.Color(3294568),this._camera=new i5.PerspectiveCamera(85,e.canvas.width/e.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 e=W0,t=new m0;if(t.currentConfig={version:e,noInventoryGui:!0},await t.updateAssetsData?.({}),this.abortSignal.aborted)return;let r=ja(e),s=i6("prismarine-block")(e),v=globalThis.mcData.blocksArray.filter(p=>{if(!p.name.includes("stained_glass"))return!1;let g=s.fromStateId(p.defaultState,0);if(g.shapes?.length!==1)return!1;let y=g.shapes[0];return y[0]===0&&y[1]===0&&y[2]===0&&y[3]===1&&y[4]===1&&y[5]===1}),a=-15,l=100,c=100;for(let p=-l;p<l;p++)for(let g=-c;g<c;g++){let y=v[Math.floor(Math.random()*v.length)];r.setBlockStateId(new Ya(p,g,a),y.defaultState)}this._camera.updateProjectionMatrix(),this._camera.position.set(.5,c/2+.5,.5),this._camera.rotation.set(0,0,0);let u=new Ya(...this._camera.position.toArray()),f=new et(r,2,u);this.abortSignal.aborted||(this.worldRenderer=new this.WorldRendererClass(this.documentRenderer.renderer,this.options,{version:e,worldView:f,inWorldRenderingConfig:u5,playerStateReactive:Y2().reactive,rendererState:Z0().reactive,nonReactiveState:Z0().nonReactive,resourcesManager:t}),this.worldRenderer instanceof wt&&(this._scene=this.worldRenderer.realScene,this._camera=this.worldRenderer.camera),f.init(u),await this.worldRenderer.waitForChunksToRender(),!this.abortSignal.aborted&&this.setupMouseParallax())}update(e,t){t&&At(this.camera,this.documentRenderer.canvas)}dispose(){this.worldRenderer?.destroy(),this.worldRenderer=void 0,this._scene.clear()}setupMouseParallax(){let e=this._camera,t=e.position.x,r=e.position.y,i;document.body.addEventListener("pointermove",s=>{if(s.pointerType!=="mouse")return;let o=.2,v=s.clientX/window.innerWidth-.5,a=-(s.clientY/window.innerHeight-.5);i?.stop(),i=new De(e.position).to({x:t+v*o,y:r+a*o},0),i.start(),e.updateProjectionMatrix()},{signal:this.abortSignal})}};E();x();k();R();import*as Qa from"three";var n5=class{constructor(e,t,r={},i=!1){this.documentRenderer=e;this.options=t;d(this,"active");d(this,"abortController",new AbortController);d(this,"mode");d(this,"lastFrameTime",0);this.mode=hn(r,i)}get v2(){return this.active instanceof Et?this.active:void 0}get scene(){return this.active?.scene}get camera(){return this.active?.camera}async start(e={}){this.active=this.createImplementation(e),await this.active.init(),this.active.scene.background instanceof Qa.Color&&this.documentRenderer.renderer.setClearColor(this.active.scene.background),this.lastFrameTime=performance.now(),this.documentRenderer.render=(t=!1)=>{let r=performance.now(),i=Math.min((r-this.lastFrameTime)/1e3,.05);this.lastFrameTime=r;let s=this.active;s&&(s.update(i,t),this.documentRenderer.renderer.render(s.scene,s.camera))}}createImplementation(e){switch(this.mode){case"v2":return new Et(this.documentRenderer,{useMinecraftTextures:e.useMinecraftTextures,initialScene:e.v2Scene,initialCamera:e.v2Camera,initialBlockGroup:e.v2BlockGroup,initialCameraSpeed:e.v2CameraSpeed,initialBlockSpeed:e.v2BlockSpeed,resourcesManager:e.resourcesManager},this.abortController.signal);case"worldBlocks":return new r5(this.documentRenderer,this.options,this.abortController.signal);default:return new e5(this.documentRenderer)}}dispose(){this.active?.dispose(),this.active=void 0,this.abortController.abort()}};J5.ColorManagement.enabled=!1;globalThis.THREE=J5;var Ka=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(e,t){n.sectionsOffsetsAnimations[e]=t},removeSectionAnimation(e){delete n.sectionsOffsetsAnimations[e]},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:e=>n.toggleModule("rain",e),spawnBlockBreakParticles(e,t,r,i,s,o){n.getModule("blockBreakParticles")?.spawnBlockBreakParticles(e,t,r,i,s,o)},spawnBlockCrackParticle(e,t,r,i,s,o,v){n.getModule("blockBreakParticles")?.spawnCrackParticle(e,t,r,i,s,o,v)},async loadGeometryExport(e){let{applyWorldGeometryExport:t}=await Promise.resolve().then(()=>($i(),_a));return t(n,e)},feedChunkPacket(e){let{kind:t,...r}=e,i={type:t,...r};for(let s of n.workers)s.postMessage(i)},getChunksDebugState(){let e={};for(let t of Object.keys(n.sectionObjects)){let[r,,i]=t.split(",").map(Number);e[`${r},${i}`]=!0}return{loadedSectionsChunks:e,loadedChunks:{...n.loadedChunks},finishedChunks:{...n.finishedChunks}}}}),h9=[],mr=(n,...e)=>{for(let t of Object.values(globalThis.loadedMods??{}))try{t.threeJsBackendModule?.[n]?.(...e)}catch(r){let i=`[mod three.js] Error calling ${n} on ${t.name}: ${r}`;throw new Error(i)}},Ja=()=>{let n,e=null,t=null,r=null,i=null,s=(c,u)=>{le?n=R5(c,h9,globalThis):n=c,e=new p5(n,u?.canvas),globalThis.renderer=e.renderer,globalThis.documentRenderer=e,globalThis.threeJsBackend=l,mr("default",l)},o=async c=>{if(!e)throw new Error("Document renderer not initialized");r&&(r.destroy(),r=null,i=null,globalThis.world=void 0,globalThis.frameTimingCollector=void 0),t&&(t.dispose(),t=null);let u={...n.config.menuBackground,...c};t=new n5(e,{...n},u,!!D.env.SINGLE_FILE_BUILD_MODE),mr("menuBackgroundCreated",t),await t.start(u),mr("menuBackgroundReady",t)},v=async c=>{if(!e)throw new Error("Document renderer not initialized");t&&(t.dispose(),t=null),r&&(r.destroy(),r=null,i=null,globalThis.world=void 0,globalThis.frameTimingCollector=void 0);let f=le?R5(c,[m0,$0],globalThis):c;e.nonReactiveState=f.nonReactiveState,globalThis.resourcesManager=f.resourcesManager,r=new wt(e.renderer,n,f),await r.worldReadyPromise,i=f.inWorldRenderingConfig.enableDebugOverlay?new p1(f.nonReactiveState):null,globalThis.frameTimingCollector=i;let p=e.render;e.render=function(g){p.call(this,g),i?.markFrameStart(),f.inWorldRenderingConfig.paused||r?.render(g),i?.markFrameEnd(),i?.markFrameDisplay()},e.inWorldRenderingConfig=f.inWorldRenderingConfig,globalThis.world=r,mr("worldReady",r)},a=()=>{t&&(t.dispose(),t=null),e&&e.dispose(),r&&(r.destroy(),r=null)},l={id:"threejs",displayName:`three.js ${J5.REVISION}`,startMenuBackground:o,startWorld:v,disconnect:a,setRendering(c){e.setPaused(!c),r&&(r.renderingActive=c)},getMenuBackground:()=>t??void 0,getDebugOverlay:()=>({get entitiesString(){return r?.entities.getDebugString()},get left(){return{"Geo Memory":r?.chunkMeshManager.getEstimatedMemoryUsage().total??"-"}}}),updateCamera(c,u,f){i?.markCameraUpdate(!c),r?.setFirstPersonCamera(c,u,f)},get soundSystem(){return r?.soundSystem},get backendMethods(){if(r)return Ka(r)}};return{main:{init:s,backend:l},workerProxy(){return ws({init(c,u){s(c,{canvas:u})},updateSizeExternal(c,u,f){e?.updateSizeExternal(c,u,f)},startMenuBackground:o,startWorld:v,disconnect:a,setRendering:l.setRendering,updateCamera(c,u,f){let p=c?new f9(c.x,c.y,c.z):null;i?.markCameraUpdate(!p),l.updateCamera(p,u,f)},async callBackendMethod(c,...u){if(!r)throw new Error("World renderer not initialized");let p=Ka(r)[c];if(!p)throw new Error(`Backend method ${String(c)} is unavailable`);return p(...u)}})}}};var pr=n=>{let{main:e}=Ja();return e.init(n),e.backend};pr.id="threejs";pr.displayName="three.js Blocking";pr.description="Simple, old and stable main thread graphics backend providing balanced performance on top of WebGL2.";E();x();k();R();import*as Za from"three";function m9(n){let e="threeWorker.js",t;if(D.env.SINGLE_FILE_BUILD){let r=document.getElementById("three-worker-code").textContent,i=new Blob([r],{type:"text/javascript"});t=new Worker(window.URL.createObjectURL(i))}else t=new Worker(e);return t.onmessage=({data:r})=>{n(r)},t.on&&t.on("message",r=>{t.onmessage({data:r})}),t}var gr=async n=>{let e=m9(()=>{}),t=As(e),r=Hr();r.onSizeChanged((v,a)=>{t.updateSizeExternal(v,a,window.devicePixelRatio||1)});let i=x5(n,e);try{t.init(i,r.canvas)}catch(v){throw at(i),v}let s=new Proxy({},{get(v,a){if(typeof a=="string")return async(...l)=>t.callBackendMethod(a,...l)}});return{id:"threejs",displayName:`three.js ${Za.REVISION}`,async startMenuBackground(v){let a=v?.resourcesManager?.currentResources?.mcData;if(a){let c={...vt,items:"itemsArray",entities:"entitiesArray"};await ei([e],W0,c,a)}let l=x5(v??{},e);try{await t.startMenuBackground(structuredClone(l))}catch(c){throw at(l),c}},async startWorld(v){let a={...vt,items:"itemsArray",entities:"entitiesArray"};await ei([e],v.version,a,v.resourcesManager.currentResources.mcData),v.inWorldRenderingConfig.__syncToWorker=!0,v.playerStateReactive&&(v.playerStateReactive.__syncToWorker=!0),v.rendererState&&(v.rendererState.__syncFromWorker=!0),v.nonReactiveState&&(v.nonReactiveState.__syncFromWorker=!0),v.nonReactiveState.__syncFromWorkerInterval=200;let l=x5(v,e);try{await t.startWorld(structuredClone(l))}catch(f){throw at(l),f}t.updateSizeExternal(r.size.width,r.size.height,window.devicePixelRatio||1);let c=ct("fps");setInterval(()=>{let{fps:f,avgRenderTime:p,worstRenderTime:g}=v.nonReactiveState;c.updateText(`FPS: ${f.toFixed(0)} (${p.toFixed(0)}ms/${g.toFixed(0)}ms)`),v.nonReactiveState.fps=0},1e3);let u=ct("downloaded-chunks",100,140,20,{className:lt});setInterval(()=>{let f=(n.config.statsVisible??0)>1;u.setVisibility(f),f&&u.updateText(v.nonReactiveState.world.chunksFullInfo)},200)},disconnect(){r.destroy(),t.disconnect(),e.terminate()},setRendering(v){t.setRendering(v)},updateCamera(v,a,l){t.updateCamera(v?{x:v.x,y:v.y,z:v.z}:null,a,l)},soundSystem:void 0,backendMethods:s}};gr.id="threejs-off-thread";gr.displayName="three.js Multi-thread";gr.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{ls as AppViewer,e5 as ClassicMenuBackground,p5 as DocumentRenderer,xr as HIGH_TEXTURE_COUNT,n1 as LONG_RENDER_TIME_MS,Er as LOW_FPS_THRESHOLD,Pt as LoadedResourcesTransferrable,lt as MC_RENDERER_DEBUG_OVERLAY_CLASS,W0 as MENU_BACKGROUND_MC_VERSION,_5 as MENU_BACKGROUND_MOTION_DEFAULTS,y0 as MENU_BACKGROUND_OPTION_DEFAULTS,bn as MINECRAFT_BLOCK_GROUPS,nt as MINECRAFT_BLOCK_GROUP_IDS,y5 as MINECRAFT_BLOCK_GROUP_LABELS,n5 as MenuBackgroundRenderer,d5 as PerformanceMonitor,cs as RENDERER_DEFAULT_OPTIONS,ds as RENDERER_OPTIONS_META,us as RENDERER_RENDER_GUI_SECTIONS,m0 as ResourcesManager,Et as V2MenuBackground,it as V2_CAMERA_IDS,b5 as V2_CAMERA_LABELS,rt as V2_SCENE_IDS,g5 as V2_SCENE_LABELS,r5 as WorldBlocksMenuBackground,et as WorldView,$0 as WorldViewWorker,Hr as addCanvasForWorker,L6 as applyMenuBackgroundLiveOptions,wf as applyRendererEnableLighting,N6 as applyRendererOptions,yf as applyRendererWorldViewOptions,St as chunkPos,gr as createGraphicsBackendOffThread,pr as createGraphicsBackendSingleThread,xl as createWorldRendererConfig,N2 as defaultGraphicsBackendConfig,Ar as defaultPerformanceInstabilityFactors,u5 as defaultWorldRendererConfig,K2 as delayedIterator,Rr as formatPerformanceFactorsDebug,Z0 as getDefaultRendererState,ps as getInitialPlayerState,Q6 as getInitialPlayerStateRenderer,Y6 as getPlayerStateUtils,le as isWebWorker,bf as menuBackgroundOptionsFromStorage,x0 as menuBackgroundSpeedToMultiplier,S6 as migrateRendererOptions,Fr as rendererShaderCubeDebugModeToValue,p6 as sectionPos,_f as subscribeRendererOptions};
|
|
21507
|
+
#include <${Xv>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
21508
|
+
}`})}},vn=class{constructor(e){this.worldRenderer=e;d(this,"points");d(this,"clock",new Te.Clock);d(this,"enabled",!1);d(this,"currentTime");d(this,"enablementCheck",()=>this.currentTime?this.currentTime>13500&&this.currentTime<23e3:!1);d(this,"render",e=>{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(e){this.currentTime=e,this.enabled&&this.updateVisibility()}updateVisibility(){if(!this.enabled)return;let e=this.enablementCheck?.()??!1;e&&!this.points?this.createStars():!e&&this.points&&this.removeStars()}createStars(){if(this.points)return;let e=80,t=50,r=7e3,i=7,s=10,o=new Te.BufferGeometry,a=y=>new Te.Vector3().setFromSpherical(new Te.Spherical(y,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),v=[],l=[],c=Array.from({length:r},()=>(.5+.5*Math.random())*i),u=new Te.Color,h=e+t,p=t/r;for(let y=0;y<r;y++)h-=p*Math.random(),v.push(...a(h).toArray()),u.setHSL(y/r,s,.9),l.push(u.r,u.g,u.b);o.setAttribute("position",new Te.Float32BufferAttribute(v,3)),o.setAttribute("color",new Te.Float32BufferAttribute(l,3)),o.setAttribute("size",new Te.Float32BufferAttribute(c,1));let g=new an;g.blending=Te.AdditiveBlending,g.depthTest=!0,g.depthWrite=!1,g.transparent=!0,this.points=new Te.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)}},Ia={id:"starfield",controller:vn,enabledDefault:!0,cannotBeDisabled:!0};var Ha={starfield:Ia,futuristicReveal:Pa,rain:Ca,cameraBobbing:ka,blockBreakParticles:Ra};var yt=class yt extends p1{constructor(t,r,i){if(!i.resourcesManager)throw new Error("resourcesManager is required in displayOptions");super(i.resourcesManager,i,r);this.renderer=t;this.initOptions=r;this.displayOptions=i;d(this,"outputFormat","threeJs");d(this,"chunkMeshManager");d(this,"chunkTextures",new Map);d(this,"signsCache",new Map);d(this,"cameraSectionPos",new G0(0,0,0));d(this,"holdingBlock");d(this,"holdingBlockLeft");d(this,"scene",new Q.Scene);d(this,"ambientLight",new Q.AmbientLight(13421772));d(this,"directionalLight",new Q.DirectionalLight(16777215,.5));d(this,"entities",new F1(this,globalThis.mcData));d(this,"performanceMonitor");d(this,"cameraGroupVr");d(this,"material",new Q.MeshBasicMaterial({vertexColors:!0,transparent:!0,alphaTest:.1}));d(this,"itemsTexture");d(this,"cursorBlock");d(this,"onRender",[]);d(this,"lastRenderTime",0);d(this,"animatedFov",0);d(this,"lastFovAnimTime",0);d(this,"cameraShake");d(this,"cameraContainer");d(this,"media");d(this,"waypoints");d(this,"cinimaticScript");d(this,"camera");d(this,"renderTimeAvg",0);d(this,"pendingSectionUpdates",new Map);d(this,"pendingSectionBufferStartTimes",new Map);d(this,"modules",{});d(this,"sectionsOffsetsAnimations",{});d(this,"fountains",[]);d(this,"fireworksLegacy");d(this,"DEBUG_RAYCAST",!1);d(this,"skyboxRenderer");d(this,"fireworks");d(this,"sceneOrigin",new J1(this.scene));d(this,"cameraWorldPos",{x:0,y:0,z:0});d(this,"_cameraPositionAccessWarned",!1);d(this,"_tmpCameraPos",new Q.Vector3);d(this,"currentPosTween");d(this,"currentRotTween");d(this,"_tpDirection",new Q.Vector3);d(this,"_tpPitchQuat",new Q.Quaternion);d(this,"_tpYawQuat",new Q.Quaternion);d(this,"_tpFinalQuat",new Q.Quaternion);d(this,"_tpScenePos",new Q.Vector3);d(this,"_tpAxisX",new Q.Vector3(1,0,0));d(this,"_tpAxisY",new Q.Vector3(0,1,0));d(this,"_tpRaycaster",new Q.Raycaster);d(this,"_tpChunkWorldPos",new Q.Vector3);d(this,"debugOverlayAdded",!1);d(this,"debugRaycastHelper");d(this,"debugHitPoint");d(this,"prevFramePerspective",null);this.performanceMonitor=new v5(this.reactiveState.world.instabilityFactors),this.renderer=t;let s=yt.getRendererInfo(t)??"...";i.rendererState.renderer=s,this.chunkMeshManager=new j5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.onRenderDistanceChanged=o=>{this.chunkMeshManager.updateViewDistance(o)},this.cursorBlock=new z1(this),this.holdingBlock=L5(this),this.holdingBlockLeft=L5(this,!0);for(let o of Object.values(Ha))this.registerModule(o);this.skyboxRenderer=new Q1(this.realScene,!1,null),this.skyboxRenderer.init(),this.addDebugOverlay(),this.resetScene(),this.init(),this.soundSystem=new U1(this),this.cameraShake=new G1(this,this.onRender),this.media=new V1(this),this.fireworksLegacy=new j1(this),this.waypoints=new W1(this),this.cinimaticScript=new Y1(this,(o,a,v)=>this.setCinimaticCamera(o,a,v),o=>this.setCinimaticFov(o),()=>({position:new G0(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 K1(this.realScene,this.sceneOrigin),this.renderUpdateEmitter.on("chunkFinished",o=>{this.finishChunk(o)}),this.worldSwitchActions(),this.initializeModules()}isShaderCubeBlocksEnabled(){return this.worldRendererConfig.shaderCubeBlocks===!0&&!!this.renderer?.capabilities?.isWebGL2}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(t){if(t.id in this.modules)return;let r=new t.controller(this),i={manifest:t,controller:r,enabled:!1,toggle:()=>this.toggleModule(t.id)};this.modules[t.id]=i,t.enabledDefault&&this.toggleModule(t.id,!0)}enableModule(t){let r=this.modules[t];r&&(r.enabled||(r.enabled=!0,r.controller.enable(),r.controller.render&&this.onRender.push(r.controller.render)))}disableModule(t){let r=this.modules[t];if(r&&!r.manifest.cannotBeDisabled&&r.enabled&&(r.enabled=!1,r.controller.disable(),r.controller.render)){let i=this.onRender.indexOf(r.controller.render);i>-1&&this.onRender.splice(i,1)}}toggleModule(t,r){let i=this.modules[t];if(!i)return!1;let s=r!==void 0?r:!i.enabled;if(s===i.enabled)return i.enabled;if(!s&&i.manifest.cannotBeDisabled)return!0;if(i.enabled=s,s)i.controller.enable(),i.controller.render&&!this.onRender.includes(i.controller.render)&&this.onRender.push(i.controller.render);else if(i.controller.disable(),i.controller.render){let o=this.onRender.indexOf(i.controller.render);o>-1&&this.onRender.splice(o,1)}return s}disposeModules(){for(let t of Object.values(this.modules))t.controller.dispose();this.modules={}}initializeModules(){this.updateModulesFromConfig()}getModule(t){return this.modules[t]?.controller}anyModuleRequiresHeightmap(){return Object.values(this.modules).some(t=>t.enabled&&t.manifest.requiresHeightmap)}get cameraObject(){return this.cameraGroupVr??this.cameraContainer}_wrapCameraPositionWithWarning(){let t=this.camera.position,r=this,i=20,s=(v,l,c)=>Math.abs(v)>i||Math.abs(l)>i||Math.abs(c)>i,o=()=>{!r._cameraPositionAccessWarned&&typeof D<"u"},a=new Proxy(t,{set(v,l,c){return(l==="x"||l==="y"||l==="z")&&typeof c=="number"&&Math.abs(c)>i&&o(),v[l]=c,!0},get(v,l,c){let u=v[l];return l==="set"?function(h,p,g){return s(h,p,g)&&o(),v.set(h,p,g)}:l==="setX"||l==="setY"||l==="setZ"?function(h){return Math.abs(h)>i&&o(),v[l](h)}:l==="copy"?function(h){return s(h.x,h.y,h.z)&&o(),v.copy(h)}:typeof u=="function"?u.bind(v):u}});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(){Qi(this,new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraShake.getBaseRotation(),"world-geometry.json")}updateEntity(t,r=!1){let i={rotation:{head:{x:t.headPitch??t.pitch,y:t.headYaw,z:0}}};r?this.entities.updateEntityPosition(t,!1,i):this.entities.update(t,i)}updatePlayerEntity(t){this.entities.handlePlayerEntity(t)}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 t=this.renderer.getSize(new Q.Vector2);this.camera=new Q.PerspectiveCamera(75,t.x/t.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",t=>{this.skyboxRenderer.updateWaterState(t,this.playerStateReactive.waterBreathing)}),this.onReactivePlayerStateUpdated("waterBreathing",t=>{this.skyboxRenderer.updateWaterState(this.playerStateReactive.inWater,t)}),this.onReactivePlayerStateUpdated("ambientLight",t=>{t&&(this.ambientLight.intensity=t)}),this.onReactivePlayerStateUpdated("directionalLight",t=>{t&&(this.directionalLight.intensity=t)}),this.onReactivePlayerStateUpdated("lookingAtBlock",t=>{this.cursorBlock.setHighlightCursorBlock(t?new G0(t.x,t.y,t.z):null,t?.shapes)}),this.onReactivePlayerStateUpdated("diggingBlock",t=>{this.cursorBlock.updateBreakAnimation(t?{x:t.x,y:t.y,z:t.z}:void 0,t?.stage??null,t?.mergedShape)}),this.onReactivePlayerStateUpdated("perspective",t=>{let r=new G0(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z);this.updateCamera(r,this.cameraShake.getBaseRotation().yaw,this.cameraShake.getBaseRotation().pitch)})}watchReactiveConfig(){super.watchReactiveConfig(),this.onReactiveConfigUpdated("showChunkBorders",r=>{this.updateShowChunksBorder(r)}),this.onReactiveConfigUpdated("defaultSkybox",r=>{this.skyboxRenderer.updateDefaultSkybox(r)}),this.onReactiveConfigUpdated("shaderCubeDebugMode",()=>{this.chunkMeshManager.syncCubeShaderUniforms()}),this.onReactiveConfigUpdated("futuristicReveal",()=>{this.updateModulesFromConfig()});let t=this.displayOptions.inWorldRenderingConfig.handRenderer;this.onReactiveConfigUpdated("handRenderer",r=>{if(r===t)return;t=r;let i=this.holdingBlock.ready,s=this.holdingBlockLeft.ready;this.holdingBlock.dispose(),this.holdingBlockLeft.dispose(),this.holdingBlock=L5(this),this.holdingBlockLeft=L5(this,!0),i&&(this.holdingBlock.ready=!0,this.holdingBlock.updateItem()),s&&(this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem())}),this.onReactiveConfigUpdated("*",()=>{this.updateModulesFromConfig()}),this.updateModulesFromConfig()}updateModulesFromConfig(){let{moduleStates:t}=this.worldRendererConfig;for(let[r,i]of Object.entries(this.modules)){let s=t[r];if(s==="enabled"){i.enabled||this.toggleModule(r,!0);continue}if(s==="disabled"){i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1);continue}if(s==="auto"||s===void 0)if(i.controller.autoEnableCheck){let o=i.controller.autoEnableCheck();o&&!i.enabled?this.toggleModule(r,!0):!o&&i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1)}else{let o=i.manifest.enabledDefault??!1;o&&!i.enabled?this.toggleModule(r,!0):!o&&i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1)}}}changeHandSwingingState(t,r=!1){let i=r?this.holdingBlockLeft:this.holdingBlock;t?i.startSwing():i.stopSwing()}async updateAssetsData(){let t=this.resourcesManager.currentResources,r=this.material.map,i=this.itemsTexture,s=I0(t.blocksAtlasImage);s.needsUpdate=!0,s.flipY=!1,this.material.map=s,this.chunkMeshManager.syncCubeShaderUniforms();let o=I0(t.itemsAtlasImage);o.needsUpdate=!0,o.flipY=!1,this.itemsTexture=o,r&&r.dispose(),i&&i.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(t){this.realScene.background=new Q.Color(t[0],t[1],t[2])}changeCardinalLight(t){this.worldRendererConfig.cardinalLight=t}timeUpdated(t){let r=this.getModule("starfield");r?.updateTimeOfDay&&r.updateTimeOfDay(t),this.skyboxRenderer.updateTime(t)}biomeUpdated(t){t?.temperature!==void 0&&this.skyboxRenderer.updateTemperature(t.temperature)}biomeReset(){this.skyboxRenderer.updateTemperature(Ui)}getItemRenderData(t,r){return q3(t,r,this.resourcesManager,this.playerStateReactive)}async demoModel(){let t=cursorBlockRel(0,1,0).position,r=await x5();Ps(r,t);let i=new Q.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}demoItem(){let t=cursorBlockRel(0,1,0).position,{mesh:r}=this.entities.getItemMesh({itemId:541},{});r.position.set(t.x+.5,t.y+.5,t.z+.5);let i=new Q.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}addDebugOverlay(){if(this.debugOverlayAdded)return;this.debugOverlayAdded=!0;let t=lt("debug-overlay",80,0,void 0,{className:vt});setInterval(()=>{if(t.setVisibility(this.displayAdvancedStats),this.displayAdvancedStats){let r=v=>new Intl.NumberFormat("en-US",{}).format(v),i=v=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(v),s="";s+=`TE: ${r(this.renderer.info.memory.textures)} `,s+=`F: ${i(this.tilesRendered)} `,s+=`B: ${i(this.blocksRendered)} `,s+=`MEM: ${this.chunkMeshManager.getEstimatedMemoryUsage().total} `;let o=this.chunkMeshManager.getStats();s+=`POOL: ${o.activeCount}/${o.poolSize} `;let a=Ar(this.reactiveState.world.instabilityFactors);a&&(s+=`PF: ${a} `),t.updateText(s),this.backendInfoReport=s}},200)}updatePosDataChunk(t){let r=this.sectionObjects[t];if(!r)return;let[i,s,o]=t.split(",").map(c=>Math.floor(+c/16)),v=500-(Math.abs(i-this.cameraSectionPos.x)+Math.abs(s-this.cameraSectionPos.y)+Math.abs(o-this.cameraSectionPos.z)),l=r.mesh??r.shaderMesh??r.children.find(c=>c.name==="mesh"||c.name==="shaderMesh");l&&(l.renderOrder=v)}updateViewerPosition(t){this.viewerChunkPosition=t}cameraSectionPositionUpdate(){for(let t in this.sectionObjects)this.sectionObjects[t]&&this.updatePosDataChunk(t)}getDir(t,r){return t===r?0:t<r?1:-1}finishChunk(t){this.chunkMeshManager.finishChunkDisplay(t)}applyPendingSectionUpdates(){if(this.pendingSectionUpdates.size===0)return;let t=performance.now(),r=this.getSectionHeight(),i=[];for(let s of this.pendingSectionUpdates.keys()){let o=this.pendingSectionBufferStartTimes.get(s)??t;if(t-o<yt.MAX_SECTION_UPDATE_BUFFER_MS){let[v,l,c]=s.split(",").map(Number),u=[`${v-16},${l},${c}`,`${v+16},${l},${c}`,`${v},${l-r},${c}`,`${v},${l+r},${c}`,`${v},${l},${c-16}`,`${v},${l},${c+16}`],h=!1;for(let p of u)if(this.sectionsWaiting.has(p)&&!this.pendingSectionUpdates.has(p)&&this.sectionObjects[p]){h=!0;break}if(h)continue}i.push(s)}if(i.length!==0)for(let s of i){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(!this.chunkMeshManager.sectionHasRenderableContent(o.geometry)){this.chunkMeshManager.releaseSection(o.key);continue}this.chunkMeshManager.updateSection(o.key,o.geometry),this.updatePosDataChunk(o.key)}}clearPendingSectionUpdatesForChunk(t,r){for(let i of[...this.pendingSectionUpdates.keys()])i.startsWith(`${t},`)&&i.endsWith(`,${r}`)&&(this.pendingSectionUpdates.delete(i),this.pendingSectionBufferStartTimes.delete(i))}handleWorkerMessage(t){if(t.type==="geometry"){let r=t.key.split(","),i=`${r[0]},${r[2]}`;if(!this.loadedChunks[i]||!this.active){this.pendingSectionUpdates.delete(t.key),this.pendingSectionBufferStartTimes.delete(t.key);return}if(this.sectionObjects[t.key]){this.pendingSectionUpdates.set(t.key,t),this.pendingSectionBufferStartTimes.has(t.key)||this.pendingSectionBufferStartTimes.set(t.key,performance.now());return}if(!this.chunkMeshManager.sectionHasRenderableContent(t.geometry)){this.chunkMeshManager.releaseSection(t.key);return}this.chunkMeshManager.updateSection(t.key,t.geometry),this.updatePosDataChunk(t.key)}}getSignTexture(t,r,i,s=!1){let o=Ht(t),a=this.chunkTextures.get(`${o[0]},${o[1]}`);a||(a={},this.chunkTextures.set(`${o[0]},${o[1]}`,a));let v=`${t.x},${t.y},${t.z}`;if(a[v])return a[v];let l=$v(this.version),c=h1(r,i,l);if(!c)return;let u=new Q.Texture(c);return u.magFilter=Q.NearestFilter,u.minFilter=Q.NearestFilter,u.needsUpdate=!0,a[v]=u,u}getCameraPosition(t){return(t??this._tmpCameraPos).set(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z)}getSectionCameraPosition(){let t=this.getCameraPosition();return new G0(Math.floor(t.x/16),Math.floor(t.y/16),Math.floor(t.z/16))}updateCameraSectionPos(){let t=this.getSectionCameraPosition();this.cameraSectionPos.equals(t)||(this.cameraSectionPos=t,this.cameraSectionPositionUpdate())}setFirstPersonCamera(t,r,i){let s=this.playerStateReactive.eyeHeight;this.updateCamera(t?.offset(0,s,0)??null,r,i),this.updateCameraSectionPos()}getThirdPersonCamera(t,r,i){t??(t=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,i),l=this._tpYawQuat.setFromAxisAngle(this._tpAxisY,r),c=this._tpFinalQuat.multiplyQuaternions(l,v);a.applyQuaternion(c),s&&a.multiplyScalar(-1),this.DEBUG_RAYCAST&&this.debugRaycast(t,a,o);let u=this._tpScenePos.set(this.sceneOrigin.toSceneX(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z)),h=this._tpRaycaster;h.set(u,a),h.far=o;let p=80,g=p*p,y=t.x,A=t.y,b=t.z,w=[];for(let B of Object.values(this.sectionObjects)){if(B.name!=="chunk"||!B.visible||B.worldX===void 0)continue;let H=B.worldX-y,G=B.worldY-A,O=B.worldZ-b;if(H*H+G*G+O*O>g)continue;let j=B.children.find(J=>J.name==="mesh"||J.name==="shaderMesh");j&&w.push(j)}let S=h.intersectObjects(w,!1),C=o;S.length>0&&(C=Math.max(.5,S[0].distance-.2));let M=this.chunkMeshManager.raycastShaderSectionAABBs(t,a,C,p);return M!==void 0&&(C=Math.max(.5,M-.2)),new G0(t.x+a.x*C,t.y+a.y*C,t.z+a.z*C)}debugRaycast(t,r,i){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(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z));this.debugRaycastHelper=new Q.ArrowHelper(r.clone().normalize(),s,i,16711680,i*.1,i*.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(r.clone().multiplyScalar(i)),this.realScene.add(this.debugHitPoint)}setCinimaticCamera(t,r,i){this.cameraWorldPos.x=t.x,this.cameraWorldPos.y=t.y,this.cameraWorldPos.z=t.z,this.sceneOrigin.update(t.x,t.y,t.z),this.cameraObject.position.set(0,0,0),this.cameraShake.setBaseRotation(i,r),this.updateCameraSectionPos()}setCinimaticFov(t){this.animatedFov=t,this.camera.fov=t,this.camera.updateProjectionMatrix()}updateSmoothFov(){if(this.cinimaticScript.running)return;let t=this.displayOptions.inWorldRenderingConfig.fov,r=this.playerStateReactive.fovMultiplier,i=t*(Number.isFinite(r)?r:1),s=performance.now();if(this.animatedFov===0&&(this.animatedFov=i),Math.abs(this.animatedFov-i)>=.01){let o=s-this.lastFovAnimTime,a=Math.min(o/yt.FOV_TRANSITION_MS,1),v=l=>1-(1-l)**3;this.animatedFov+=(i-this.animatedFov)*v(a),Math.abs(this.animatedFov-i)<.01&&(this.animatedFov=i)}else this.animatedFov=i;this.lastFovAnimTime=s,this.camera.fov!==this.animatedFov&&(this.camera.fov=this.animatedFov,this.camera.updateProjectionMatrix())}updateCamera(t,r,i){if(!this.cinimaticScript.running){if(t){this.renderer.xr.isPresenting&&(t.y-=this.camera.position.y),this.currentPosTween?.stop();let s=this.displayOptions.inWorldRenderingConfig.instantCameraUpdate?0:this.playerStateUtils.isSpectatingEntity()?150:50;this.currentPosTween=new Oe(this.cameraWorldPos).to({x:t.x,y:t.y,z:t.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&&r>Math.PI+a?o=-Math.PI*2:r<a&&s.yaw>Math.PI+a&&(o=Math.PI*2),this.currentRotTween?.stop(),this.currentRotTween=new Oe(s).to({pitch:i,yaw:r+o},100).onUpdate(v=>this.cameraShake.setBaseRotation(v.pitch,v.yaw-o)).start()}else{this.currentRotTween?.stop(),this.cameraShake.setBaseRotation(i,r);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,r,i),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:t,chunksRenderBelowOverride:r,chunksRenderDistanceOverride:i,chunksRenderAboveEnabled:s,chunksRenderBelowEnabled:o,chunksRenderDistanceEnabled:a}=this.reactiveDebugParams,v=this.getSectionHeight(),l=this.cameraSectionPos.y*v;if(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay&&t!==void 0||r!==void 0||i!==void 0)for(let[c,u]of Object.entries(this.sectionObjects)){if(u._waitingForChunkDisplay)continue;let[h,p,g]=c.split(",").map(Number),y=s&&t!==void 0?p<=l+t:o&&r!==void 0?p>=l-r:a&&i!==void 0?Math.abs(p-l)<=i:!0;u.visible=y}else this.chunkMeshManager.updateSectionsVisibility()}render(t=!1){if(this.currentRenderedFrames++,this.reactiveDebugParams.stopRendering)return;this.debugChunksVisibilityOverride();let r=performance.now();this.lastRendered=performance.now();let i=this.lastRenderTime>0?Math.min(Math.max((r-this.lastRenderTime)/1e3,0),.1):1/60;this.lastRenderTime=r,this.cursorBlock.render(),this.updateSectionOffsets();let s=this.getCameraPosition();if(this.skyboxRenderer.update(s,this.viewDistance),this.updateSmoothFov(),t){let u=this.renderer.getSize(new Q.Vector2);this.camera.aspect=u.width/u.height,this.camera.updateProjectionMatrix()}let o=0;if(!this.reactiveDebugParams.disableEntities){let u=performance.now();this.entities.render(),o=performance.now()-u}let a=this.cameraGroupVr instanceof Q.Group?this.cameraGroupVr.children.find(u=>u instanceof Q.PerspectiveCamera):this.camera;this.applyPendingSectionUpdates();let v=this.chunkMeshManager.globalBlockBuffer;v&&(v.setCameraOrigin(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),v.uploadDirtyRange()),this.renderer.render(this.scene,a),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 u of this.fountains)this.sectionObjects[u.sectionId]&&!this.sectionObjects[u.sectionId].foutain&&(u.createParticles(this.sectionObjects[u.sectionId]),this.sectionObjects[u.sectionId].foutain=!0),u.render();this.waypoints.render(),this.fireworks.update();for(let u of this.onRender)u(i);let c=performance.now()-r;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:o,loadedTextureCount:this.renderer.info.memory.textures,fps:this.lastFps})}renderHead(t,r,i,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(z.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=D0(this,v,F0.head),u=new Q.Group;return i&&c.position.set(0,.3125,.3125),c.position.y-=23/16,u.add(c),this.sceneOrigin.track(u),u.position.set(t.x+.5,t.y+.045,t.z+.5),u.rotation.set(0,-Q.MathUtils.degToRad(r*(i?90:45/2)),0),u.scale.set(.8,.8,.8),u}catch{}}renderSign(t,r,i,s,o){let a=this.getSignTexture(t,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 u=(s?2:1.5)/16,h=.25/16;i&&!s?v.position.set(0,0,-.5+u+h+1e-4):v.position.set(0,0,u/2+1e-4);let p=new Q.Group;p.rotation.set(0,-Q.MathUtils.degToRad(r*(i?90:45/2)),0),p.add(v);let g=(s?10:8)/16,y=(s?0:i?4.333:9.333)/16,A=g/2+y;return this.sceneOrigin.track(p),p.position.set(t.x+.5,t.y+A,t.z+.5),p}lightUpdate(t,r){for(let i=this.worldSizeParams.minY;i<this.worldSizeParams.worldHeight;i+=16)this.setSectionDirty(new G0(t,i,r))}rerenderAllChunks(){for(let t of Object.keys(this.sectionObjects)){let[r,i,s]=t.split(",").map(Number);this.setSectionDirty(new G0(r,i,s))}}updateShowChunksBorder(t){this.chunkMeshManager.updateAllBoxHelpers(t)}resetWorld(){super.resetWorld(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.chunkMeshManager=new j5(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(t,r=!1){let[i,s,o]=Yr(t);return Object.fromEntries(Object.entries(this.sectionObjects).map(([a,v])=>{let[l,c,u]=a.split(",").map(Number),[h,p,g]=Yr({x:l,y:c,z:u});return[r?`${h-i},${p-s},${g-o}`:`${h-i},${g-o}`,v]}))}cleanChunkTextures(t,r){let i=this.chunkTextures.get(`${Math.floor(t/16)},${Math.floor(r/16)}`)??{};for(let s of Object.keys(i))i[s].dispose(),delete i[s];this.chunkMeshManager.cleanSignChunkTextures(t,r)}readdChunks(){for(let t of Object.keys(this.sectionObjects))this.scene.remove(this.sectionObjects[t]);setTimeout(()=>{for(let t of Object.keys(this.sectionObjects))this.scene.add(this.sectionObjects[t])},500)}disableUpdates(t=this.scene.children){for(let r of t)r.matrixWorldNeedsUpdate=!1,this.disableUpdates(r.children??[])}removeColumn(t,r){super.removeColumn(t,r),this.cleanChunkTextures(t,r),this.clearPendingSectionUpdatesForChunk(t,r);let i=this.getSectionHeight(),s=this.worldMinYRender;for(let o=s;o<this.worldSizeParams.worldHeight;o+=i){let a=`${t},${o},${r}`;this.chunkMeshManager.sectionObjects[a]&&this.chunkMeshManager.releaseSection(a)}this.chunkMeshManager.onChunkRemovedFromGate(`${t},${r}`)}updateViewerPosition(t){super.updateViewerPosition(t),this.chunkMeshManager.pendingNearReveal.size>0&&this.chunkMeshManager.tryRevealPending()}onViewerChunkPositionChanged(){this.chunkMeshManager.tryRevealPending()}setSectionDirty(...t){let[r]=t;this.cleanChunkTextures(r.x,r.z),super.setSectionDirty(...t)}static getRendererInfo(t){try{let r=t.getContext();return`${r.getParameter(r.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(t){let i=this.getSectionHeight(),s,o,a,v=this.sceneOrigin.getWorldPosition(t);v?(s=v.x,o=v.y,a=v.z):(s=this.sceneOrigin.toWorldX(t.position.x),o=this.sceneOrigin.toWorldY(t.position.y),a=this.sceneOrigin.toWorldZ(t.position.z));let l=Math.floor(s/16)*16,c=Math.floor(a/16)*16,u=Math.floor(o/i)*i,h=`${l},${c}`,p=`${l},${u},${c}`;return!!this.finishedChunks[h]||!!this.sectionObjects[p]}handleUserClick(t){this.media.handleUserClick(t)}updateSectionOffsets(){let t=performance.now();for(let[r,i]of Object.entries(this.sectionsOffsetsAnimations)){let s=(t-i.time)/1e3;i.time=t,i.currentOffsetX+=i.speedX*s,i.currentOffsetY+=i.speedY*s,i.currentOffsetZ+=i.speedZ*s,i.limitX!==void 0&&(i.speedX>0?i.currentOffsetX=Math.min(i.currentOffsetX,i.limitX):i.currentOffsetX=Math.max(i.currentOffsetX,i.limitX)),i.limitY!==void 0&&(i.speedY>0?i.currentOffsetY=Math.min(i.currentOffsetY,i.limitY):i.currentOffsetY=Math.max(i.currentOffsetY,i.limitY)),i.limitZ!==void 0&&(i.speedZ>0?i.currentOffsetZ=Math.min(i.currentOffsetZ,i.limitZ):i.currentOffsetZ=Math.max(i.currentOffsetZ,i.limitZ));let o=this.sectionObjects[r];o&&(o.position.set(i.currentOffsetX,i.currentOffsetY,i.currentOffsetZ),o.updateMatrix())}}reloadWorld(){this.entities.reloadEntities()}};d(yt,"FOV_TRANSITION_MS",200),d(yt,"MAX_SECTION_UPDATE_BUFFER_MS",500);var _t=yt;E();x();k();R();E();x();k();R();var V0="1.21.4";E();x();k();R();function wt(n,e){n.aspect=e.width/e.height,n.updateProjectionMatrix()}E();x();k();R();function ln(n,e=!1){return n?.mode?n.mode:e?"worldBlocks":b0.mode}E();x();k();R();import*as ve from"three";E();x();k();R();function cn(...n){let e=n.filter(r=>r.length>0).join("/"),t=typeof globalThis.location<"u"&&globalThis.location.href?globalThis.location.href:typeof import.meta<"u"&&import.meta.url?import.meta.url:`/${e}`;try{return new URL(e,t).href}catch{return`/${e}`}}var dn=new Date,Oa=dn.getMonth()===11&&dn.getDate()>=24&&dn.getDate()<=26,e9=["panorama_3.webp","panorama_1.webp","panorama_4.webp","panorama_5.webp","panorama_0.webp","panorama_2.webp"],t9=200,Zt=class{constructor(e){this.documentRenderer=e;d(this,"scene");d(this,"camera");d(this,"startTimes",new Map);d(this,"time",0);d(this,"panoramaGroup",null);this.scene=new ve.Scene,this.scene.background=new ve.Color(3294568);let t=new ve.AmbientLight(13421772);this.scene.add(t);let r=new ve.DirectionalLight(16777215,.5);r.position.set(1,1,.5).normalize(),r.castShadow=!0,this.scene.add(r),this.camera=new ve.PerspectiveCamera(85,e.canvas.width/e.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}async init(){this.buildCubemap()}update(e,t){t&&wt(this.camera,this.documentRenderer.canvas)}dispose(){this.scene.clear(),this.panoramaGroup=null,this.startTimes.clear()}buildCubemap(){let e=new ve.BoxGeometry(1e3,1e3,1e3),t=[];for(let s of e9)(async()=>{let a=cn("background",Oa?"christmas":"",s),v=await st(a),l=I0(v);l.matrixAutoUpdate=!1,l.matrix.set(-1,0,1,0,1,0,0,0,1),l.wrapS=ve.ClampToEdgeWrapping,l.wrapT=ve.ClampToEdgeWrapping,l.minFilter=ve.LinearFilter,l.magFilter=ve.LinearFilter;let c=new ve.MeshBasicMaterial({map:l,transparent:!0,side:ve.DoubleSide,depthWrite:!1,opacity:0});this.startTimes.set(c,Date.now()),t.push(c)})().catch(a=>{});let r=new ve.Mesh(e,t);r.onBeforeRender=()=>{this.time+=.01,r.rotation.y=Math.PI+this.time*.01,r.rotation.z=Math.sin(-this.time*.001)*.001;for(let s of t){let o=this.startTimes.get(s);if(o){let a=Date.now()-o;s.opacity=Math.min(1,a/t9)}}};let i=new ve.Object3D;if(i.add(r),!Oa)for(let s=0;s<20;s++){let o=new M0("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(r.rotation.y*3)*Math.PI/4-Math.PI/2},i.add(o)}this.scene.add(i),this.panoramaGroup=i}async debugImageInFrontOfCamera(){let e=await st(cn("background","panorama_0.webp")),t=I0(e),r=new ve.Mesh(new ve.PlaneGeometry(1e3,1e3),new ve.MeshBasicMaterial({map:t}));r.position.set(0,0,-500),this.scene.add(r)}};E();x();k();R();import*as N from"three";var Da=.1,fn={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"]},Fa={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 N.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 N.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 N.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 N.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 e=new N.Color;return n<.4?e.lerpColors(new N.Color(16054527),new N.Color(14215423),n/.4):n<.75?e.lerpColors(new N.Color(14215423),new N.Color(11061488),(n-.4)/.35):e.lerpColors(new N.Color(11061488),new N.Color(9482464),(n-.75)/.25),e},ambient:7899296,dir:13688040,pt1:11061503,pt2:13162751,name:"LIGHT",starColor:15266047,starOpacity:.5,galaxyOpacity:.7,nebulaOpacity:.32,edgeLineColor:10010856,blockOpacity:[.42,.56]}},r9={cruise:{pos:(n,e,t)=>({x:Math.sin(n*.28)*18+Math.cos(n*.11)*7+e*10,y:Math.sin(n*.19)*6+Math.cos(n*.31)*3+t*6,z:0}),look:(n,e,t)=>({x:Math.sin((n+.18)*.28)*18+e*8,y:Math.sin((n+.18)*.19)*6+t*4,z:-25}),roll:(n,e=0)=>e*.05+Math.sin(n*.22)*.015,spd:.18},barrel:{pos:(n,e,t)=>{let i=n*2.4;return{x:Math.cos(i)*10+e*4,y:Math.sin(i)*10+t*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,e,t)=>({x:Math.sin(n*.6)*30+e*8,y:Math.cos(n*.4)*18+t*6,z:Math.sin(n*.3)*12}),look:(n,e,t)=>({x:Math.sin(n*.6+.2)*30+e*6,y:Math.cos(n*.4+.2)*18-8+t*4,z:-35}),roll:(n,e=0)=>e*.08+Math.sin(n*.6)*.12,spd:.3},orbit:{pos:(n,e,t)=>({x:Math.cos(n*.5)*20+e*5,y:Math.sin(n*.25)*10+t*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,e,t)=>({x:Math.sin(n*1.1)*22+Math.sin(n*.37)*8+e*10,y:Math.sin(n*.7)*10+e*4+t*8,z:0}),look:(n,e,t)=>{let r=n+.12;return{x:Math.sin(r*1.1)*22+Math.sin(r*.37)*8+e*8,y:Math.sin(r*.7)*10+t*6,z:-22}},roll:(n,e=0)=>e*.1+Math.sin(n*1.1)*.06,spd:.22}},i9={cruise:1,barrel:1.6,dive:2.2,orbit:.7,snake:1.4},n9=250,cr=1e4,dr=3e3,Xt=n=>n[Math.floor(Math.random()*n.length)],un=n=>"#"+n.toString(16).padStart(6,"0"),za=n=>{if(typeof document>"u")return null;let e=document.createElement("canvas");e.width=4,e.height=512;let t=e.getContext("2d");if(!t)return null;let r=e.width,i=e.height,s=n.radial?t.createRadialGradient(r/2,i*.32,0,r/2,i*.32,i*.85):t.createLinearGradient(0,0,0,i);s.addColorStop(0,un(n.top)),n.mid!=null&&s.addColorStop(.45,un(n.mid)),s.addColorStop(1,un(n.bottom)),t.fillStyle=s,t.fillRect(0,0,r,i);let o=new N.CanvasTexture(e);return o.needsUpdate=!0,o},At=class{constructor(e,t={},r){this.documentRenderer=e;this.abortSignal=r;d(this,"scene");d(this,"camera");d(this,"ambient");d(this,"dir");d(this,"pt1");d(this,"pt2");d(this,"blocks",[]);d(this,"bGroup",new N.Group);d(this,"galaxy");d(this,"nebula");d(this,"stars");d(this,"galGeo");d(this,"nebGeo");d(this,"bGeo",new N.BoxGeometry(1,1,1));d(this,"eGeo",new N.EdgesGeometry(this.bGeo));d(this,"curScene");d(this,"curCam");d(this,"blockGroup");d(this,"cameraSpeed");d(this,"blockSpeed");d(this,"camT",0);d(this,"mx",0);d(this,"my",0);d(this,"tmx",0);d(this,"tmy",0);d(this,"transitioning",!1);d(this,"useMinecraftTextures",!1);d(this,"resourcesManager");d(this,"atlasTexture",null);d(this,"blockMaterialPool",new Map);d(this,"gradientSky",null);d(this,"gradientSkyTexture",null);d(this,"disposed",!1);d(this,"animTime",0);d(this,"texturesApplied",!1);d(this,"textureLoadInProgress",!1);d(this,"onAssetsTexturesUpdated");let i=b0;this.curScene=t.initialScene??i.v2Scene,this.curCam=t.initialCamera??i.v2Camera,this.blockGroup=t.initialBlockGroup??i.v2BlockGroup,this.cameraSpeed=t.initialCameraSpeed??g5.camera,this.blockSpeed=t.initialBlockSpeed??g5.block,this.useMinecraftTextures=t.useMinecraftTextures??i.minecraftTextures,this.resourcesManager=t.resourcesManager;let s=Fa[this.curScene];this.scene=new N.Scene,this.scene.fog=new N.FogExp2(s.fog,s.fogD),this.applyScenePalette(s),this.camera=new N.PerspectiveCamera(80,this.documentRenderer.canvas.width/this.documentRenderer.canvas.height,.1,700),this.ambient=new N.AmbientLight(s.ambient,2.5),this.scene.add(this.ambient),this.dir=new N.DirectionalLight(s.dir,4),this.dir.position.set(1,1,0),this.scene.add(this.dir),this.pt1=new N.PointLight(s.pt1,5,100),this.scene.add(this.pt1),this.pt2=new N.PointLight(s.pt2,4,80),this.pt2.position.set(30,20,-30),this.scene.add(this.pt2);for(let h=0;h<n9;h++)this.spawnBlock(s,!0);if(!this.useMinecraftTextures){let h=s.edgeLineColor??62975;for(let p=0;p<40;p++){let g=new N.LineBasicMaterial({color:h,transparent:!0,opacity:.25});Xt(this.blocks).mesh.add(new N.LineSegments(this.eGeo,g))}}this.scene.add(this.bGroup);let o=new N.BufferGeometry,a=new Float32Array(5e3*3);for(let h=0;h<5e3*3;h++)a[h]=(Math.random()-.5)*500;o.setAttribute("position",new N.BufferAttribute(a,3)),this.stars=new N.Points(o,new N.PointsMaterial({color:s.starColor??16777215,size:.3,transparent:!0,opacity:s.starOpacity??.7,sizeAttenuation:!0})),this.scene.add(this.stars),this.galGeo=new N.BufferGeometry;let v=new Float32Array(cr*3),l=new Float32Array(cr*3);for(let h=0;h<cr;h++){let p=h%3,g=Math.random(),y=p/3*Math.PI*2+g*Math.PI*5,A=g*90+Math.random()*10,b=(1-g)*18;v[h*3]=Math.cos(y)*A+(Math.random()-.5)*b,v[h*3+1]=(Math.random()-.5)*7,v[h*3+2]=Math.sin(y)*A+(Math.random()-.5)*b-180;let w=.2+g*.8,S=s.galFn(w);l[h*3]=S.r,l[h*3+1]=S.g,l[h*3+2]=S.b}this.galGeo.setAttribute("position",new N.BufferAttribute(v,3)),this.galGeo.setAttribute("color",new N.BufferAttribute(l,3)),this.galaxy=new N.Points(this.galGeo,new N.PointsMaterial({size:.9,vertexColors:!0,transparent:!0,opacity:s.galaxyOpacity??.55,sizeAttenuation:!0})),this.scene.add(this.galaxy),this.nebGeo=new N.BufferGeometry;let c=new Float32Array(dr*3),u=new Float32Array(dr*3);for(let h=0;h<dr;h++){let p=25+Math.random()*110,g=Math.random()*Math.PI*2,y=(Math.random()-.5)*Math.PI*.5;c[h*3]=p*Math.cos(g)*Math.cos(y),c[h*3+1]=p*Math.sin(y)*.6,c[h*3+2]=p*Math.sin(g)*Math.cos(y)-80;let A=new N.Color(Xt(s.nebula));u[h*3]=A.r,u[h*3+1]=A.g,u[h*3+2]=A.b}this.nebGeo.setAttribute("position",new N.BufferAttribute(c,3)),this.nebGeo.setAttribute("color",new N.BufferAttribute(u,3)),this.nebula=new N.Points(this.nebGeo,new N.PointsMaterial({size:3,vertexColors:!0,transparent:!0,opacity:s.nebulaOpacity??.3,sizeAttenuation:!0})),this.scene.add(this.nebula),this.addBackgroundTextPlane(),this.setupMouseTracking()}async init(){this.useMinecraftTextures&&this.scheduleMinecraftTextureLoad()}scheduleMinecraftTextureLoad(){!this.useMinecraftTextures||this.disposed||this.texturesApplied||this.textureLoadInProgress||this.tryApplyMinecraftTextures()}attachAssetsListener(){let e=this.resourcesManager;!e||this.onAssetsTexturesUpdated||(this.onAssetsTexturesUpdated=()=>this.scheduleMinecraftTextureLoad(),e.on("assetsTexturesUpdated",this.onAssetsTexturesUpdated))}detachAssetsListener(){let e=this.resourcesManager;!e||!this.onAssetsTexturesUpdated||(e.off("assetsTexturesUpdated",this.onAssetsTexturesUpdated),this.onAssetsTexturesUpdated=void 0)}hasBlockAtlas(e){let t=e.currentResources;return!!(t?.blocksAtlasImage&&t.blocksAtlasJson)}async ensureAtlasReady(e){if(await this.ensureMcDataLoaded(),this.hasBlockAtlas(e))return!0;if(typeof document>"u"&&e!==this.resourcesManager)return!1;e.currentConfig={...e.currentConfig,version:V0,noInventoryGui:!0};try{await e.updateAssetsData?.({})}catch{return!1}return this.hasBlockAtlas(e)}async tryApplyMinecraftTextures(){if(!(this.disposed||!this.useMinecraftTextures||this.texturesApplied)){this.textureLoadInProgress=!0;try{let e=this.resourcesManager??new h0;if(!await this.ensureAtlasReady(e)){this.resourcesManager&&this.attachAssetsListener();return}if(this.disposed)return;this.applyMinecraftTexturesFromAtlas(e),this.texturesApplied=!0,this.detachAssetsListener()}catch{this.useMinecraftTextures=!1,this.detachAssetsListener()}finally{this.textureLoadInProgress=!1}}}applyScenePalette(e){if(this.documentRenderer.renderer.setClearColor(e.bg),e.gradientBg)if(this.scene.background=null,this.gradientSky){if(this.gradientSky.visible=!0,this.gradientSkyTexture&&e.gradientBg){let s=za(e.gradientBg);s&&(this.gradientSkyTexture.dispose(),this.gradientSkyTexture=s,this.gradientSky.material.map=s,this.gradientSky.material.needsUpdate=!0)}}else{let s=za(e.gradientBg);s?(this.gradientSkyTexture=s,this.gradientSky=new N.Mesh(new N.PlaneGeometry(900,700),new N.MeshBasicMaterial({map:s,depthWrite:!1,side:N.DoubleSide})),this.gradientSky.position.set(0,0,-280),this.gradientSky.renderOrder=-1e3,this.scene.add(this.gradientSky)):this.scene.background=new N.Color(e.bg)}else this.scene.background=new N.Color(e.bg),this.gradientSky&&(this.gradientSky.visible=!1);this.scene.fog instanceof N.FogExp2&&(this.scene.fog.color.set(e.fog),this.scene.fog.density=e.fogD);let t=this.stars?.material;t&&(t.color.set(e.starColor??16777215),t.opacity=e.starOpacity??.7);let r=this.galaxy?.material;r&&(r.opacity=e.galaxyOpacity??.55);let i=this.nebula?.material;i&&(i.opacity=e.nebulaOpacity??.3)}setupMouseTracking(){let e=r=>{let i=typeof window<"u"?window.innerWidth:this.documentRenderer.canvas.width,s=typeof window<"u"?window.innerHeight:this.documentRenderer.canvas.height;this.tmx=(r.clientX/i-.5)*2,this.tmy=-(r.clientY/s-.5)*2};(typeof document<"u"?document:void 0)?.addEventListener("mousemove",e,{signal:this.abortSignal})}addBackgroundTextPlane(){let r=typeof document<"u"?document.createElement("canvas"):null;if(!r)return;r.width=2048,r.height=768;let i=r.getContext("2d");if(!i)return;i.clearRect(0,0,2048,768),i.save(),i.font="bold 560px Orbitron, sans-serif",i.textAlign="center",i.textBaseline="middle",i.shadowColor="rgba(0,200,255,0.35)",i.shadowBlur=80,i.fillStyle="rgba(255,255,255,0.055)",i.fillText("V2",2048*.28,768*.5),i.restore(),i.save(),i.font="bold 148px Orbitron, sans-serif",i.textAlign="center",i.textBaseline="middle",i.shadowColor="rgba(0,200,255,0.2)",i.shadowBlur=40,i.fillStyle="rgba(255,255,255,0.038)",i.fillText("by ZARDOY",2048*.72,768*.52),i.restore();let s=new N.CanvasTexture(r),o=new N.Mesh(new N.PlaneGeometry(280,105),new N.MeshBasicMaterial({map:s,transparent:!0,opacity:1,depthWrite:!1,side:N.DoubleSide,blending:N.AdditiveBlending}));o.position.set(8,4,-320),this.scene.add(o)}spawnBlock(e,t,r){let i=this.createBlockMaterial(e,r),s=new N.Mesh(this.bGeo,i),o=.3+Math.random()*3;s.scale.setScalar(o),s.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,t?-(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:r};this.blocks.push(a),this.bGroup.add(s)}createBlockMaterial(e,t){if(this.useMinecraftTextures&&t){let s=this.blockMaterialPool.get(t);if(s)return s.clone()}let[r,i]=e.blockOpacity??[.32,.46];return new N.MeshBasicMaterial({color:Xt(e.blocks),transparent:!0,opacity:r+Math.random()*(i-r),depthWrite:!1,blending:N.AdditiveBlending})}removeBlockEdgeLines(){for(let e of this.blocks){let t=e.mesh.children.filter(r=>r instanceof N.LineSegments);for(let r of t){e.mesh.remove(r),r.geometry?.dispose();let i=r.material;Array.isArray(i)?i.forEach(s=>s.dispose()):i.dispose()}}}async ensureMcDataLoaded(){let e=globalThis._LOAD_MC_DATA;e&&await e()}resolveBlockAtlasUv(e,t,r){let i=s=>{let o=t[s];return o?{u:o.u,v:o.v,su:o.su??r.suSv,sv:o.sv??r.suSv}:null};if(t[e])return i(e);for(let s of["_top","_side","_front","_0"]){let o=i(`${e}${s}`);if(o)return o}for(let s of Object.keys(t))if(s.startsWith(e))return i(s);return null}applyMinecraftTexturesFromAtlas(e){let t=e.currentResources;if(!t?.blocksAtlasImage||!t.blocksAtlasJson)throw new Error("Block atlas not available");let r=t.blocksAtlasJson,i=r.textures;this.atlasTexture=I0(t.blocksAtlasImage),this.atlasTexture.flipY=!1,this.atlasTexture.needsUpdate=!0;for(let s of fn[this.blockGroup]){let o=this.resolveBlockAtlasUv(s,i,r);if(!o)continue;let a=this.atlasTexture.clone();a.flipY=!1,a.offset.set(o.u,o.v),a.repeat.set(o.su,o.sv),a.needsUpdate=!0;let v=s.includes("glass"),l=new N.MeshBasicMaterial({map:a,side:N.DoubleSide,transparent:v,opacity:v?.85:1,alphaTest:v?.08:0,depthWrite:!0,toneMapped:!1});this.blockMaterialPool.set(s,l)}if(this.blockMaterialPool.size===0)throw new Error("No block textures resolved from atlas (check block names vs atlas keys)");this.removeBlockEdgeLines();for(let s of this.blocks){let o=Xt([...this.blockMaterialPool.keys()]);s.minecraftBlockName=o,s.mesh.material=this.blockMaterialPool.get(o).clone()}}setScene(e){if(!tt.includes(e)||e===this.curScene||this.transitioning)return;this.transitioning=!0,this.curScene=e;let t=Fa[e];setTimeout(()=>{if(this.disposed)return;this.applyScenePalette(t),this.ambient.color.set(t.ambient),this.dir.color.set(t.dir),this.pt1.color.set(t.pt1),this.pt2.color.set(t.pt2);for(let s of this.blocks)this.useMinecraftTextures&&s.minecraftBlockName||s.mesh.material instanceof N.MeshBasicMaterial&&s.mesh.material.color.set(Xt(t.blocks));let r=this.nebGeo.attributes.color;for(let s=0;s<dr;s++){let o=new N.Color(Xt(t.nebula));r.setXYZ(s,o.r,o.g,o.b)}r.needsUpdate=!0;let i=this.galGeo.attributes.color;for(let s=0;s<cr;s++){let o=.2+Math.random()*.8,a=t.galFn(o);i.setXYZ(s,a.r,a.g,a.b)}i.needsUpdate=!0,this.transitioning=!1},150)}setCamera(e){rt.includes(e)&&(this.curCam=e)}setCameraSpeed(e){this.cameraSpeed=Math.max(0,e)}setBlockSpeed(e){this.blockSpeed=Math.max(0,e)}async setBlockGroup(e){if(it.includes(e)&&e!==this.blockGroup&&(this.blockGroup=e,!(!this.useMinecraftTextures||this.disposed))){for(let t of this.blockMaterialPool.values())t.map?.dispose(),t.dispose();this.blockMaterialPool.clear(),this.texturesApplied=!1,this.scheduleMinecraftTextureLoad()}}getSceneId(){return this.curScene}getCameraId(){return this.curCam}getBlockGroupId(){return this.blockGroup}update(e,t){t&&wt(this.camera,this.documentRenderer.canvas);let r=r9[this.curCam],i=this.cameraSpeed,s=this.blockSpeed;this.camT+=e*r.spd*i,this.mx+=(this.tmx-this.mx)*.05,this.my+=(this.tmy-this.my)*.05;let o=this.mx*Da,a=this.my*Da,v=r.pos(this.camT,o,a),l=r.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=r.roll(this.camT,o);let c=i9[this.curCam]*s;this.animTime+=e*1e3*s;for(let u of this.blocks){if(u.mesh.position.z+=u.spd*c*60*e,u.mesh.position.x+=u.dx*60*e*s,u.mesh.position.y+=u.dy*60*e*s,u.mesh.rotation.x+=u.rx*c,u.mesh.rotation.y+=u.ry*c,u.mesh.rotation.z+=u.rz,!this.useMinecraftTextures&&u.mesh.material instanceof N.MeshBasicMaterial){let h=u.mesh.userData.baseOpacity??.38;u.mesh.userData.baseOpacity==null&&(u.mesh.userData.baseOpacity=h);let p=.88+Math.abs(Math.sin(this.animTime*8e-4+u.mesh.position.x*.3))*.12;u.mesh.material.opacity=h*p}u.mesh.position.z>this.camera.position.z+15&&u.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+=e*.006*s,this.nebula.rotation.y-=e*.003*s,this.stars.rotation.y+=e*4e-4*s}dispose(){this.disposed=!0,this.detachAssetsListener(),this.scene.clear(),this.bGeo.dispose(),this.eGeo.dispose(),this.galGeo.dispose(),this.nebGeo.dispose(),this.gradientSkyTexture?.dispose(),this.atlasTexture?.dispose();for(let e of this.blockMaterialPool.values())e.map?.dispose(),e.dispose();this.blockMaterialPool.clear()}};E();x();k();R();import*as e5 from"three";import{Vec3 as Ua}from"vec3";E();x();k();R();import s9 from"prismarine-world";import o9 from"prismarine-chunk";var La=n=>{let e=s9(n),t=o9(n),r=new e(n).sync,i=a9(r);for(let s of i)if(s.startsWith("set")&&s!=="setColumn"){let o=r[s].bind(r);r[s]=(...a)=>{let v=a[0];v.x!==void 0&&!r.getColumnAt(v)&&r.setColumn(Math.floor(v.x/16),Math.floor(v.z/16),new t(void 0)),o(...a)}}return r};function a9(n){let e=new Set,t=n;do for(let r of Object.getOwnPropertyNames(t))typeof n[r]=="function"&&r!=="constructor"&&e.add(r);while(t=Object.getPrototypeOf(t));return[...e]}var $t=class{constructor(e,t,r){this.documentRenderer=e;this.options=t;this.abortSignal=r;d(this,"_scene");d(this,"_camera");d(this,"worldRenderer");d(this,"WorldRendererClass",_t);this._scene=new e5.Scene,this._scene.background=new e5.Color(3294568),this._camera=new e5.PerspectiveCamera(85,e.canvas.width/e.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 e=V0,t=new h0;if(t.currentConfig={version:e,noInventoryGui:!0},await t.updateAssetsData?.({}),this.abortSignal.aborted)return;let r=La(e),s=Za("prismarine-block")(e),a=globalThis.mcData.blocksArray.filter(p=>{if(!p.name.includes("stained_glass"))return!1;let g=s.fromStateId(p.defaultState,0);if(g.shapes?.length!==1)return!1;let y=g.shapes[0];return y[0]===0&&y[1]===0&&y[2]===0&&y[3]===1&&y[4]===1&&y[5]===1}),v=-15,l=100,c=100;for(let p=-l;p<l;p++)for(let g=-c;g<c;g++){let y=a[Math.floor(Math.random()*a.length)];r.setBlockStateId(new Ua(p,g,v),y.defaultState)}this._camera.updateProjectionMatrix(),this._camera.position.set(.5,c/2+.5,.5),this._camera.rotation.set(0,0,0);let u=new Ua(...this._camera.position.toArray()),h=new $0(r,2,u);this.abortSignal.aborted||(this.worldRenderer=new this.WorldRendererClass(this.documentRenderer.renderer,this.options,{version:e,worldView:h,inWorldRenderingConfig:l5,playerStateReactive:G2().reactive,rendererState:J0().reactive,nonReactiveState:J0().nonReactive,resourcesManager:t}),this.worldRenderer instanceof _t&&(this._scene=this.worldRenderer.realScene,this._camera=this.worldRenderer.camera),h.init(u),await this.worldRenderer.waitForChunksToRender(),!this.abortSignal.aborted&&this.setupMouseParallax())}update(e,t){t&&wt(this.camera,this.documentRenderer.canvas)}dispose(){this.worldRenderer?.destroy(),this.worldRenderer=void 0,this._scene.clear()}setupMouseParallax(){let e=this._camera,t=e.position.x,r=e.position.y,i;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);i?.stop(),i=new Oe(e.position).to({x:t+a*o,y:r+v*o},0),i.start(),e.updateProjectionMatrix()},{signal:this.abortSignal})}};E();x();k();R();import*as Ga from"three";var t5=class{constructor(e,t,r={},i=!1){this.documentRenderer=e;this.options=t;d(this,"active");d(this,"abortController",new AbortController);d(this,"mode");d(this,"lastFrameTime",0);this.mode=ln(r,i)}get v2(){return this.active instanceof At?this.active:void 0}get scene(){return this.active?.scene}get camera(){return this.active?.camera}async start(e={}){this.active=this.createImplementation(e),await this.active.init(),this.active.scene.background instanceof Ga.Color&&this.documentRenderer.renderer.setClearColor(this.active.scene.background),this.lastFrameTime=performance.now(),this.documentRenderer.render=(t=!1)=>{let r=performance.now(),i=Math.min((r-this.lastFrameTime)/1e3,.05);this.lastFrameTime=r;let s=this.active;s&&(s.update(i,t),this.documentRenderer.renderer.render(s.scene,s.camera))}}createImplementation(e){switch(this.mode){case"v2":return new At(this.documentRenderer,{useMinecraftTextures:e.useMinecraftTextures,initialScene:e.v2Scene,initialCamera:e.v2Camera,initialBlockGroup:e.v2BlockGroup,initialCameraSpeed:e.v2CameraSpeed,initialBlockSpeed:e.v2BlockSpeed,resourcesManager:e.resourcesManager},this.abortController.signal);case"worldBlocks":return new $t(this.documentRenderer,this.options,this.abortController.signal);default:return new Zt(this.documentRenderer)}}dispose(){this.active?.dispose(),this.active=void 0,this.abortController.abort()}};Y5.ColorManagement.enabled=!1;globalThis.THREE=Y5;var Va=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(e,t){n.sectionsOffsetsAnimations[e]=t},removeSectionAnimation(e){delete n.sectionsOffsetsAnimations[e]},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:e=>n.toggleModule("rain",e),spawnBlockBreakParticles(e,t,r,i,s,o){n.getModule("blockBreakParticles")?.spawnBlockBreakParticles(e,t,r,i,s,o)},spawnBlockCrackParticle(e,t,r,i,s,o,a){n.getModule("blockBreakParticles")?.spawnCrackParticle(e,t,r,i,s,o,a)},async loadGeometryExport(e){let{applyWorldGeometryExport:t}=await Promise.resolve().then(()=>(Ki(),ha));return t(n,e)},feedChunkPacket(e){let{kind:t,...r}=e,i={type:t,...r};for(let s of n.workers)s.postMessage(i)},getChunksDebugState(){let e={};for(let t of Object.keys(n.sectionObjects)){let[r,,i]=t.split(",").map(Number);e[`${r},${i}`]=!0}return{loadedSectionsChunks:e,loadedChunks:{...n.loadedChunks},finishedChunks:{...n.finishedChunks}}}}),l9=[],ur=(n,...e)=>{for(let t of Object.values(globalThis.loadedMods??{}))try{t.threeJsBackendModule?.[n]?.(...e)}catch(r){let i=`[mod three.js] Error calling ${n} on ${t.name}: ${r}`;throw new Error(i)}},Na=()=>{let n,e=null,t=null,r=null,i=null,s=(c,u)=>{ae?n=A5(c,l9,globalThis):n=c,e=new f5(n,u?.canvas),globalThis.renderer=e.renderer,globalThis.documentRenderer=e,globalThis.threeJsBackend=l,ur("default",l)},o=async c=>{if(!e)throw new Error("Document renderer not initialized");r&&(r.destroy(),r=null,i=null,globalThis.world=void 0,globalThis.frameTimingCollector=void 0),t&&(t.dispose(),t=null);let u={...n.config.menuBackground,...c};t=new t5(e,{...n},u,!!D.env.SINGLE_FILE_BUILD_MODE),ur("menuBackgroundCreated",t),await t.start(u),ur("menuBackgroundReady",t)},a=async c=>{if(!e)throw new Error("Document renderer not initialized");t&&(t.dispose(),t=null),r&&(r.destroy(),r=null,i=null,globalThis.world=void 0,globalThis.frameTimingCollector=void 0);let h=ae?A5(c,[h0,X0],globalThis):c;e.nonReactiveState=h.nonReactiveState,globalThis.resourcesManager=h.resourcesManager,r=new _t(e.renderer,n,h),await r.worldReadyPromise,i=h.inWorldRenderingConfig.enableDebugOverlay?new f1(h.nonReactiveState):null,globalThis.frameTimingCollector=i;let p=e.render;e.render=function(g){p.call(this,g),i?.markFrameStart(),h.inWorldRenderingConfig.paused||r?.render(g),i?.markFrameEnd(),i?.markFrameDisplay()},e.inWorldRenderingConfig=h.inWorldRenderingConfig,globalThis.world=r,ur("worldReady",r)},v=()=>{t&&(t.dispose(),t=null),e&&e.dispose(),r&&(r.destroy(),r=null)},l={id:"threejs",displayName:`three.js ${Y5.REVISION}`,startMenuBackground:o,startWorld:a,disconnect:v,setRendering(c){e.setPaused(!c),r&&(r.renderingActive=c)},getMenuBackground:()=>t??void 0,getDebugOverlay:()=>({get entitiesString(){return r?.entities.getDebugString()},get left(){return{"Geo Memory":r?.chunkMeshManager.getEstimatedMemoryUsage().total??"-"}}}),updateCamera(c,u,h){i?.markCameraUpdate(!c),r?.setFirstPersonCamera(c,u,h)},get soundSystem(){return r?.soundSystem},get backendMethods(){if(r)return Va(r)}};return{main:{init:s,backend:l},workerProxy(){return ps({init(c,u){s(c,{canvas:u})},updateSizeExternal(c,u,h){e?.updateSizeExternal(c,u,h)},startMenuBackground:o,startWorld:a,disconnect:v,setRendering:l.setRendering,updateCamera(c,u,h){let p=c?new v9(c.x,c.y,c.z):null;i?.markCameraUpdate(!p),l.updateCamera(p,u,h)},async callBackendMethod(c,...u){if(!r)throw new Error("World renderer not initialized");let p=Va(r)[c];if(!p)throw new Error(`Backend method ${String(c)} is unavailable`);return p(...u)}})}}};var fr=n=>{let{main:e}=Na();return e.init(n),e.backend};fr.id="threejs";fr.displayName="three.js Blocking";fr.description="Simple, old and stable main thread graphics backend providing balanced performance on top of WebGL2.";E();x();k();R();import*as Wa from"three";function c9(n){let e="threeWorker.js",t;if(D.env.SINGLE_FILE_BUILD){let r=document.getElementById("three-worker-code").textContent,i=new Blob([r],{type:"text/javascript"});t=new Worker(window.URL.createObjectURL(i))}else t=new Worker(e);return t.onmessage=({data:r})=>{n(r)},t.on&&t.on("message",r=>{t.onmessage({data:r})}),t}var hr=async n=>{let e=c9(()=>{}),t=gs(e),r=Br();r.onSizeChanged((a,v)=>{t.updateSizeExternal(a,v,window.devicePixelRatio||1)});let i=w5(n,e);try{t.init(i,r.canvas)}catch(a){throw ot(i),a}let s=new Proxy({},{get(a,v){if(typeof v=="string")return async(...l)=>t.callBackendMethod(v,...l)}});return{id:"threejs",displayName:`three.js ${Wa.REVISION}`,async startMenuBackground(a){let v=a?.resourcesManager?.currentResources?.mcData;if(v){let c={...at,items:"itemsArray",entities:"entitiesArray"};await Zr([e],V0,c,v)}let l=w5(a??{},e);try{await t.startMenuBackground(structuredClone(l))}catch(c){throw ot(l),c}},async startWorld(a){let v={...at,items:"itemsArray",entities:"entitiesArray"};await Zr([e],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=w5(a,e);try{await t.startWorld(structuredClone(l))}catch(h){throw ot(l),h}t.updateSizeExternal(r.size.width,r.size.height,window.devicePixelRatio||1);let c=lt("fps");setInterval(()=>{let{fps:h,avgRenderTime:p,worstRenderTime:g}=a.nonReactiveState;c.updateText(`FPS: ${h.toFixed(0)} (${p.toFixed(0)}ms/${g.toFixed(0)}ms)`),a.nonReactiveState.fps=0},1e3);let u=lt("downloaded-chunks",100,140,20,{className:vt});setInterval(()=>{let h=(n.config.statsVisible??0)>1;u.setVisibility(h),h&&u.updateText(a.nonReactiveState.world.chunksFullInfo)},200)},disconnect(){r.destroy(),t.disconnect(),e.terminate()},setRendering(a){t.setRendering(a)},updateCamera(a,v,l){t.updateCamera(a?{x:a.x,y:a.y,z:a.z}:null,v,l)},soundSystem:void 0,backendMethods:s}};hr.id="threejs-off-thread";hr.displayName="three.js Multi-thread";hr.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{ns as AppViewer,Zt as ClassicMenuBackground,f5 as DocumentRenderer,wr as HIGH_TEXTURE_COUNT,t1 as LONG_RENDER_TIME_MS,_r as LOW_FPS_THRESHOLD,Bt as LoadedResourcesTransferrable,vt as MC_RENDERER_DEBUG_OVERLAY_CLASS,V0 as MENU_BACKGROUND_MC_VERSION,g5 as MENU_BACKGROUND_MOTION_DEFAULTS,b0 as MENU_BACKGROUND_OPTION_DEFAULTS,fn as MINECRAFT_BLOCK_GROUPS,it as MINECRAFT_BLOCK_GROUP_IDS,p5 as MINECRAFT_BLOCK_GROUP_LABELS,t5 as MenuBackgroundRenderer,v5 as PerformanceMonitor,ss as RENDERER_DEFAULT_OPTIONS,os as RENDERER_OPTIONS_META,as as RENDERER_RENDER_GUI_SECTIONS,h0 as ResourcesManager,At as V2MenuBackground,rt as V2_CAMERA_IDS,m5 as V2_CAMERA_LABELS,tt as V2_SCENE_IDS,h5 as V2_SCENE_LABELS,$t as WorldBlocksMenuBackground,$0 as WorldView,X0 as WorldViewWorker,Br as addCanvasForWorker,I6 as applyMenuBackgroundLiveOptions,pf as applyRendererEnableLighting,z6 as applyRendererOptions,hf as applyRendererWorldViewOptions,Mt as chunkPos,hr as createGraphicsBackendOffThread,fr as createGraphicsBackendSingleThread,yl as createWorldRendererConfig,L2 as defaultGraphicsBackendConfig,yr as defaultPerformanceInstabilityFactors,l5 as defaultWorldRendererConfig,N2 as delayedIterator,Ar as formatPerformanceFactorsDebug,J0 as getDefaultRendererState,ds as getInitialPlayerState,G6 as getInitialPlayerStateRenderer,U6 as getPlayerStateUtils,ae as isWebWorker,ff as menuBackgroundOptionsFromStorage,E0 as menuBackgroundSpeedToMultiplier,E6 as migrateRendererOptions,Hr as rendererShaderCubeDebugModeToValue,c6 as sectionPos,mf as subscribeRendererOptions};
|
|
21509
21509
|
/*! Bundled license information:
|
|
21510
21510
|
|
|
21511
21511
|
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|