Fixed custom potion effects so they could be applied server-sided

This commit is contained in:
WayofTime 2016-04-04 13:35:10 -04:00
parent fa6c57091b
commit 0755202a35
2 changed files with 18 additions and 8 deletions

View file

@ -7,6 +7,7 @@ Version 2.0.0-31
- Soft Fall decreases all fall damage, up to 100% at level 5. - Soft Fall decreases all fall damage, up to 100% at level 5.
- Added increase in speed for Routing nodes inside of a chunk with Demon Aura - Added increase in speed for Routing nodes inside of a chunk with Demon Aura
- Fixed OutOfBoundsException in the Sentient Sword when you didn't have enough Will. - Fixed OutOfBoundsException in the Sentient Sword when you didn't have enough Will.
- Fixed custom potion effects so they could be applied server-sided
------------------------------------------------------ ------------------------------------------------------
Version 2.0.0-30 Version 2.0.0-30

View file

@ -1,10 +1,10 @@
package WayofTime.bloodmagic.registry; package WayofTime.bloodmagic.registry;
import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
import WayofTime.bloodmagic.api.util.helper.PlayerSacrificeHelper; import WayofTime.bloodmagic.api.util.helper.PlayerSacrificeHelper;
import WayofTime.bloodmagic.potion.PotionBloodMagic; import WayofTime.bloodmagic.potion.PotionBloodMagic;
import WayofTime.bloodmagic.potion.PotionEventHandlers; import WayofTime.bloodmagic.potion.PotionEventHandlers;
import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
public class ModPotions public class ModPotions
{ {
@ -28,17 +28,26 @@ public class ModPotions
// drowning = new PotionBloodMagic("Drowning", new // drowning = new PotionBloodMagic("Drowning", new
// ResourceLocation(resourceLocation + // ResourceLocation(resourceLocation +
// drowning.getName().toLowerCase()), true, 0, 0, 0); // drowning.getName().toLowerCase()), true, 0, 0, 0);
boost = new PotionBloodMagic("Boost", new ResourceLocation("boost") boost = registerPotion("Boost", new ResourceLocation("boost"), false, 0xFFFFFF, 0, 0);
// new ResourceLocation(resourceLocation + // new ResourceLocation(resourceLocation +
// boost.getName().toLowerCase()) // boost.getName().toLowerCase())
, false, 0, 0, 0);
whirlwind = new PotionBloodMagic("Whirlwind", new ResourceLocation("whirlwind"), false, 0, 0, 0); whirlwind = registerPotion("Whirlwind", new ResourceLocation("whirlwind"), false, 0, 0, 0);
planarBinding = new PotionBloodMagic("Planar Binding", new ResourceLocation("planarBinding"), false, 0, 0, 0); planarBinding = registerPotion("Planar Binding", new ResourceLocation("planarBinding"), false, 0, 0, 0);
soulSnare = new PotionBloodMagic("Soul Snare", new ResourceLocation("soulSnare"), false, 0xFFFFFF, 0, 0); soulSnare = registerPotion("Soul Snare", new ResourceLocation("soulSnare"), false, 0xFFFFFF, 0, 0);
soulFray = new PotionBloodMagic("Soul Fray", new ResourceLocation("soulFray"), true, 0xFFFFFF, 0, 0); soulFray = registerPotion("Soul Fray", new ResourceLocation("soulFray"), true, 0xFFFFFF, 0, 0);
PlayerSacrificeHelper.soulFrayId = soulFray; PlayerSacrificeHelper.soulFrayId = soulFray;
// heavyHeart = new PotionBloodMagic("Heavy Heart", new // heavyHeart = new PotionBloodMagic("Heavy Heart", new
// ResourceLocation(resourceLocation + // ResourceLocation(resourceLocation +
// heavyHeart.getName().toLowerCase()), true, 0, 0, 0); // heavyHeart.getName().toLowerCase()), true, 0, 0, 0);
} }
protected static Potion registerPotion(String name, ResourceLocation location, boolean badEffect, int potionColour, int x, int y)
{
Potion potion = new PotionBloodMagic(name, location, badEffect, potionColour, x, y);
Potion.potionRegistry.register(-1, location, potion);
return potion;
}
} }