feat: добавлены методы
- добавлены методы из 153
This commit is contained in:
@@ -158,4 +158,9 @@ public class PlayerActorMethods {
|
|||||||
if(pointer == null || !pointer.isValid()) return 0;
|
if(pointer == null || !pointer.isValid()) return 0;
|
||||||
return pointer.getInventory().getItemInHand().getMaxDurability();
|
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() {
|
public float getItemUseStartupProgress() {
|
||||||
return PlayerActorMethods.getItemUseStartupProgress(pointer);
|
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);
|
NativeAPI.explode((float) x, (float) y, (float) z, (float) power, onFire);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JSStaticFunction
|
||||||
|
public static boolean isServer(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@APIStaticModule
|
@APIStaticModule
|
||||||
public static class Logger {
|
public static class Logger {
|
||||||
@JSStaticFunction
|
@JSStaticFunction
|
||||||
|
|||||||
@@ -460,6 +460,9 @@ var SaverAPI = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var GameAPI = {
|
var GameAPI = {
|
||||||
|
isServer: function(){
|
||||||
|
return isServer();
|
||||||
|
},
|
||||||
prevent: function() {
|
prevent: function() {
|
||||||
preventDefault();
|
preventDefault();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user