GoldenPotato137 / OxygenSystem

Introduce oxygen to Minecraft!
Apache License 2.0
4 stars 4 forks source link

Added a new recipe system for 1.21 recipe changes #12

Open DoubleNico opened 4 months ago

DoubleNico commented 4 months ago

I saw that on 1.21 the recipes changed and now you cannot put Material.AIR as a recipe slot anymore, it will throw this error if you do that java.lang.IllegalArgumentException: Cannot have empty/air choice at com.google.common.base.Preconditions.checkArgument(Preconditions.java:143) ~[guava-32.1.2-jre.jar:?] at org.bukkit.inventory.RecipeChoice$MaterialChoice.<init>(RecipeChoice.java:100) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?] at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:150) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?] at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:124) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?] at OxygenSystem 1.2.1.jar/cn.goldenpotato.oxygensystem.Item.MaskUpgradeT2.GetRecipe(MaskUpgradeT2.java:42) ~[OxygenSystem 1.2.1.jar:?] at OxygenSystem 1.2.1.jar/cn.goldenpotato.oxygensystem.OxygenSystem.AddRecipe(OxygenSystem.java:57) ~[OxygenSystem 1.2.1.jar:?] at OxygenSystem 1.2.1.jar/cn.goldenpotato.oxygensystem.OxygenSystem.onEnable(OxygenSystem.java:44) ~[OxygenSystem 1.2.1.jar:?] To fix it, you just need to put an space(' ' char) at the shape for exemple, old way of shape "ABC", and 'A' is Air, you just replace 'A' with a space, new shape " BC", I only tested this on 1.21 and only that ! To be tested on 1.21 below