diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-08-17 17:05:59 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-08-17 17:05:59 +0800 |
| commit | 5c91a6654e697fdadde79508f3ef994936e4b952 (patch) | |
| tree | c2d47385603b038dedcba893a7242bc4c04bb5b3 /src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java | |
| parent | dab398882cd64f6152078f59ba768e4ffd437ba3 (diff) | |
| download | RoughlyEnoughItems-5c91a6654e697fdadde79508f3ef994936e4b952.tar.gz RoughlyEnoughItems-5c91a6654e697fdadde79508f3ef994936e4b952.tar.bz2 RoughlyEnoughItems-5c91a6654e697fdadde79508f3ef994936e4b952.zip | |
Finishing the auto crafting API
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java b/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java index c0eaa26e6..44bc4f8d2 100644 --- a/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java +++ b/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java @@ -7,8 +7,8 @@ package me.shedaniel.rei.api; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; -import me.shedaniel.rei.impl.ScreenHelper; import me.shedaniel.rei.gui.ContainerScreenOverlay; +import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen; import net.minecraft.container.Container; @@ -33,13 +33,23 @@ public interface AutoTransferHandler { } static Result createFailed(String errorKey) { - return new ResultImpl(errorKey, new IntArrayList()); + return new ResultImpl(errorKey, new IntArrayList(), 1744764928); + } + + static Result createFailedCustomButtonColor(String errorKey, int color) { + return new ResultImpl(errorKey, new IntArrayList(), color); } static Result createFailed(String errorKey, IntList redSlots) { - return new ResultImpl(errorKey, redSlots); + return new ResultImpl(errorKey, redSlots, 1744764928); + } + + static Result createFailedCustomButtonColor(String errorKey, IntList redSlots, int color) { + return new ResultImpl(errorKey, redSlots, color); } + int getColor(); + boolean isSuccessful(); boolean isApplicable(); @@ -75,6 +85,7 @@ public interface AutoTransferHandler { private boolean successful, applicable; private String errorKey; private IntList integers = new IntArrayList(); + private int color; private ResultImpl() { this.successful = true; @@ -86,12 +97,18 @@ public interface AutoTransferHandler { this.applicable = applicable; } - public ResultImpl(String errorKey, IntList integers) { + public ResultImpl(String errorKey, IntList integers, int color) { this.successful = false; this.applicable = true; this.errorKey = errorKey; if (integers != null) this.integers = integers; + this.color = color; + } + + @Override + public int getColor() { + return color; } @Override |
