Skip to content

Commit

Permalink
ProgWidgetCC implements IStandbyWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Nov 4, 2023
1 parent 039be36 commit 3fed131
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,16 @@ public Object[] call(Object[] args) {
return null;
}
});

registry.registerLuaMethod(new LuaMethod("setAllowStandbyPickup") {
@Override
public Object[] call(Object[] args) {
requireArgs(args, 1, "<boolean> standby_pickup");
getWidget().setAllowStandbyPickup((Boolean) args[0]);
messageToDrone(0xFFFFFFFF);
return null;
}
});
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
public class ProgWidgetCC extends ProgWidgetInventoryBase implements IBlockOrdered, IGotoWidget, IItemPickupWidget,
IEntityProvider, ITextWidget, ICondition, IItemDropper, ILiquidFiltered, IRedstoneEmissionWidget,
IRenamingWidget, ICraftingWidget, IMaxActions, IBlockRightClicker, ILiquidExport, ISignEditWidget,
IToolUser, ICheckLineOfSight {
IToolUser, ICheckLineOfSight, IStandbyWidget {
private Ordering order = Ordering.CLOSEST;
private boolean[] sides = new boolean[6];
private final Set<BlockPos> area = new HashSet<>();
Expand Down Expand Up @@ -82,6 +82,7 @@ public class ProgWidgetCC extends ProgWidgetInventoryBase implements IBlockOrder
private boolean canSteal;
private boolean checkSight;
private boolean signBackSide;
private boolean allowStandbyPickup;

public ProgWidgetCC() {
super(ModProgWidgets.COMPUTER_CONTROL.get());
Expand Down Expand Up @@ -559,4 +560,14 @@ public void setCheckSight(boolean checkSight) {
public boolean isCheckSight() {
return checkSight;
}

@Override
public boolean allowPickupOnStandby() {
return allowStandbyPickup;
}

@Override
public void setAllowStandbyPickup(boolean allowStandbyPickup) {
this.allowStandbyPickup = allowStandbyPickup;
}
}

0 comments on commit 3fed131

Please sign in to comment.