feat: добавлены методы
- добавлены методы из 153
This commit is contained in:
@@ -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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user