I'm having the following problem, i'm trying to create a Witchery like cauldron and i need to check wether multiple Items (saved in a list) are contained in another list.
List<ItemStack> items = new ArrayList<ItemStack>();
for (int i = 0; i < tile.getInventory().getSlots(); i++){
if (tile.getItem().getStackInSlot(i) != new ItemStack(Items.AIR)){
items.add(tile.getItem().getStackInSlot(i));
}
}
if (items.containsAll(recipe.catalysator)) {
// TODO
}
The recipe.catalysator is a list that contains one item and the same item is also in the inventory.
So i'm creating a potion and i register it and i can give me the new effect but the performEffect function doesn't get executed.
My Potion:
@Override
public void performEffect(EntityLivingBase entityLivingBaseIn, int amplifier) {
System.out.println("effect");
}
My ModPotions class for registration:
public static PotionFreeze freeze = new PotionFreeze(true, 0);
public static void register(IForgeRegistry<Potion> registry) {
registry.registerAll(
freeze
);
}
Here it gets called:
@Mod.EventBusSubscriber
public static class RegistrationHandler {
@SubscribeEvent
public static void registerPotions(RegistryEvent.Register<Potion> event) {
System.out.println("Potions registered");
ModPotions.register(event.getRegistry());
}
}
Thanks.
So normally when i position the sprite at 100, 100 its near the middle and if i scale it its almost in the corner.
GL11.glPushMatrix();
GlStateManager.color(1, 1, 1, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(MANA_ICON);
GL11.glScalef(0.06f, 0.06f, 0.06f);
drawTexturedModalRect(100, 100, 0, 0, 256, 256);
GL11.glPopMatrix();
So i'm trying to display a small icon in a GUI (resolution 16x16) on the same size as the hearts of the health bar.
But using the Gl11.scalef() function also scales the infentory gui. What would be the proper way to do this?
GlStateManager.color(1, 1, 1, 1);
mc.getTextureManager().bindTexture(MANA_ICON);
GL11.glScalef(0.1f, 0.1f, 0.1f);
drawTexturedModalRect(30, 30, 0, 0, 256, 256);
Thanks in advance.