-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathIMultiblockPart.java
More file actions
41 lines (29 loc) · 1.28 KB
/
IMultiblockPart.java
File metadata and controls
41 lines (29 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package gregtech.api.metatileentity.multiblock;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface IMultiblockPart {
boolean isAttachedToMultiBlock();
default void addToMultiBlock(@NotNull MultiblockControllerBase controllerBase) {
addToMultiBlock(controllerBase, MultiblockControllerBase.DEFAULT_STRUCTURE);
}
void addToMultiBlock(@NotNull MultiblockControllerBase controllerBase, @NotNull String substructureName);
void removeFromMultiBlock(@NotNull MultiblockControllerBase controllerBase);
/**
* Gets how many multiblocks are currently using the part.
*/
int getWallshareCount();
/**
* Gets the name of the substructure the part is attached to, or null if it is not attached.
*/
@Nullable
String getSubstructureName();
boolean canPartShare(MultiblockControllerBase target, String substructureName);
default boolean canPartShare(MultiblockControllerBase target) {
return canPartShare(target, MultiblockControllerBase.DEFAULT_STRUCTURE);
}
default boolean canPartShare() {
return true;
}
/** Called when distinct mode is toggled on the controller that this part is attached to */
default void onDistinctChange(boolean newValue) {}
}