Преглед изворни кода

fixed not working splash / lingering potion recipes

Kajetan Johannes Hammerle пре 7 година
родитељ
комит
2f21fbab48

+ 1 - 1
src/main/java/me/km/KajetansMod.java

@@ -68,7 +68,7 @@ public class KajetansMod
 
     public static final String MODID = "km";
     public static final String NAME = "Kajetans Mod";
-    public static final String VERSION = "0.0.21";
+    public static final String VERSION = "0.0.22";
 
     @Mod.Instance(MODID)
     public static KajetansMod instance;

+ 18 - 3
src/main/java/me/km/items/ModItems.java

@@ -31,8 +31,10 @@ import net.minecraft.inventory.EntityEquipmentSlot;
 import net.minecraft.item.EnumDyeColor;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemArmor.ArmorMaterial;
+import net.minecraft.item.ItemPotion;
 import net.minecraft.item.ItemStack;
 import net.minecraft.potion.PotionEffect;
+import net.minecraft.potion.PotionHelper;
 import net.minecraftforge.common.util.EnumHelper;
 import net.minecraftforge.registries.IForgeRegistry;
 
@@ -424,9 +426,22 @@ public class ModItems
             {
                 System.out.println("DOING EVIL SHIT");
             }
-            register(r, Items.POTIONITEM, new ItemNoGlintPotion());
-            register(r, Items.SPLASH_POTION, new ItemNoGlintSplashPotion());
-            register(r, Items.LINGERING_POTION, new ItemNoGlintLingeringPotion());
+            ItemPotion potion = new ItemNoGlintPotion();
+            register(r, Items.POTIONITEM, potion);
+             
+            ItemPotion splashPotion = new ItemNoGlintSplashPotion();
+            register(r, Items.SPLASH_POTION, splashPotion);
+            
+            ItemPotion lingeringPotion = new ItemNoGlintLingeringPotion();
+            register(r, Items.LINGERING_POTION, lingeringPotion);
+            
+            PotionHelper.addContainer(potion);
+            PotionHelper.addContainer(splashPotion);
+            PotionHelper.addContainer(lingeringPotion);
+            
+            PotionHelper.addContainerRecipe(potion, Items.GUNPOWDER, Items.SPLASH_POTION);
+            PotionHelper.addContainerRecipe(splashPotion, Items.DRAGON_BREATH, Items.LINGERING_POTION);
+            
             for(int i = 0; i < 10; i++)
             {
                 System.out.println("DONE WITH EVIL SHIT");

+ 3 - 3
src/main/java/me/km/recipes/ModRecipes.java

@@ -61,9 +61,9 @@ public class ModRecipes
     {
         ShapedRecipes recipe = newShapedRecipe(group, pattern, result, chars, stacks);
         recipe.setRegistryName(buildRegistryName(result));
-        System.out.println("Registering " + recipe.getRegistryName());
-        System.out.println(recipe.getIngredients());
-        System.out.println(recipe.getRecipeOutput());
+        //System.out.println("Registering " + recipe.getRegistryName());
+        //System.out.println(recipe.getIngredients());
+        //System.out.println(recipe.getRecipeOutput());
         r.register(recipe);
     }