Display stored matter in network
This commit is contained in:
parent
4f2fede296
commit
14f7115639
@ -9,12 +9,15 @@ import ru.dbotthepony.mc.otm.capability.IMatterHandler;
|
|||||||
import ru.dbotthepony.mc.otm.menu.slot.MatterContainerInputSlot;
|
import ru.dbotthepony.mc.otm.menu.slot.MatterContainerInputSlot;
|
||||||
import ru.dbotthepony.mc.otm.menu.widget.MatterLevelWidget;
|
import ru.dbotthepony.mc.otm.menu.widget.MatterLevelWidget;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
public class MatterCapacitorBankMenu extends MatteryMenu {
|
public class MatterCapacitorBankMenu extends MatteryMenu {
|
||||||
public MatterCapacitorBankMenu(int p_38852_, Inventory inventory) {
|
public MatterCapacitorBankMenu(int p_38852_, Inventory inventory) {
|
||||||
this(p_38852_, inventory, null);
|
this(p_38852_, inventory, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MatterLevelWidget matter_widget;
|
public MatterLevelWidget matter_widget;
|
||||||
|
public MatterLevelWidget total_matter_widget;
|
||||||
|
|
||||||
public MatterContainerInputSlot[] container_slots = new MatterContainerInputSlot[2 * 6];
|
public MatterContainerInputSlot[] container_slots = new MatterContainerInputSlot[2 * 6];
|
||||||
|
|
||||||
@ -23,8 +26,22 @@ public class MatterCapacitorBankMenu extends MatteryMenu {
|
|||||||
|
|
||||||
if (tile == null) {
|
if (tile == null) {
|
||||||
matter_widget = new MatterLevelWidget(this, 14, 20);
|
matter_widget = new MatterLevelWidget(this, 14, 20);
|
||||||
|
total_matter_widget = new MatterLevelWidget(this, 14, 20);
|
||||||
} else {
|
} else {
|
||||||
matter_widget = new MatterLevelWidget(this, 14, 20, tile.matter);
|
matter_widget = new MatterLevelWidget(this, 14, 20, tile.matter);
|
||||||
|
total_matter_widget = new MatterLevelWidget(this, 14, 20, () -> {
|
||||||
|
if (tile.getMatterGrid() != null) {
|
||||||
|
return tile.getMatterGrid().getStored();
|
||||||
|
}
|
||||||
|
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
}, () -> {
|
||||||
|
if (tile.getMatterGrid() != null) {
|
||||||
|
return tile.getMatterGrid().getCapacity();
|
||||||
|
}
|
||||||
|
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Container container = tile != null ? tile.matter_container : new SimpleContainer(2 * 6);
|
Container container = tile != null ? tile.matter_container : new SimpleContainer(2 * 6);
|
||||||
|
@ -17,7 +17,7 @@ public class MatterCapacitorBankScreen extends MatteryScreen<MatterCapacitorBank
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GaugeWidget> getGauges() {
|
public List<GaugeWidget> getGauges() {
|
||||||
return List.of(menu.matter_widget);
|
return List.of(menu.matter_widget, menu.total_matter_widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user