Skip to content

Commit

Permalink
feat: добавлены методы
Browse files Browse the repository at this point in the history
- добавлены методы из 153
  • Loading branch information
Reider745 committed Dec 29, 2023
1 parent e6f32a6 commit 9cfe1f8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/reider745/entity/PlayerActorMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,9 @@ public static float getItemUseStartupProgress(Player pointer){
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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,8 @@ public float getItemUseIntervalProgress() {
public float getItemUseStartupProgress() {
return PlayerActorMethods.getItemUseStartupProgress(pointer);
}

public boolean isOperator(){
return PlayerActorMethods.isOperator(pointer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ public static void explode(double x, double y, double z, double power, boolean o
NativeAPI.explode((float) x, (float) y, (float) z, (float) power, onFire);
}

@JSStaticFunction
public static boolean isServer(){
return false;
}

@APIStaticModule
public static class Logger {
@JSStaticFunction
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/innercore/coreengine/core-engine.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ var SaverAPI = {
}
};
var GameAPI = {
isServer: function(){
return isServer();
},
prevent: function() {
preventDefault();
},
Expand Down

0 comments on commit 9cfe1f8

Please sign in to comment.