Colors for flasks
Blends effect colors Needs a new texture.
This commit is contained in:
parent
8ada331f61
commit
1b83510e1d
|
@ -1,6 +1,7 @@
|
||||||
package WayofTime.bloodmagic.proxy;
|
package WayofTime.bloodmagic.proxy;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -10,6 +11,8 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.potion.PotionUtils;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||||
|
@ -118,6 +121,21 @@ public class ClientProxy extends CommonProxy
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}, ModItems.sigilHolding);
|
}, ModItems.sigilHolding);
|
||||||
|
Minecraft.getMinecraft().getItemColors().registerItemColorHandler(new IItemColor()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public int getColorFromItemstack(ItemStack stack, int tintIndex)
|
||||||
|
{
|
||||||
|
if (tintIndex != 1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
List<PotionEffect> effects = PotionUtils.getEffectsFromStack(stack);
|
||||||
|
if (effects.isEmpty())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return PotionUtils.getPotionColorFromEffectList(effects);
|
||||||
|
}
|
||||||
|
}, ModItems.potionFlask);
|
||||||
|
|
||||||
addElytraLayer();
|
addElytraLayer();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
"type": {
|
"type": {
|
||||||
"normal": {
|
"normal": {
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "bloodmagic:items/PotionFlask"
|
"layer0": "bloodmagic:items/PotionFlask_outline",
|
||||||
|
"layer1": "bloodmagic:items/PotionFlask_overlay"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Loading…
Reference in a new issue