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,11 +61,18 @@
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 (stat !== "START_DESTROY_BLOCK") {
if (stat === "STOP_DESTROY_BLOCK") {
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;
}
return 0;
}
var r = globalThis.LCI_LMBEVENTS[cid].call(globalThis,
@ -140,4 +147,4 @@
LCI_registerItem(data);
}
ModAPI.events.callEvent("lib:libcustomitems:loaded", {});
})();
})();