add fix for creative

This commit is contained in:
radmanplays 2024-09-12 18:49:11 +03:30 committed by GitHub
parent a1ee9be716
commit b8811e8f1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,12 +61,19 @@
var statusTag = Object.keys(packet.$status).find(x => { return x.startsWith("$name") });
var positionTag = Object.keys(packet).filter(x => { return x.startsWith("$position") })[0];
var stat = ModAPI.util.unstr(packet.$status[statusTag]);
if ($this.$playerEntity.$capabilities.$isCreativeMode){
if (stat === "START_DESTROY_BLOCK") {
sendPacket($this, packetblockchange($this.$serverController.$worldServerForDimension($this.$playerEntity.$dimension), packet[positionTag]));
return 0;
}
} else {
if (stat !== "START_DESTROY_BLOCK") {
if (stat === "STOP_DESTROY_BLOCK") {
sendPacket($this, packetblockchange($this.$serverController.$worldServerForDimension($this.$playerEntity.$dimension), packet[positionTag]));
}
return 0;
}
}
var r = globalThis.LCI_LMBEVENTS[cid].call(globalThis,
new Proxy($this.$playerEntity, ModAPI.util.TeaVM_to_Recursive_BaseData_ProxyConf),