Skip to content

Commit

Permalink
Add a CPU selector widget like AE2 v10 (#136)
Browse files Browse the repository at this point in the history
* Update buildscript

* Add ic2 maven mirror

* Add ItemStack-dependent cell idle drain for EC2 cells

* Backport <https://github.com/AppliedEnergistics/Applied-Energistics-2/pull/6005/files>

* Hide NEI slots overlapping the new CPU selector
  • Loading branch information
eigenraven authored May 1, 2022
1 parent 05b39b4 commit 08bc7a5
Show file tree
Hide file tree
Showing 15 changed files with 751 additions and 162 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1646409286
//version: 1650343995
/*
DO NOT CHANGE THIS FILE!
Expand Down Expand Up @@ -568,7 +568,7 @@ publishing {
artifact source: shadowJar, classifier: ""
}
if(!noPublishedSources) {
artifact source: sourcesJar, classifier: "src"
artifact source: sourcesJar, classifier: "sources"
}
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
if (apiPackage) {
Expand Down
1 change: 1 addition & 0 deletions repositories.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repositories {
maven {
name 'ic2'
url 'https://maven.ic2.player.to/'
url 'https://maven2.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/appeng/api/implementations/items/IStorageCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import appeng.api.storage.data.IAEItemStack;
import net.minecraft.item.ItemStack;

import javax.annotation.Nullable;


/**
* Any item which implements this can be treated as an IMEInventory via
Expand Down Expand Up @@ -110,7 +112,17 @@ public interface IStorageCell extends ICellWorkbenchItem
boolean isStorageCell( ItemStack i );

/**
* @param i item
* @return drain in ae/t this storage cell will use.
*/
double getIdleDrain();
default double getIdleDrain( @Nullable ItemStack i ) {
// provided for API backwards compatibility
return getIdleDrain();
}

/**
* The old idle drain API that didn't accept an ItemStack. Unused in base AE2.
* @return drain in ae/t this storage cell will use.
*/
double getIdleDrain();
}
30 changes: 29 additions & 1 deletion src/main/java/appeng/api/networking/crafting/ICraftingCPU.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.storage.IBaseMonitor;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.WorldCoord;

import javax.annotation.Nullable;


public interface ICraftingCPU extends IBaseMonitor<IAEItemStack>
{

/**
/**
* @return true if the CPU currently has a job.
*/
boolean isBusy();
Expand All @@ -56,4 +59,29 @@ public interface ICraftingCPU extends IBaseMonitor<IAEItemStack>
* @return an empty string or the name of the cpu.
*/
String getName();

/**
* @return final output of the current crafting operation, or null if not crafting
*/
@Nullable
default IAEItemStack getFinalOutput()
{
return null;
}

/**
* @return remaining count of items (or other units of processing) for the current crafting job
*/
default long getRemainingItemCount()
{
return 0;
}

/**
* @return total count of items (or other units of processing) for the current crafting job
*/
default long getStartItemCount()
{
return 0;
}
}
Loading

0 comments on commit 08bc7a5

Please sign in to comment.