feat: добавлены методы

- добавлены методы из 153
This commit is contained in:
Reider745
2023-12-29 20:05:19 +03:00
parent e6f32a6ef4
commit 9cfe1f81d2
4 changed files with 17 additions and 0 deletions
@@ -158,4 +158,9 @@ public class PlayerActorMethods {
if(pointer == null || !pointer.isValid()) return 0;
return pointer.getInventory().getItemInHand().getMaxDurability();
}
public static boolean isOperator(Player pointer) {
if(pointer == null || !pointer.isValid()) return false;
return Server.getInstance().isOp(pointer.getName());
}
}
@@ -154,4 +154,8 @@ public class NativePlayer {
public float getItemUseStartupProgress() {
return PlayerActorMethods.getItemUseStartupProgress(pointer);
}
public boolean isOperator(){
return PlayerActorMethods.isOperator(pointer);
}
}
@@ -165,6 +165,11 @@ public class AdaptedScriptAPI extends API {
NativeAPI.explode((float) x, (float) y, (float) z, (float) power, onFire);
}
@JSStaticFunction
public static boolean isServer(){
return false;
}
@APIStaticModule
public static class Logger {
@JSStaticFunction
@@ -460,6 +460,9 @@ var SaverAPI = {
}
};
var GameAPI = {
isServer: function(){
return isServer();
},
prevent: function() {
preventDefault();
},