* fixed the calcite recipes

* removed symmetry from padded shaped recipes

* removed unneeded accesswidener

Co-authored-by: ayutac <fly.high.android@gmail.com>
This commit is contained in:
Ayutac 2022-11-20 17:49:48 +01:00 committed by GitHub
parent 10468e762e
commit b462109fba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 6 deletions

View file

@ -25,6 +25,7 @@
package reborncore.common.recipes;
import com.google.gson.JsonObject;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeSerializer;
@ -33,6 +34,7 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.World;
import java.util.Map;
@ -59,4 +61,16 @@ public class PaddedShapedRecipe extends ShapedRecipe {
return new PaddedShapedRecipe(identifier, group, width, height, ingredients, output);
}
}
@Override
public boolean matches(CraftingInventory craftingInventory, World world) {
for(int i = 0; i <= craftingInventory.getWidth() - this.getWidth(); ++i) {
for(int j = 0; j <= craftingInventory.getHeight() - this.getHeight(); ++j) {
if (this.matchesPattern(craftingInventory, i, j, false)) {
return true;
}
}
}
return false;
}
}

View file

@ -22,4 +22,4 @@ accessible field net/minecraft/block/FluidBlock fluid Lnet/minecraft
accessible method net/minecraft/world/gen/foliage/FoliagePlacerType register (Ljava/lang/String;Lcom/mojang/serialization/Codec;)Lnet/minecraft/world/gen/foliage/FoliagePlacerType;
accessible method net/minecraft/recipe/RecipeManager getAllOfType (Lnet/minecraft/recipe/RecipeType;)Ljava/util/Map;
accessible field net/minecraft/screen/ScreenHandler listeners Ljava/util/List;
accessible field net/minecraft/entity/LivingEntity jumping Z
accessible method net/minecraft/recipe/ShapedRecipe matchesPattern (Lnet/minecraft/inventory/CraftingInventory;IIZ)Z

View file

@ -7,7 +7,7 @@
],
"key": {
"C": {
"tag": "c:calcium_dusts"
"tag": "c:calcite_dusts"
},
"U": {
"item": "techreborn:uu_matter"

View file

@ -7,7 +7,7 @@
],
"key": {
"C": {
"tag": "c:calcium_dusts"
"tag": "c:calcite_dusts"
},
"U": {
"item": "techreborn:uu_matter"

View file

@ -7,7 +7,7 @@
],
"key": {
"C": {
"tag": "c:calcium_dusts"
"tag": "c:calcite_dusts"
},
"U": {
"item": "techreborn:uu_matter"

View file

@ -7,7 +7,7 @@
],
"key": {
"C": {
"tag": "c:calcium_dusts"
"tag": "c:calcite_dusts"
},
"U": {
"item": "techreborn:uu_matter"

View file

@ -22,6 +22,7 @@ accessible field net/minecraft/block/FluidBlock fluid Lnet/minecraft
accessible method net/minecraft/world/gen/foliage/FoliagePlacerType register (Ljava/lang/String;Lcom/mojang/serialization/Codec;)Lnet/minecraft/world/gen/foliage/FoliagePlacerType;
accessible method net/minecraft/recipe/RecipeManager getAllOfType (Lnet/minecraft/recipe/RecipeType;)Ljava/util/Map;
accessible field net/minecraft/screen/ScreenHandler listeners Ljava/util/List;
accessible field net/minecraft/entity/LivingEntity jumping Z
accessible method net/minecraft/recipe/ShapedRecipe matchesPattern (Lnet/minecraft/inventory/CraftingInventory;IIZ)Z
# DO NOT EDIT THIS FILE, edit the RebornCore AW, it will automatically be coped to this one.