Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Mar 12, 2024
1 parent 2185264 commit 2f98f0f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@

package appeng.client.gui.me.networktool;

import java.util.ArrayList;
import java.util.List;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;

import appeng.api.client.AEKeyRendering;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.style.PaletteColor;
Expand All @@ -29,14 +37,6 @@
import appeng.menu.me.networktool.NetworkStatus;
import appeng.menu.me.networktool.NetworkStatusMenu;
import appeng.util.Platform;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;

import java.util.ArrayList;
import java.util.List;

public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusMenu> {

Expand All @@ -56,7 +56,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusMenu> {
private final Scrollbar scrollbar;

public NetworkStatusScreen(NetworkStatusMenu menu, Inventory playerInventory,
Component title, ScreenStyle style) {
Component title, ScreenStyle style) {
super(menu, playerInventory, title, style);
this.scrollbar = widgets.addScrollBar("scrollbar");

Expand All @@ -80,7 +80,7 @@ protected void updateBeforeRender() {

@Override
public void drawFG(GuiGraphics guiGraphics, int offsetX, int offsetY, int mouseX,
int mouseY) {
int mouseY) {
int x = 0;
int y = 0;
final int viewStart = scrollbar.getCurrentScroll() * COLUMNS;
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/appeng/menu/me/networktool/MachineGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@

package appeng.menu.me.networktool;

import appeng.api.networking.IGridNode;
import appeng.api.stacks.AEItemKey;
import net.minecraft.core.BlockPos;
import net.minecraft.network.FriendlyByteBuf;

import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import appeng.api.stacks.AEItemKey;

/**
* Represents the status of machines grouped by their {@link IGridBlock#getMachineRepresentation() item representation}.
Expand Down
29 changes: 14 additions & 15 deletions src/main/java/appeng/menu/me/networktool/NetworkStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@

package appeng.menu.me.networktool;

import appeng.api.implementations.parts.ICablePart;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.common.collect.ImmutableList;

import net.minecraft.network.FriendlyByteBuf;

import appeng.api.networking.IGrid;
import appeng.api.networking.IGridNode;
import appeng.api.networking.energy.IEnergyService;
import appeng.api.networking.energy.IPassiveEnergyGenerator;
import appeng.blockentity.misc.VibrationChamberBlockEntity;
import appeng.client.gui.me.networktool.NetworkStatusScreen;
import appeng.parts.AEBasePart;
import com.google.common.collect.ImmutableList;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.block.entity.BlockEntity;
import org.jetbrains.annotations.Nullable;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* Contains statistics about an ME network and the machines that form it.
Expand Down Expand Up @@ -80,12 +77,14 @@ public static NetworkStatus fromGrid(IGrid grid) {
group.setIdlePowerUsage(group.getIdlePowerUsage() + machine.getIdlePowerUsage());

var owner = machine.getOwner();
var passiveEnergyGenerator =machine.getService(IPassiveEnergyGenerator.class);
var passiveEnergyGenerator = machine.getService(IPassiveEnergyGenerator.class);
if (passiveEnergyGenerator != null && !passiveEnergyGenerator.isSuppressed()) {
group.setPowerGenerationCapacity(group.getPowerGenerationCapacity() + passiveEnergyGenerator.getRate());
group.setPowerGenerationCapacity(
group.getPowerGenerationCapacity() + passiveEnergyGenerator.getRate());
}
if (owner instanceof VibrationChamberBlockEntity vibrationChamberBlockEntity) {
group.setPowerGenerationCapacity(group.getPowerGenerationCapacity() + vibrationChamberBlockEntity.getMaxEnergyRate());
group.setPowerGenerationCapacity(
group.getPowerGenerationCapacity() + vibrationChamberBlockEntity.getMaxEnergyRate());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package appeng.menu.me.networktool;

import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.MenuType;

Expand Down

0 comments on commit 2f98f0f

Please sign in to comment.