Compare commits

..

4 Commits

Author SHA1 Message Date
Electroblob77 43b66df22a Update version number 2019-09-09 00:06:01 +01:00
Electroblob77 b192a431d7 Copy NBT to new stack in mana flask charging recipes, fixes #242 2019-09-09 00:03:38 +01:00
Electroblob77 3be98ab612 Fix JEI log spam about mana flask recharging recipes having empty output
Either JEI shouldn't be erroring or the Forge javadoc is wrong. Either way, it seems to make no difference so let's not bother with it.
2019-09-08 23:43:10 +01:00
Electroblob77 ed950322ff Temporarily disable the spells sound category to stop issue #238 from happening 2019-09-08 23:40:13 +01:00
5 changed files with 17 additions and 16 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
# Credits # Credits
Electroblob's Wizardry Electroblob's Wizardry
Version 4.1.4 Version 4.2.3
For Minecraft 1.12.2 For Minecraft 1.12.2
Designed, coded and textured by Electroblob Designed, coded and textured by Electroblob
+1 -1
View File
@@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = "4.2.2" // There, it matches semver, happy now? version = "4.2.3" // There, it matches semver, happy now?
group= "electroblob.wizardry"// http://maven.apache.org/guides/mini/guide-naming-conventions.html group= "electroblob.wizardry"// http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "ElectroblobsWizardry" archivesBaseName = "ElectroblobsWizardry"
@@ -12,10 +12,10 @@ import electroblob.wizardry.misc.Forfeit;
import electroblob.wizardry.packet.WizardryPacketHandler; import electroblob.wizardry.packet.WizardryPacketHandler;
import electroblob.wizardry.registry.*; import electroblob.wizardry.registry.*;
import electroblob.wizardry.spell.Spell; import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.CustomSoundCategory;
import electroblob.wizardry.util.SpellProperties; import electroblob.wizardry.util.SpellProperties;
import electroblob.wizardry.worldgen.*; import electroblob.wizardry.worldgen.*;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.util.SoundCategory;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
@@ -61,7 +61,7 @@ public class Wizardry {
* 1.x.x represents Minecraft 1.7.x versions, 2.x.x represents Minecraft 1.10.x versions, 3.x.x represents Minecraft * 1.x.x represents Minecraft 1.7.x versions, 2.x.x represents Minecraft 1.10.x versions, 3.x.x represents Minecraft
* 1.11.x versions, and so on. * 1.11.x versions, and so on.
*/ */
public static final String VERSION = "4.2.2"; public static final String VERSION = "4.2.3";
// IDEA: Triggering of inbuilt Forge events in relevant places? // IDEA: Triggering of inbuilt Forge events in relevant places?
// IDEA: Abstract the vanilla particles behind the particle builder // IDEA: Abstract the vanilla particles behind the particle builder
@@ -113,7 +113,8 @@ public class Wizardry {
proxy.registerRenderers(); proxy.registerRenderers();
proxy.registerKeyBindings(); proxy.registerKeyBindings();
WizardrySounds.SPELLS = CustomSoundCategory.add(Wizardry.MODID + "_spells"); // Commented out for 4.2.3 to get rid of the sound bug, reinstate once a fix is found.
WizardrySounds.SPELLS = SoundCategory.PLAYERS;//CustomSoundCategory.add(Wizardry.MODID + "_spells");
WizardryBaublesIntegration.init(); WizardryBaublesIntegration.init();
WizardryAntiqueAtlasIntegration.init(); WizardryAntiqueAtlasIntegration.init();
@@ -15,8 +15,6 @@ import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapelessOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe;
import javax.annotation.Nonnull;
/** /**
* Implements a dynamic crafting recipe for recharging items with mana flasks. * Implements a dynamic crafting recipe for recharging items with mana flasks.
* *
@@ -42,16 +40,17 @@ public class RecipeRechargeWithFlask extends ShapelessOreRecipe {
this.flask = flask; this.flask = flask;
} }
@Nonnull // Commented out for now because JEI spams the log with errors about the recipe having no output
@Override // @Nonnull
public ItemStack getRecipeOutput(){ // @Override
return ItemStack.EMPTY; // According to the javadoc, dynamic recipes are supposed to return an empty stack here // public ItemStack getRecipeOutput(){
} // return ItemStack.EMPTY; // According to the javadoc, dynamic recipes are supposed to return an empty stack here
// }
@Override @Override
public ItemStack getCraftingResult(InventoryCrafting inv){ public ItemStack getCraftingResult(InventoryCrafting inv){
ItemStack result = super.getCraftingResult(inv); ItemStack result = super.getCraftingResult(inv);
rechargeItem(result, inv); rechargeItemAndCopyNBT(result, inv);
return result; return result;
} }
@@ -62,11 +61,12 @@ public class RecipeRechargeWithFlask extends ShapelessOreRecipe {
return super.matches(inv, world); return super.matches(inv, world);
} }
private void rechargeItem(ItemStack toCharge, InventoryCrafting inv){ private void rechargeItemAndCopyNBT(ItemStack toCharge, InventoryCrafting inv){
if(toCharge.getItem() == chargeable){ if(toCharge.getItem() == chargeable){
ItemStack stack = findItemToCharge(inv); ItemStack stack = findItemToCharge(inv);
if(!stack.isEmpty()) chargeable.setMana(toCharge, chargeable.getMana(stack)); if(!stack.isEmpty()) chargeable.setMana(toCharge, chargeable.getMana(stack));
chargeable.rechargeMana(toCharge, flask.size.capacity); chargeable.rechargeMana(toCharge, flask.size.capacity);
toCharge.setTagCompound(stack.getTagCompound()); // Copy NBT to new stack
}else{ }else{
Wizardry.logger.warn("Tried to recharge item {} with mana flask, but it did not match the recipe result {}!", toCharge.getItem(), chargeable); Wizardry.logger.warn("Tried to recharge item {} with mana flask, but it did not match the recipe result {}!", toCharge.getItem(), chargeable);
} }
@@ -95,7 +95,7 @@ public class RecipeRechargeWithFlask extends ShapelessOreRecipe {
if(recipe instanceof RecipeRechargeWithFlask if(recipe instanceof RecipeRechargeWithFlask
&& recipe.matches((InventoryCrafting)event.craftMatrix, event.player.world)){ && recipe.matches((InventoryCrafting)event.craftMatrix, event.player.world)){
// Have to modify the itemstack in the actual event, it cannot be replaced // Have to modify the itemstack in the actual event, it cannot be replaced
((RecipeRechargeWithFlask)recipe).rechargeItem(event.crafting, (InventoryCrafting)event.craftMatrix); ((RecipeRechargeWithFlask)recipe).rechargeItemAndCopyNBT(event.crafting, (InventoryCrafting)event.craftMatrix);
} }
} }
} }
+1 -1
View File
@@ -2,7 +2,7 @@
{ {
"modid" : "ebwizardry", "modid" : "ebwizardry",
"name" : "Electroblob's Wizardry", "name" : "Electroblob's Wizardry",
"version" : "4.2.2", "version" : "4.2.3",
"mcversion" : "1.12.2", "mcversion" : "1.12.2",
"url" : "https://minecraft.curseforge.com/projects/electroblobs-wizardry", "url" : "https://minecraft.curseforge.com/projects/electroblobs-wizardry",
"credits" : "\nDesigned, coded and textured by Electroblob.\nCode contributed by: Corail31, 12foo, Shadows-of-Fire, Tora-B, Avatair, Aeronica.\nTranslators: MadWrist (Spanish, Mexican Spanish), VilagVil & kellixon (Russian), Hahdrim (French), lorrampi (Brazilian Portuguese), ZHENGLOC & dragon-evol (Chinese), shejery & rewi_wire (Korean), Trozuu (Polish).", "credits" : "\nDesigned, coded and textured by Electroblob.\nCode contributed by: Corail31, 12foo, Shadows-of-Fire, Tora-B, Avatair, Aeronica.\nTranslators: MadWrist (Spanish, Mexican Spanish), VilagVil & kellixon (Russian), Hahdrim (French), lorrampi (Brazilian Portuguese), ZHENGLOC & dragon-evol (Chinese), shejery & rewi_wire (Korean), Trozuu (Polish).",