|
| 1 | +package com.zhekasmirnov.innercore.api; |
| 2 | + |
| 3 | +import com.reider745.InnerCoreServer; |
| 4 | +import org.mozilla.javascript.annotations.JSStaticFunction; |
| 5 | +import com.zhekasmirnov.apparatus.mcpe.NativeBlockSource; |
| 6 | + |
| 7 | + |
| 8 | +public class NativeGameController { |
| 9 | + @JSStaticFunction// Can break a block that breaks instantly |
| 10 | + public static boolean startDestroyBlock(int x, int y, int z, int side){ |
| 11 | + InnerCoreServer.useClientMethod("NativeGameController.startDestroyBlock"); |
| 12 | + return false; |
| 13 | + } |
| 14 | + @JSStaticFunction |
| 15 | + public static boolean continueDestroyBlock(int x, int y, int z, int side){ |
| 16 | + InnerCoreServer.useClientMethod("NativeGameController.continueDestroyBlock"); |
| 17 | + return false; |
| 18 | + } |
| 19 | + @JSStaticFunction// Interrupts the destruction animation |
| 20 | + public static void stopDestroyBlock(int x, int y, int z){ |
| 21 | + InnerCoreServer.useClientMethod("NativeGameController.stopDestroyBlock"); |
| 22 | + } |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + @JSStaticFunction |
| 27 | + public static void startBuildBlock(int x, int y, int z, int side){ |
| 28 | + InnerCoreServer.useClientMethod("NativeGameController.startBuildBlock"); |
| 29 | + } |
| 30 | + @JSStaticFunction |
| 31 | + public static void continueBuildBlock(int x, int y, int z, int side){ |
| 32 | + InnerCoreServer.useClientMethod("NativeGameController.continueBuildBlock"); |
| 33 | + } |
| 34 | + @JSStaticFunction |
| 35 | + public static void stopBuildBlock(){ |
| 36 | + InnerCoreServer.useClientMethod("NativeGameController.stopBuildBlock"); |
| 37 | + } |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + // Methods for interaction between the player and the world |
| 42 | + @JSStaticFunction |
| 43 | + public static void destroyBlock(int x, int y, int z, int side){ |
| 44 | + InnerCoreServer.useClientMethod("NativeGameController.destroyBlock"); |
| 45 | + } |
| 46 | + @JSStaticFunction |
| 47 | + public static void buildBlock(int x, int y, int z, int side){ |
| 48 | + InnerCoreServer.useClientMethod("NativeGameController.buildBlock"); |
| 49 | + } |
| 50 | + public static void useItemOn(long itemStack, float x, float y, float z, int side, long regionPtr){ |
| 51 | + InnerCoreServer.useClientMethod("NativeGameController.useItemOn"); |
| 52 | + } |
| 53 | + public static void attack(long entity){ |
| 54 | + InnerCoreServer.useClientMethod("NativeGameController.attack"); |
| 55 | + } |
| 56 | + public static void interact(long entity, float x, float y, float z){ |
| 57 | + InnerCoreServer.useClientMethod("NativeGameController.interact"); |
| 58 | + } |
| 59 | + @JSStaticFunction |
| 60 | + public static void releaseUsingItem(){ |
| 61 | + InnerCoreServer.useClientMethod("NativeGameController.releaseUsingItem"); |
| 62 | + } |
| 63 | + |
| 64 | + @JSStaticFunction |
| 65 | + public static void onItemUse(double x, double y, double z, int side){ |
| 66 | + useItemOn(0, (float) x, (float) y, (float) z, side, 0); |
| 67 | + } |
| 68 | + |
| 69 | +} |
0 commit comments