From 2f98f0f03189cbd19f66a1a70ee70ec13b9bc271 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Tue, 12 Mar 2024 01:23:02 +0100 Subject: [PATCH] Formatting --- .../me/networktool/NetworkStatusScreen.java | 20 ++++++------- .../menu/me/networktool/MachineGroup.java | 7 +---- .../menu/me/networktool/NetworkStatus.java | 29 +++++++++---------- .../me/networktool/NetworkStatusMenu.java | 1 - 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/main/java/appeng/client/gui/me/networktool/NetworkStatusScreen.java b/src/main/java/appeng/client/gui/me/networktool/NetworkStatusScreen.java index b5ea578d5f0..9a0ffe32bbb 100644 --- a/src/main/java/appeng/client/gui/me/networktool/NetworkStatusScreen.java +++ b/src/main/java/appeng/client/gui/me/networktool/NetworkStatusScreen.java @@ -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; @@ -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 { @@ -56,7 +56,7 @@ public class NetworkStatusScreen extends AEBaseScreen { 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"); @@ -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; diff --git a/src/main/java/appeng/menu/me/networktool/MachineGroup.java b/src/main/java/appeng/menu/me/networktool/MachineGroup.java index b9e896f8461..3c61951d599 100644 --- a/src/main/java/appeng/menu/me/networktool/MachineGroup.java +++ b/src/main/java/appeng/menu/me/networktool/MachineGroup.java @@ -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}. diff --git a/src/main/java/appeng/menu/me/networktool/NetworkStatus.java b/src/main/java/appeng/menu/me/networktool/NetworkStatus.java index b587c5b353e..850398a09d8 100644 --- a/src/main/java/appeng/menu/me/networktool/NetworkStatus.java +++ b/src/main/java/appeng/menu/me/networktool/NetworkStatus.java @@ -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. @@ -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()); } } } diff --git a/src/main/java/appeng/menu/me/networktool/NetworkStatusMenu.java b/src/main/java/appeng/menu/me/networktool/NetworkStatusMenu.java index 76b0aac0c16..3ffc22688f8 100644 --- a/src/main/java/appeng/menu/me/networktool/NetworkStatusMenu.java +++ b/src/main/java/appeng/menu/me/networktool/NetworkStatusMenu.java @@ -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;