forked from xsun2001/Applied-Energistics-2-Unofficial
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add network bytes information for network status gui (#419)
* Add network bytes infomation for network status gui * Add network bytes infomation for network status gui * Update src/main/java/appeng/me/cache/GridStorageCache.java Co-authored-by: Andrei Antropov <q.laiff@gmail.com> * swap some of Class.forName to instanceof * make cache update delay * make cache update delay * Change error conditions * Change delay from 1000t(50s) to 100t(5s) * Let cache update data at the beginning * Add a cfg that can change the cache update rate * Add fluid bytes information * Add essentia status and change gui form * Apply the spotlessApply * Delete useless rows * Delete useless rows * Revert "Merge branch 'GTNewHorizons:master' into master" This reverts commit 01dde62, reversing changes made to d09184e. * Revert "Revert "Merge branch 'GTNewHorizons:master' into master"" This reverts commit 864bbd4. * back roll some commits * delete incorrect import and depends delete non compliant depends * Change interface's name * Remove wrong annotations * Add new AdvancedNetworkTool only text and texture, wait to implement the actual functions. * Add the Advanced Network Tool gui * Add the advanced toolbox for other Gui * Update Build Script * Add recipe into AE and fix some issue * Fix the wrong info when cell in ME chest * Add external buttons for advanced network status Actual function still working on it * merge with main branch Update Settings.java * Apply spotless * Add external Gui for advanced network tool * Add more info to new Gui * Apply spotless * Replace some class to interface --------- Co-authored-by: Andrei Antropov <q.laiff@gmail.com>
- Loading branch information
Showing
43 changed files
with
1,661 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package appeng.api.config; | ||
|
||
public enum CellType { | ||
|
||
ITEM, | ||
FLUID, | ||
ESSENTIA | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/appeng/api/implementations/HasServerSideToolLogic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package appeng.api.implementations; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.World; | ||
|
||
public interface HasServerSideToolLogic { | ||
|
||
boolean serverSideToolLogic(final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, | ||
final int z, final int side, final float hitX, final float hitY, final float hitZ); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package appeng.api.storage; | ||
|
||
/** | ||
* For {@link appeng.me.storage.CellInventoryHandler}(or FluidCellInventoryHandler in AE2FC) to easily get bytes | ||
* informations | ||
*/ | ||
public interface ICellCacheRegistry { | ||
|
||
boolean canGetInv(); | ||
|
||
long getTotalBytes(); | ||
|
||
long getFreeBytes(); | ||
|
||
long getUsedBytes(); | ||
|
||
long getTotalTypes(); | ||
|
||
long getFreeTypes(); | ||
|
||
long getUsedTypes(); | ||
|
||
int getCellStatus(); | ||
|
||
StorageChannel getCellType(); | ||
|
||
} |
78 changes: 78 additions & 0 deletions
78
src/main/java/appeng/client/gui/implementations/GuiAdvancedNetworkTool.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package appeng.client.gui.implementations; | ||
|
||
import java.io.IOException; | ||
|
||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.entity.player.InventoryPlayer; | ||
|
||
import appeng.api.implementations.guiobjects.INetworkTool; | ||
import appeng.client.gui.AEBaseGui; | ||
import appeng.client.gui.widgets.GuiToggleButton; | ||
import appeng.container.implementations.ContainerAdvancedNetworkTool; | ||
import appeng.core.AELog; | ||
import appeng.core.localization.GuiColors; | ||
import appeng.core.localization.GuiText; | ||
import appeng.core.sync.network.NetworkHandler; | ||
import appeng.core.sync.packets.PacketValueConfig; | ||
|
||
public class GuiAdvancedNetworkTool extends AEBaseGui { | ||
|
||
private GuiToggleButton tFacades; | ||
|
||
public GuiAdvancedNetworkTool(final InventoryPlayer inventoryPlayer, final INetworkTool te) { | ||
super(new ContainerAdvancedNetworkTool(inventoryPlayer, te)); | ||
this.ySize = 202; | ||
} | ||
|
||
@Override | ||
protected void actionPerformed(final GuiButton btn) { | ||
super.actionPerformed(btn); | ||
|
||
try { | ||
if (btn == this.tFacades) { | ||
NetworkHandler.instance.sendToServer(new PacketValueConfig("AdvancedNetworkTool", "Toggle")); | ||
} | ||
} catch (final IOException e) { | ||
AELog.debug(e); | ||
} | ||
} | ||
|
||
@Override | ||
public void initGui() { | ||
super.initGui(); | ||
|
||
this.tFacades = new GuiToggleButton( | ||
this.guiLeft - 18, | ||
this.guiTop + 8, | ||
23, | ||
22, | ||
GuiText.TransparentFacades.getLocal(), | ||
GuiText.TransparentFacadesHint.getLocal()); | ||
|
||
this.buttonList.add(this.tFacades); | ||
} | ||
|
||
@Override | ||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { | ||
if (this.tFacades != null) { | ||
this.tFacades.setState(((ContainerAdvancedNetworkTool) this.inventorySlots).isFacadeMode()); | ||
} | ||
|
||
this.fontRendererObj.drawString( | ||
this.getGuiDisplayName(GuiText.AdvancedNetworkTool.getLocal()), | ||
8, | ||
6, | ||
GuiColors.AdvancedNetworkToolTitle.getColor()); | ||
this.fontRendererObj.drawString( | ||
GuiText.inventory.getLocal(), | ||
8, | ||
this.ySize - 96 + 3, | ||
GuiColors.AdvancedNetworkToolInventory.getColor()); | ||
} | ||
|
||
@Override | ||
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { | ||
this.bindTexture("guis/advancedtoolbox.png"); | ||
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.