Skip to content

Commit 52cf930

Browse files
committed
Fixed OC iris IDC method
1 parent 7bf9eae commit 52cf930

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/java/tauri/dev/jsg/tileentity/stargate/StargateClassicBaseTile.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,13 +2640,12 @@ public Object[] sendMessageToIncoming(Context context, Arguments args) {
26402640

26412641
@SuppressWarnings("unused")
26422642
@Optional.Method(modid = "opencomputers")
2643-
@Callback(doc = "function(code:integer) -- send code like GDO")
2643+
@Callback(doc = "function(code:string) -- send code like GDO (should be only numbers)")
26442644
public Object[] sendIrisCode(Context context, Arguments args) {
2645-
2646-
StargatePos destinationPos = StargateNetwork.get(world).getStargate(dialedAddress);
2647-
if (!args.isInteger(0)) {
2648-
throw new IllegalArgumentException("code must be integer!");
2645+
if (args.count() <= 0) {
2646+
return new Object[]{false, "invalid_method_format", "You must enter code!"};
26492647
}
2648+
StargatePos destinationPos = StargateNetwork.get(world).getStargate(dialedAddress);
26502649
if (destinationPos == null) return new Object[]{false, "stargate_not_engaged"};
26512650
StargateAbstractBaseTile te = destinationPos.getTileEntity();
26522651
if (te instanceof StargateClassicBaseTile) {

0 commit comments

Comments
 (0)