Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Update core.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlaubb authored Sep 3, 2023
1 parent 09faa76 commit c606d27
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,19 +424,8 @@ mc.system.runInterval(() => {
config = get('config')
return
};
if(!config.realmUse){ //add Admin state
if(player.isOp()){
player.op = true;
} else {
player.op = false;
}
} else {
if(player.hasTag('ess:admin')){
player.Esadmin = true;
} else {
player.Esadmin = false;
}
};
player.op = !world.database_config.realmUse ? player.isOp() : player.hasTag('ess:admin'); //in RealmUse, use tag instead
player.id === '-4294967295' ? player.host = true : player.host = false //prevent host deop + tempkick
if (!world.databasechanged && JSON.stringify(get('config')) != JSON.stringify(world.database_config)) {
world.sendMessage(`§9Essential §l§7>§r§c ${lang.database.changed}`);
reload('config', world.database_config);
Expand Down Expand Up @@ -834,7 +823,7 @@ mc.system.runInterval(() => {
world.beforeEvents.dataDrivenEntityTriggerEvent.subscribe(ev => {
if (ev.id !== "ess:kick") return;
const player = ev.entity;
if (player.isOp()) {
if (player.op || player.host) {
console.warn(`Essential > Failed to tempkick ${player.name} as Admin`);
return ev.cancel = true
};
Expand Down

0 comments on commit c606d27

Please sign in to comment.