|
3 | 3 | import crafttweaker.annotations.ZenRegister; |
4 | 4 | import crafttweaker.api.block.IBlockState; |
5 | 5 | import crafttweaker.api.data.IData; |
6 | | -import crafttweaker.api.minecraft.CraftTweakerMC; |
7 | 6 | import crafttweaker.api.world.IBlockPos; |
8 | 7 | import crafttweaker.api.world.IFacing; |
9 | 8 | import crafttweaker.api.world.IWorld; |
|
13 | 12 | import hellfirepvp.modularmachinery.common.modifier.RecipeModifier; |
14 | 13 | import hellfirepvp.modularmachinery.common.tiles.base.TileMultiblockMachineController; |
15 | 14 | import hellfirepvp.modularmachinery.common.util.SmartInterfaceData; |
16 | | -import net.minecraft.tileentity.TileEntity; |
17 | | -import net.minecraft.util.math.BlockPos; |
18 | | -import net.minecraft.world.World; |
19 | 15 | import stanhebben.zenscript.annotations.ZenClass; |
20 | 16 | import stanhebben.zenscript.annotations.ZenGetter; |
21 | 17 | import stanhebben.zenscript.annotations.ZenMethod; |
|
27 | 23 | @ZenClass("mods.modularmachinery.IMachineController") |
28 | 24 | public interface IMachineController { |
29 | 25 |
|
30 | | - /** |
31 | | - * 获取对应 IWorld 中的某个坐标的控制器。 |
32 | | - * |
33 | | - * @param worldCT IWorld |
34 | | - * @param posCT IBlockPos |
35 | | - * @return 如果无控制器则返回 null,否则返回 IMachineController 实例。 |
36 | | - */ |
37 | | - @ZenMethod |
38 | | - static IMachineController getControllerAt(IWorld worldCT, IBlockPos posCT) { |
39 | | - World world = CraftTweakerMC.getWorld(worldCT); |
40 | | - BlockPos pos = CraftTweakerMC.getBlockPos(posCT); |
41 | | - if (world == null || pos == null || !world.isBlockLoaded(pos)) { |
42 | | - return null; |
43 | | - } |
44 | | - |
45 | | - TileEntity te = world.getTileEntity(pos); |
46 | | - return te instanceof IMachineController ? (IMachineController) te : null; |
47 | | - } |
48 | | - |
49 | | - /** |
50 | | - * 获取对应 IWorld 中的某个坐标的控制器。 |
51 | | - * |
52 | | - * @param worldCT IWorld |
53 | | - * @return 如果无控制器则返回 null,否则返回 IMachineController 实例。 |
54 | | - */ |
55 | | - @ZenMethod |
56 | | - static IMachineController getControllerAt(IWorld worldCT, int x, int y, int z) { |
57 | | - World world = CraftTweakerMC.getWorld(worldCT); |
58 | | - BlockPos pos = new BlockPos(x, y, z); |
59 | | - |
60 | | - if (world == null || !world.isBlockLoaded(pos)) { |
61 | | - return null; |
62 | | - } |
63 | | - |
64 | | - TileEntity te = world.getTileEntity(pos); |
65 | | - return te instanceof IMachineController ? (IMachineController) te : null; |
66 | | - } |
67 | | - |
68 | 26 | /** |
69 | 27 | * 获取控制器所在的世界。 |
70 | 28 | * |
|
0 commit comments