Did some work on the Crushing ritual and made it so that it ignores liquids.

The Lava Ritual now places source blocks when the fluid is flowing.
Added the ability for my potions to (finally) have custom sprites.
This commit is contained in:
WayofTime 2016-07-12 16:57:22 -04:00
parent b79f7127b6
commit acde7ceccd
11 changed files with 163 additions and 25 deletions

View file

@ -1,14 +1,65 @@
package WayofTime.bloodmagic.potion;
import WayofTime.bloodmagic.api.Constants;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class PotionBloodMagic extends Potion
{
public static ResourceLocation texture = new ResourceLocation(Constants.Mod.MODID, "textures/misc/potions.png");
public PotionBloodMagic(String name, ResourceLocation texture, boolean badEffect, int potionColor, int iconIndexX, int iconIndexY)
{
super(badEffect, potionColor);
this.setPotionName(name);
this.setIconIndex(iconIndexX, iconIndexY);
}
@Override
public boolean shouldRenderInvText(PotionEffect effect)
{
return true;
}
public PotionEffect apply(EntityLivingBase entity, int duration)
{
return apply(entity, duration, 0);
}
public PotionEffect apply(EntityLivingBase entity, int duration, int level)
{
PotionEffect effect = new PotionEffect(this, duration, level, false, false);
entity.addPotionEffect(effect);
return effect;
}
public int getLevel(EntityLivingBase entity)
{
PotionEffect effect = entity.getActivePotionEffect(this);
if (effect != null)
{
return effect.getAmplifier();
}
return 0;
}
@Override
public boolean shouldRender(PotionEffect effect)
{
return true;
}
@Override
@SideOnly(Side.CLIENT)
public int getStatusIconIndex()
{
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
return super.getStatusIconIndex();
}
}