NaturesAura/src/main/java/de/ellpeck/naturesaura/potion/PotionImpl.java

59 lines
1.6 KiB
Java
Raw Normal View History

2018-11-29 17:58:47 +01:00
package de.ellpeck.naturesaura.potion;
import de.ellpeck.naturesaura.NaturesAura;
import de.ellpeck.naturesaura.reg.IModItem;
import de.ellpeck.naturesaura.reg.ModRegistry;
import net.minecraft.client.Minecraft;
2019-10-20 22:30:49 +02:00
import net.minecraft.potion.Effect;
2018-11-29 17:58:47 +01:00
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
2019-10-20 22:30:49 +02:00
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
2018-11-29 17:58:47 +01:00
2019-10-20 22:30:49 +02:00
public class PotionImpl extends Effect implements IModItem {
2018-11-29 17:58:47 +01:00
private static final ResourceLocation TEXTURE = new ResourceLocation(NaturesAura.MOD_ID, "textures/gui/potions.png");
protected final String baseName;
protected PotionImpl(String baseName, boolean isBadEffectIn, int liquidColorIn) {
super(isBadEffectIn, liquidColorIn);
this.baseName = baseName;
ModRegistry.add(this);
}
@Override
2019-10-20 22:30:49 +02:00
public Effect setIconIndex(int x, int y) {
2018-11-29 17:58:47 +01:00
return super.setIconIndex(x, y);
}
@Override
2019-10-20 22:30:49 +02:00
@OnlyIn(Dist.CLIENT)
2018-11-29 17:58:47 +01:00
public int getStatusIconIndex() {
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
return super.getStatusIconIndex();
}
@Override
public String getBaseName() {
return this.baseName;
}
@Override
public void onPreInit(FMLPreInitializationEvent event) {
}
@Override
public void onInit(FMLInitializationEvent event) {
}
@Override
public void onPostInit(FMLPostInitializationEvent event) {
}
}