-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f0897c
commit 8b656f1
Showing
32 changed files
with
465 additions
and
57 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...ng-api/src/main/java/com/refinedmods/refinedstorage/api/autocrafting/CraftingPreview.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,6 @@ | ||
package com.refinedmods.refinedstorage.api.autocrafting; | ||
|
||
import com.refinedmods.refinedstorage.api.resource.list.ResourceList; | ||
|
||
public record CraftingPreview(ResourceList missing, ResourceList toTake, ResourceList toCraft) { | ||
} |
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
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
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
6 changes: 6 additions & 0 deletions
6
...main/java/com/refinedmods/refinedstorage/common/autocrafting/preview/CraftingPreview.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,6 @@ | ||
package com.refinedmods.refinedstorage.common.autocrafting.preview; | ||
|
||
import java.util.List; | ||
|
||
record CraftingPreview(boolean missing, List<CraftingPreviewItem> items) { | ||
} |
45 changes: 45 additions & 0 deletions
45
.../refinedmods/refinedstorage/common/autocrafting/preview/CraftingPreviewContainerMenu.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,45 @@ | ||
package com.refinedmods.refinedstorage.common.autocrafting.preview; | ||
|
||
import com.refinedmods.refinedstorage.api.resource.ResourceAmount; | ||
import com.refinedmods.refinedstorage.api.resource.ResourceKey; | ||
import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; | ||
import com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu; | ||
import com.refinedmods.refinedstorage.common.support.containermenu.DisabledResourceSlot; | ||
import com.refinedmods.refinedstorage.common.support.containermenu.ResourceSlotType; | ||
import com.refinedmods.refinedstorage.common.support.resource.ResourceContainerImpl; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import javax.annotation.Nullable; | ||
|
||
import net.minecraft.network.chat.Component; | ||
|
||
class CraftingPreviewContainerMenu extends AbstractResourceContainerMenu { | ||
@Nullable | ||
private CraftingPreview preview; | ||
|
||
CraftingPreviewContainerMenu(final ResourceKey resource) { | ||
super(null, 0); | ||
final ResourceContainer resourceContainer = ResourceContainerImpl.createForFilter(1); | ||
resourceContainer.set(0, new ResourceAmount(resource, 1)); | ||
addSlot(new DisabledResourceSlot( | ||
resourceContainer, | ||
0, | ||
Component.empty(), | ||
157, | ||
48, | ||
ResourceSlotType.FILTER | ||
)); | ||
|
||
final List<CraftingPreviewItem> items = new ArrayList<>(); | ||
for (int i = 0; i < 31; ++i) { | ||
items.add(new CraftingPreviewItem(resource, i, i % 2 == 0 ? 999 : 0, i % 2 == 0 ? 0 : 1000)); | ||
} | ||
preview = new CraftingPreview(true, items); | ||
} | ||
|
||
@Nullable | ||
public CraftingPreview getPreview() { | ||
return preview; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
.../java/com/refinedmods/refinedstorage/common/autocrafting/preview/CraftingPreviewItem.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,6 @@ | ||
package com.refinedmods.refinedstorage.common.autocrafting.preview; | ||
|
||
import com.refinedmods.refinedstorage.api.resource.ResourceKey; | ||
|
||
record CraftingPreviewItem(ResourceKey resource, long available, long missing, long toCraft) { | ||
} |
Oops, something went wrong.