mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-26 07:19:26 -09:00
Add support for arrays
This commit is contained in:
parent
4aebb8bab7
commit
574b478976
@ -29,7 +29,7 @@ PluginAPI.addEventListener("update", () => { //Every client tick
|
|||||||
if (
|
if (
|
||||||
PluginAPI.player.fishEntity !== undefined && //If the fish hook exists
|
PluginAPI.player.fishEntity !== undefined && //If the fish hook exists
|
||||||
GrappleHookPlugin.prev === "AIR" && //And the hook was previously in the air
|
GrappleHookPlugin.prev === "AIR" && //And the hook was previously in the air
|
||||||
PluginAPI.player.fishEntity.onGround //And the hook is in the ground
|
PluginAPI.player.fishEntity.inGround2 //And the hook is in the ground
|
||||||
) {
|
) {
|
||||||
GrappleHookPlugin.oldXYZ = [ //Set old grapple hook position
|
GrappleHookPlugin.oldXYZ = [ //Set old grapple hook position
|
||||||
PluginAPI.player.fishEntity.posX,
|
PluginAPI.player.fishEntity.posX,
|
||||||
|
@ -382,10 +382,8 @@ var main;(function(){`
|
|||||||
|
|
||||||
var outProp = "$" + prop;
|
var outProp = "$" + prop;
|
||||||
var outputValue = Reflect.get(target, outProp, receiver);
|
var outputValue = Reflect.get(target, outProp, receiver);
|
||||||
if (outputValue && typeof outputValue === "function") {
|
if (outputValue && typeof outputValue === "object" && Array.isArray(outputValue.data) && typeof outputValue.type === "function") {
|
||||||
return function (...args) {
|
return outputValue.data;
|
||||||
return outputValue.apply(target, args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (outputValue && typeof outputValue === "function") {
|
if (outputValue && typeof outputValue === "function") {
|
||||||
return function (...args) {
|
return function (...args) {
|
||||||
@ -400,6 +398,19 @@ var main;(function(){`
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
const TeaVMArray_To_Recursive_BaseData_ProxyConf = {
|
||||||
|
get(target, prop, receiver) {
|
||||||
|
var outputValue = Reflect.get(target, prop, receiver);
|
||||||
|
if (outputValue && typeof outputValue === "object" && !Array.isArray(outputValue)) {
|
||||||
|
return new Proxy(outputValue, TeaVM_to_Recursive_BaseData_ProxyConf);
|
||||||
|
}
|
||||||
|
return outputValue;
|
||||||
|
},
|
||||||
|
set(object, prop, value) {
|
||||||
|
object[prop]=value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
const TeaVM_to_Recursive_BaseData_ProxyConf = {
|
const TeaVM_to_Recursive_BaseData_ProxyConf = {
|
||||||
get(target, prop, receiver) {
|
get(target, prop, receiver) {
|
||||||
if (prop === "reload") {
|
if (prop === "reload") {
|
||||||
@ -413,6 +424,9 @@ var main;(function(){`
|
|||||||
|
|
||||||
var outProp = "$" + prop;
|
var outProp = "$" + prop;
|
||||||
var outputValue = Reflect.get(target, outProp, receiver);
|
var outputValue = Reflect.get(target, outProp, receiver);
|
||||||
|
if (outputValue && typeof outputValue === "object" && Array.isArray(outputValue.data) && typeof outputValue.type === "function") {
|
||||||
|
return new Proxy(outputValue.data, TeaVMArray_To_Recursive_BaseData_ProxyConf);
|
||||||
|
}
|
||||||
if (outputValue && typeof outputValue === "object" && !Array.isArray(outputValue)) {
|
if (outputValue && typeof outputValue === "object" && !Array.isArray(outputValue)) {
|
||||||
return new Proxy(outputValue, TeaVM_to_Recursive_BaseData_ProxyConf);
|
return new Proxy(outputValue, TeaVM_to_Recursive_BaseData_ProxyConf);
|
||||||
}
|
}
|
||||||
|
22
postinit.js
22
postinit.js
@ -76,10 +76,8 @@
|
|||||||
|
|
||||||
var outProp = "$" + prop;
|
var outProp = "$" + prop;
|
||||||
var outputValue = Reflect.get(target, outProp, receiver);
|
var outputValue = Reflect.get(target, outProp, receiver);
|
||||||
if (outputValue && typeof outputValue === "function") {
|
if (outputValue && typeof outputValue === "object" && Array.isArray(outputValue.data) && typeof outputValue.type === "function") {
|
||||||
return function (...args) {
|
return outputValue.data;
|
||||||
return outputValue.apply(target, args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (outputValue && typeof outputValue === "function") {
|
if (outputValue && typeof outputValue === "function") {
|
||||||
return function (...args) {
|
return function (...args) {
|
||||||
@ -94,6 +92,19 @@
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
const TeaVMArray_To_Recursive_BaseData_ProxyConf = {
|
||||||
|
get(target, prop, receiver) {
|
||||||
|
var outputValue = Reflect.get(target, prop, receiver);
|
||||||
|
if (outputValue && typeof outputValue === "object" && !Array.isArray(outputValue)) {
|
||||||
|
return new Proxy(outputValue, TeaVM_to_Recursive_BaseData_ProxyConf);
|
||||||
|
}
|
||||||
|
return outputValue;
|
||||||
|
},
|
||||||
|
set(object, prop, value) {
|
||||||
|
object[prop]=value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
const TeaVM_to_Recursive_BaseData_ProxyConf = {
|
const TeaVM_to_Recursive_BaseData_ProxyConf = {
|
||||||
get(target, prop, receiver) {
|
get(target, prop, receiver) {
|
||||||
if (prop === "reload") {
|
if (prop === "reload") {
|
||||||
@ -107,6 +118,9 @@
|
|||||||
|
|
||||||
var outProp = "$" + prop;
|
var outProp = "$" + prop;
|
||||||
var outputValue = Reflect.get(target, outProp, receiver);
|
var outputValue = Reflect.get(target, outProp, receiver);
|
||||||
|
if (outputValue && typeof outputValue === "object" && Array.isArray(outputValue.data) && typeof outputValue.type === "function") {
|
||||||
|
return new Proxy(outputValue.data, TeaVMArray_To_Recursive_BaseData_ProxyConf);
|
||||||
|
}
|
||||||
if (outputValue && typeof outputValue === "object" && !Array.isArray(outputValue)) {
|
if (outputValue && typeof outputValue === "object" && !Array.isArray(outputValue)) {
|
||||||
return new Proxy(outputValue, TeaVM_to_Recursive_BaseData_ProxyConf);
|
return new Proxy(outputValue, TeaVM_to_Recursive_BaseData_ProxyConf);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user