-
-
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
…terface Exposed fluid interface
- Loading branch information
Showing
44 changed files
with
592 additions
and
185 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
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
69 changes: 69 additions & 0 deletions
69
...rc/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceContainer.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,69 @@ | ||
package com.refinedmods.refinedstorage2.platform.api.resource; | ||
|
||
import com.refinedmods.refinedstorage2.api.core.Action; | ||
import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; | ||
import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
import javax.annotation.Nullable; | ||
|
||
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.world.Container; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.apiguardian.api.API; | ||
|
||
/** | ||
* Represents a {@link Container} that can hold any resource type. | ||
*/ | ||
@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.13") | ||
public interface ResourceContainer { | ||
ResourceContainerType getType(); | ||
|
||
void setListener(@Nullable Runnable listener); | ||
|
||
void change(int index, ItemStack stack, boolean tryAlternatives); | ||
|
||
<T> void set(int index, ResourceAmountTemplate<T> resourceAmount); | ||
|
||
long getAmount(int index); | ||
|
||
void grow(int index, long amount); | ||
|
||
void shrink(int index, long amount); | ||
|
||
void setAmount(int index, long amount); | ||
|
||
<T> long getMaxAmount(ResourceAmountTemplate<T> resourceAmount); | ||
|
||
void remove(int index); | ||
|
||
int size(); | ||
|
||
@Nullable | ||
ResourceAmountTemplate<?> get(int index); | ||
|
||
Set<Object> getUniqueTemplates(); | ||
|
||
List<ResourceTemplate<?>> getTemplates(); | ||
|
||
void writeToUpdatePacket(FriendlyByteBuf buf); | ||
|
||
void readFromUpdatePacket(int index, FriendlyByteBuf buf); | ||
|
||
CompoundTag toTag(); | ||
|
||
void fromTag(CompoundTag tag); | ||
|
||
List<ClientTooltipComponent> getHelpTooltip(ItemStack carried); | ||
|
||
Container toItemContainer(); | ||
|
||
<T> long insert(StorageChannelType<T> storageChannelType, T resource, long amount, Action action); | ||
|
||
<T> long extract(T resource, long amount, Action action); | ||
|
||
ResourceContainer copy(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...ernal/resource/ResourceContainerType.java → ...m/api/resource/ResourceContainerType.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
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
Oops, something went wrong.