-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…itor Autocrafting monitor
- Loading branch information
Showing
213 changed files
with
5,405 additions
and
137 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
6 changes: 0 additions & 6 deletions
6
...pi/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/AutocraftingPreview.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...rc/main/java/com/refinedmods/refinedstorage/api/autocrafting/AutocraftingPreviewItem.java
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
...ain/java/com/refinedmods/refinedstorage/api/autocrafting/AutocraftingPreviewProvider.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...rc/main/java/com/refinedmods/refinedstorage/api/autocrafting/AutocraftingPreviewType.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...utocrafting-api/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/TaskId.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,9 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting; | ||
|
||
import java.util.UUID; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.10") | ||
public record TaskId(UUID id) { | ||
} |
9 changes: 9 additions & 0 deletions
9
...ng-api/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/preview/Preview.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,9 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting.preview; | ||
|
||
import java.util.List; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.9") | ||
public record Preview(PreviewType type, List<PreviewItem> items) { | ||
} |
9 changes: 9 additions & 0 deletions
9
...pi/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/preview/PreviewItem.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,9 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting.preview; | ||
|
||
import com.refinedmods.refinedstorage.api.resource.ResourceKey; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.9") | ||
public record PreviewItem(ResourceKey resource, long available, long missing, long toCraft) { | ||
} |
14 changes: 14 additions & 0 deletions
14
...rc/main/java/com/refinedmods/refinedstorage/api/autocrafting/preview/PreviewProvider.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,14 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting.preview; | ||
|
||
import com.refinedmods.refinedstorage.api.resource.ResourceKey; | ||
|
||
import java.util.Optional; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.9") | ||
public interface PreviewProvider { | ||
Optional<Preview> getPreview(ResourceKey resource, long amount); | ||
|
||
boolean startTask(ResourceKey resource, long amount); | ||
} |
10 changes: 10 additions & 0 deletions
10
...pi/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/preview/PreviewType.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,10 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting.preview; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.9") | ||
public enum PreviewType { | ||
SUCCESS, | ||
MISSING_RESOURCES | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
...i/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/preview/package-info.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,7 @@ | ||
@ParametersAreNonnullByDefault | ||
@FieldsAndMethodsAreNonnullByDefault | ||
package com.refinedmods.refinedstorage.api.autocrafting.preview; | ||
|
||
import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; |
32 changes: 32 additions & 0 deletions
32
...-api/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/status/TaskStatus.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,32 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting.status; | ||
|
||
import com.refinedmods.refinedstorage.api.autocrafting.TaskId; | ||
import com.refinedmods.refinedstorage.api.resource.ResourceKey; | ||
|
||
import java.util.List; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.10") | ||
public record TaskStatus(TaskInfo info, float percentageCompleted, List<Item> items) { | ||
public record TaskInfo(TaskId id, ResourceKey resource, long amount, long startTime) { | ||
} | ||
|
||
public record Item( | ||
ItemType type, | ||
ResourceKey resource, | ||
long stored, | ||
long missing, | ||
long processing, | ||
long scheduled, | ||
long crafting | ||
) { | ||
} | ||
|
||
public enum ItemType { | ||
NORMAL, | ||
MACHINE_DOES_NOT_ACCEPT_RESOURCE, | ||
NO_MACHINE_FOUND, | ||
AUTOCRAFTER_IS_LOCKED | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
.../main/java/com/refinedmods/refinedstorage/api/autocrafting/status/TaskStatusListener.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,14 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting.status; | ||
|
||
import com.refinedmods.refinedstorage.api.autocrafting.TaskId; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.10") | ||
public interface TaskStatusListener { | ||
void taskStatusChanged(TaskStatus status); | ||
|
||
void taskRemoved(TaskId id); | ||
|
||
void taskAdded(TaskStatus status); | ||
} |
20 changes: 20 additions & 0 deletions
20
.../main/java/com/refinedmods/refinedstorage/api/autocrafting/status/TaskStatusProvider.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,20 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting.status; | ||
|
||
import com.refinedmods.refinedstorage.api.autocrafting.TaskId; | ||
|
||
import java.util.List; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.10") | ||
public interface TaskStatusProvider { | ||
List<TaskStatus> getStatuses(); | ||
|
||
void addListener(TaskStatusListener listener); | ||
|
||
void removeListener(TaskStatusListener listener); | ||
|
||
void cancel(TaskId taskId); | ||
|
||
void cancelAll(); | ||
} |
7 changes: 7 additions & 0 deletions
7
...pi/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/status/package-info.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,7 @@ | ||
@ParametersAreNonnullByDefault | ||
@FieldsAndMethodsAreNonnullByDefault | ||
package com.refinedmods.refinedstorage.api.autocrafting.status; | ||
|
||
import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; |
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
35 changes: 35 additions & 0 deletions
35
.../src/test/java/com/refinedmods/refinedstorage/api/autocrafting/status/TaskStatusTest.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,35 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting.status; | ||
|
||
import com.refinedmods.refinedstorage.api.autocrafting.ResourceFixtures; | ||
import com.refinedmods.refinedstorage.api.autocrafting.TaskId; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class TaskStatusTest { | ||
@Test | ||
void dummyTest() { | ||
new TaskStatus( | ||
new TaskStatus.TaskInfo( | ||
new TaskId(UUID.randomUUID()), | ||
ResourceFixtures.A, | ||
0, | ||
0 | ||
), | ||
0.69F, | ||
List.of( | ||
new TaskStatus.Item( | ||
TaskStatus.ItemType.NORMAL, | ||
ResourceFixtures.A, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0 | ||
) | ||
) | ||
); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...pi/src/test/java/com/refinedmods/refinedstorage/api/autocrafting/status/package-info.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,7 @@ | ||
@ParametersAreNonnullByDefault | ||
@FieldsAndMethodsAreNonnullByDefault | ||
package com.refinedmods.refinedstorage.api.autocrafting.status; | ||
|
||
import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; |
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
110 changes: 110 additions & 0 deletions
110
...ommon/src/generated/resources/assets/refinedstorage/blockstates/autocrafting_monitor.json
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,110 @@ | ||
{ | ||
"variants": { | ||
"active=false,direction=down_east": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"x": 90, | ||
"y": -90 | ||
}, | ||
"active=false,direction=down_north": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"x": 90 | ||
}, | ||
"active=false,direction=down_south": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"x": 90, | ||
"y": 180 | ||
}, | ||
"active=false,direction=down_west": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"x": 90, | ||
"y": 90 | ||
}, | ||
"active=false,direction=east": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"y": 90 | ||
}, | ||
"active=false,direction=north": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive" | ||
}, | ||
"active=false,direction=south": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"y": 180 | ||
}, | ||
"active=false,direction=up_east": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"x": -90, | ||
"y": -90 | ||
}, | ||
"active=false,direction=up_north": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"x": -90, | ||
"y": 180 | ||
}, | ||
"active=false,direction=up_south": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"x": -90 | ||
}, | ||
"active=false,direction=up_west": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"x": -90, | ||
"y": 90 | ||
}, | ||
"active=false,direction=west": { | ||
"model": "refinedstorage:block/autocrafting_monitor/inactive", | ||
"y": 270 | ||
}, | ||
"active=true,direction=down_east": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"x": 90, | ||
"y": -90 | ||
}, | ||
"active=true,direction=down_north": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"x": 90 | ||
}, | ||
"active=true,direction=down_south": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"x": 90, | ||
"y": 180 | ||
}, | ||
"active=true,direction=down_west": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"x": 90, | ||
"y": 90 | ||
}, | ||
"active=true,direction=east": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"y": 90 | ||
}, | ||
"active=true,direction=north": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue" | ||
}, | ||
"active=true,direction=south": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"y": 180 | ||
}, | ||
"active=true,direction=up_east": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"x": -90, | ||
"y": -90 | ||
}, | ||
"active=true,direction=up_north": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"x": -90, | ||
"y": 180 | ||
}, | ||
"active=true,direction=up_south": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"x": -90 | ||
}, | ||
"active=true,direction=up_west": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"x": -90, | ||
"y": 90 | ||
}, | ||
"active=true,direction=west": { | ||
"model": "refinedstorage:block/autocrafting_monitor/light_blue", | ||
"y": 270 | ||
} | ||
} | ||
} |
Oops, something went wrong.