-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Обновлен: Nukkit-Mot & поддержка b120
- Loading branch information
Showing
7 changed files
with
102 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/main/java/com/zhekasmirnov/innercore/api/NativeGameController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package com.zhekasmirnov.innercore.api; | ||
|
||
import com.reider745.InnerCoreServer; | ||
import org.mozilla.javascript.annotations.JSStaticFunction; | ||
import com.zhekasmirnov.apparatus.mcpe.NativeBlockSource; | ||
|
||
|
||
public class NativeGameController { | ||
@JSStaticFunction// Can break a block that breaks instantly | ||
public static boolean startDestroyBlock(int x, int y, int z, int side){ | ||
InnerCoreServer.useClientMethod("NativeGameController.startDestroyBlock"); | ||
return false; | ||
} | ||
@JSStaticFunction | ||
public static boolean continueDestroyBlock(int x, int y, int z, int side){ | ||
InnerCoreServer.useClientMethod("NativeGameController.continueDestroyBlock"); | ||
return false; | ||
} | ||
@JSStaticFunction// Interrupts the destruction animation | ||
public static void stopDestroyBlock(int x, int y, int z){ | ||
InnerCoreServer.useClientMethod("NativeGameController.stopDestroyBlock"); | ||
} | ||
|
||
|
||
|
||
@JSStaticFunction | ||
public static void startBuildBlock(int x, int y, int z, int side){ | ||
InnerCoreServer.useClientMethod("NativeGameController.startBuildBlock"); | ||
} | ||
@JSStaticFunction | ||
public static void continueBuildBlock(int x, int y, int z, int side){ | ||
InnerCoreServer.useClientMethod("NativeGameController.continueBuildBlock"); | ||
} | ||
@JSStaticFunction | ||
public static void stopBuildBlock(){ | ||
InnerCoreServer.useClientMethod("NativeGameController.stopBuildBlock"); | ||
} | ||
|
||
|
||
|
||
// Methods for interaction between the player and the world | ||
@JSStaticFunction | ||
public static void destroyBlock(int x, int y, int z, int side){ | ||
InnerCoreServer.useClientMethod("NativeGameController.destroyBlock"); | ||
} | ||
@JSStaticFunction | ||
public static void buildBlock(int x, int y, int z, int side){ | ||
InnerCoreServer.useClientMethod("NativeGameController.buildBlock"); | ||
} | ||
public static void useItemOn(long itemStack, float x, float y, float z, int side, long regionPtr){ | ||
InnerCoreServer.useClientMethod("NativeGameController.useItemOn"); | ||
} | ||
public static void attack(long entity){ | ||
InnerCoreServer.useClientMethod("NativeGameController.attack"); | ||
} | ||
public static void interact(long entity, float x, float y, float z){ | ||
InnerCoreServer.useClientMethod("NativeGameController.interact"); | ||
} | ||
@JSStaticFunction | ||
public static void releaseUsingItem(){ | ||
InnerCoreServer.useClientMethod("NativeGameController.releaseUsingItem"); | ||
} | ||
|
||
@JSStaticFunction | ||
public static void onItemUse(double x, double y, double z, int side){ | ||
useItemOn(0, (float) x, (float) y, (float) z, side, 0); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters