Browse Source

Change ReturnToScreen to ReturningToScreen

Signed-off-by: shedaniel <daniel@shedaniel.me>
shedaniel 5 years ago
parent
commit
56b8e97b30

+ 7 - 7
src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java

@@ -48,7 +48,7 @@ public interface AutoTransferHandler {
             return new ResultImpl();
             return new ResultImpl();
         }
         }
 
 
-        static Result createSuccessfulReturnToScreen() {
+        static Result createSuccessfulReturningToScreen() {
             return new ResultImpl(true, true, true);
             return new ResultImpl(true, true, true);
         }
         }
 
 
@@ -80,7 +80,7 @@ public interface AutoTransferHandler {
          * Applicable if {@link #isSuccessful()} is true. Will return
          * Applicable if {@link #isSuccessful()} is true. Will return
          * to the previous screen rather than staying open.
          * to the previous screen rather than staying open.
          */
          */
-        boolean isReturnToScreen();
+        boolean isReturningToScreen();
         
         
         boolean isApplicable();
         boolean isApplicable();
         
         
@@ -121,7 +121,7 @@ public interface AutoTransferHandler {
     
     
     @ApiStatus.Internal
     @ApiStatus.Internal
     final class ResultImpl implements Result {
     final class ResultImpl implements Result {
-        private boolean successful, applicable, returnToScreen;
+        private boolean successful, applicable, returningToScreen;
         private String errorKey;
         private String errorKey;
         private IntList integers = new IntArrayList();
         private IntList integers = new IntArrayList();
         private int color;
         private int color;
@@ -134,10 +134,10 @@ public interface AutoTransferHandler {
             this(false, applicable, false);
             this(false, applicable, false);
         }
         }
 
 
-        public ResultImpl(boolean successful, boolean applicable, boolean returnToScreen) {
+        public ResultImpl(boolean successful, boolean applicable, boolean returningToScreen) {
             this.successful = successful;
             this.successful = successful;
             this.applicable = applicable;
             this.applicable = applicable;
-            this.returnToScreen = returnToScreen;
+            this.returningToScreen = returningToScreen;
         }
         }
 
 
         public ResultImpl(String errorKey, IntList integers, int color) {
         public ResultImpl(String errorKey, IntList integers, int color) {
@@ -165,8 +165,8 @@ public interface AutoTransferHandler {
         }
         }
 
 
         @Override
         @Override
-        public boolean isReturnToScreen() {
-            return returnToScreen;
+        public boolean isReturningToScreen() {
+            return returningToScreen;
         }
         }
 
 
         @Override
         @Override

+ 4 - 1
src/main/java/me/shedaniel/rei/impl/InternalWidgets.java

@@ -35,6 +35,8 @@ import me.shedaniel.rei.gui.widget.LateRenderable;
 import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.gui.widget.Widget;
 import me.shedaniel.rei.gui.widget.WidgetWithBounds;
 import me.shedaniel.rei.gui.widget.WidgetWithBounds;
 import me.shedaniel.rei.utils.CollectionUtils;
 import me.shedaniel.rei.utils.CollectionUtils;
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.gui.Element;
 import net.minecraft.client.gui.screen.ingame.ContainerScreen;
 import net.minecraft.client.gui.screen.ingame.ContainerScreen;
@@ -51,6 +53,7 @@ import java.util.Objects;
 import java.util.function.Supplier;
 import java.util.function.Supplier;
 
 
 @ApiStatus.Internal
 @ApiStatus.Internal
+@Environment(EnvType.CLIENT)
 public final class InternalWidgets {
 public final class InternalWidgets {
     private InternalWidgets() {}
     private InternalWidgets() {}
     
     
@@ -66,7 +69,7 @@ public final class InternalWidgets {
                         try {
                         try {
                             AutoTransferHandler.Result result = autoTransferHandler.handle(context);
                             AutoTransferHandler.Result result = autoTransferHandler.handle(context);
                             if (result.isSuccessful()) {
                             if (result.isSuccessful()) {
-                                if (result.isReturnToScreen()) {
+                                if (result.isReturningToScreen()) {
                                     break; // Same as failing, but doesn't ask other handlers
                                     break; // Same as failing, but doesn't ask other handlers
                                 }
                                 }
                                 return;
                                 return;