aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-08-08 14:15:36 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-08-08 14:15:36 +0800
commit6464acb0a7fe98ab30f9419e6aa95bdd1e92bc74 (patch)
tree5934398a48c318ea300e4a33e04085da10298a9d /src/main
parent3a158fb836655cbf44a5a1982222bf50d4e0c42a (diff)
downloadRoughlyEnoughItems-6464acb0a7fe98ab30f9419e6aa95bdd1e92bc74.tar.gz
RoughlyEnoughItems-6464acb0a7fe98ab30f9419e6aa95bdd1e92bc74.tar.bz2
RoughlyEnoughItems-6464acb0a7fe98ab30f9419e6aa95bdd1e92bc74.zip
We delete useless stuff
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java2
-rw-r--r--src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java3
-rw-r--r--src/main/java/me/shedaniel/rei/server/RecipeGridAligner.java61
-rwxr-xr-xsrc/main/resources/assets/roughlyenoughitems/lang/en_us.json1
4 files changed, 4 insertions, 63 deletions
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java
index 18551ca81..2001ec5f2 100644
--- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java
+++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java
@@ -90,6 +90,8 @@ public class RoughlyEnoughItemsNetwork implements ModInitializer {
if (ServerSidePacketRegistry.INSTANCE.canPlayerReceive(player, NOT_ENOUGH_ITEMS_PACKET)) {
ServerSidePacketRegistry.INSTANCE.sendToPlayer(player, NOT_ENOUGH_ITEMS_PACKET, buf);
}
+ } catch (IllegalStateException e) {
+ player.sendMessage(new TranslatableText(e.getMessage()).formatted(Formatting.RED));
}
} catch (Exception e) {
e.printStackTrace();
diff --git a/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java b/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java
index 530d884d1..80e8ee8af 100644
--- a/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java
+++ b/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java
@@ -153,10 +153,9 @@ public class InputSlotCrafter<C extends Inventory> {
ItemStack itemStack_2 = itemStack_1.copy();
itemStack_2.setCount(1);
if (!this.inventory.insertStack(int_2, itemStack_2)) {
- throw new IllegalStateException("Can't find any space for item in the inventory");
+ throw new IllegalStateException("rei.rei.no.slot.in.inv");
}
}
-
}
}
diff --git a/src/main/java/me/shedaniel/rei/server/RecipeGridAligner.java b/src/main/java/me/shedaniel/rei/server/RecipeGridAligner.java
deleted file mode 100644
index 5ac9bbab8..000000000
--- a/src/main/java/me/shedaniel/rei/server/RecipeGridAligner.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package me.shedaniel.rei.server;
-
-import net.minecraft.recipe.Recipe;
-import net.minecraft.recipe.ShapedRecipe;
-import net.minecraft.util.math.MathHelper;
-
-import java.util.Iterator;
-
-public interface RecipeGridAligner<T> {
- default void alignRecipeToGrid(int craftingGridWidth, int craftingGridHeight, int resultSlotIndex, Recipe<?> recipe, Iterator<T> iterator_1, int int_4) {
- int recipeWidth = craftingGridWidth;
- int recipeHeight = craftingGridHeight;
- if (recipe instanceof ShapedRecipe) {
- ShapedRecipe shapedRecipe = (ShapedRecipe) recipe;
- recipeWidth = shapedRecipe.getWidth();
- recipeHeight = shapedRecipe.getHeight();
- }
-
- int slotId = 0;
-
- for (int int_8 = 0; int_8 < craftingGridHeight; ++int_8) {
- if (slotId == resultSlotIndex) {
- ++slotId;
- }
-
- boolean boolean_1 = (float) recipeHeight < (float) craftingGridHeight / 2.0F;
- int int_9 = MathHelper.floor((float) craftingGridHeight / 2.0F - (float) recipeHeight / 2.0F);
- if (boolean_1 && int_9 > int_8) {
- slotId += craftingGridWidth;
- ++int_8;
- }
-
- for (int int_10 = 0; int_10 < craftingGridWidth; ++int_10) {
- if (!iterator_1.hasNext()) {
- return;
- }
-
- boolean_1 = (float) recipeWidth < (float) craftingGridWidth / 2.0F;
- int_9 = MathHelper.floor((float) craftingGridWidth / 2.0F - (float) recipeWidth / 2.0F);
- int int_11 = recipeWidth;
- boolean boolean_2 = int_10 < recipeWidth;
- if (boolean_1) {
- int_11 = int_9 + recipeWidth;
- boolean_2 = int_9 <= int_10 && int_10 < int_9 + recipeWidth;
- }
-
- if (boolean_2) {
- this.acceptAlignedInput(iterator_1, slotId, int_4, int_8, int_10);
- } else if (int_11 == int_10) {
- slotId += craftingGridWidth - int_10;
- break;
- }
-
- ++slotId;
- }
- }
-
- }
-
- void acceptAlignedInput(Iterator<T> var1, int var2, int var3, int var4, int var5);
-} \ No newline at end of file
diff --git a/src/main/resources/assets/roughlyenoughitems/lang/en_us.json b/src/main/resources/assets/roughlyenoughitems/lang/en_us.json
index 7100cb502..85cab40a7 100755
--- a/src/main/resources/assets/roughlyenoughitems/lang/en_us.json
+++ b/src/main/resources/assets/roughlyenoughitems/lang/en_us.json
@@ -50,6 +50,7 @@
"error.rei.transfer.too_small": "Unable to move items to a 2x2 grid.",
"error.rei.not.on.server": "REI is not on the server.",
"error.rei.not.enough.materials": "Not Enough Materials.",
+ "rei.rei.no.slot.in.inv": "Can't find any space for item in the inventory",
"text.rei.config.craftable_only": "Craftable Filter: ",
"text.rei.config.clickable_recipe_arrows": "Clickable Recipe Arrows: ",
"text.rei.config.text.true": "Enabled",