Skip to content

Commit

Permalink
Fix bug with battery save in miner and replace slot to top (#1577)
Browse files Browse the repository at this point in the history
Co-authored-by: screret <[email protected]>
Co-authored-by: YoungOnion <[email protected]>
  • Loading branch information
3 people authored Jul 14, 2024
1 parent 62f2407 commit 7367103
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ public MinerMachine(IMachineBlockEntity holder, int tier, int speed, int maximum
// ***** Initialization ******//
//////////////////////////////////////

@Override
public ManagedFieldHolder getFieldHolder() {
return MANAGED_FIELD_HOLDER;
}

protected ItemStackTransfer createChargerItemHandler(Object... args) {
var transfer = new ItemStackTransfer();
transfer.setFilter(item -> GTCapabilityHelper.getElectricItem(item) != null);
Expand Down Expand Up @@ -210,17 +215,17 @@ protected void chargeBattery() {
.memoize((path, inventorySize) -> new EditableMachineUI("misc", path, () -> {
WidgetGroup template = createTemplate(inventorySize).createDefault();
SlotWidget batterySlot = createBatterySlot().createDefault();
batterySlot.setSelfPosition(new Position(79, 62));
batterySlot.setSelfPosition(new Position(100, 10));
WidgetGroup group = new WidgetGroup(0, 0, Math.max(template.getSize().width + 12, 172),
template.getSize().height + 8);
group.addWidget(batterySlot);
Size size = group.getSize();

template.setSelfPosition(new Position(
(size.width - 4 - template.getSize().width) / 2 + 4,
(size.height - template.getSize().height) / 2));

group.addWidget(template);
group.addWidget(batterySlot);
return group;
}, (template, machine) -> {
if (machine instanceof MinerMachine minerMachine) {
Expand Down

0 comments on commit 7367103

Please sign in to comment.