@SubscribeEvent public void onItemSmelted(ItemSmeltedEvent event) { if (!addItemSmelted.isEmpty()) { hItemSmelted.addAll(addItemSmelted); addItemSmelted.clear(); } for (Iterator<LIHandler> it = hItemSmelted.iterator(); it.hasNext(); ) { LIHandler handler = it.next(); if (handler.isDead()) it.remove(); else handler.trigger(event); } }
protected void onCrafting(ItemStack par1ItemStack){ par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); if (!this.thePlayer.worldObj.isRemote){ int i = this.field_75228_b; float f = GelExtractorRecipes.smelting().getExperience(par1ItemStack); int j; if (f == 0.0F){ i = 0; } else if (f < 1.0F){ j = MathHelper.floor_float((float)i * f); if (j < MathHelper.ceiling_float_int((float)i * f) && (float)Math.random() < (float)i * f - (float)j){ ++j; } i = j; } while (i > 0){ j = EntityXPOrb.getXPSplit(i); i -= j; this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, j)); } } this.field_75228_b = 0; ItemSmeltedEvent itemSmelted = new ItemSmeltedEvent(thePlayer, par1ItemStack); soul_forest.craftHandler.onSmelting(itemSmelted); if (par1ItemStack.equals(SoulItems.GelPotFilled.get())){ // this.thePlayer.addStat(InitAchievements.firstGem, 1); } }
protected void onCrafting(ItemStack par1ItemStack) { par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); if (!this.thePlayer.worldObj.isRemote) { int i = this.field_75228_b; float f = GemcutterRecipes.smelting().getExperience(par1ItemStack); int j; if (f == 0.0F) { i = 0; } else if (f < 1.0F) { j = MathHelper.floor_float((float)i * f); if (j < MathHelper.ceiling_float_int((float)i * f) && (float)Math.random() < (float)i * f - (float)j) { ++j; } i = j; } while (i > 0) { j = EntityXPOrb.getXPSplit(i); i -= j; this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, j)); } } this.field_75228_b = 0; ItemSmeltedEvent itemSmelted = new ItemSmeltedEvent(thePlayer, par1ItemStack); soul_forest.craftHandler.onSmelting(itemSmelted); }
@SubscribeEvent public void onSmelting(ItemSmeltedEvent event){ String smeltedItem = event.smelting.getItem().getUnlocalizedName(); if (smeltedItem.equals(SoulItems.SteelIngot.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.CobaltIngot.get().getUnlocalizedName())){ event.player.addStat(InitAchievements.getSteelOrCobaltIngot, 1); } if (smeltedItem.equals(SoulItems.AmazoniteGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.AmethystGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.AquamarineGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.BlackdiamondGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.CitrineGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.JadeGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.JetGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.LilaGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.OlivineGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.OnyxGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.OpalGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.ScarletiteGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.TitaniumGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.TopazGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.TurquoiseGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.VioletGem.get().getUnlocalizedName()) || smeltedItem.equals(SoulItems.WhiteopalGem.get().getUnlocalizedName())){ event.player.addStat(InitAchievements.firstGem, 1); } }
@SubscribeEvent public void smelting(ItemSmeltedEvent event) { if(event.smelting.getItem() == TechnicalItem.CopperIngot) { event.player.addStat(TechnicalAchievement.CopperIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.ManganeseIngot) { event.player.addStat(TechnicalAchievement.ManganeseIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.MagnesiumIngot) { event.player.addStat(TechnicalAchievement.MagnesiumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.SilverIngot) { event.player.addStat(TechnicalAchievement.SilverIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.NiobiumIngot) { event.player.addStat(TechnicalAchievement.NiobiumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.TantalumIngot) { event.player.addStat(TechnicalAchievement.TantalumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.TungstenIngot) { event.player.addStat(TechnicalAchievement.TungstenIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.ChromiumIngot) { event.player.addStat(TechnicalAchievement.ChromiumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.UraniumDioxideIngot) { event.player.addStat(TechnicalAchievement.UraniumDioxideIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.TinIngot) { event.player.addStat(TechnicalAchievement.TinIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.CobaltIngot) { event.player.addStat(TechnicalAchievement.CobaltIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.LeadIngot) { event.player.addStat(TechnicalAchievement.LeadIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.MolybdenumIngot) { event.player.addStat(TechnicalAchievement.MolybdenumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.NickelIngot) { event.player.addStat(TechnicalAchievement.NickelIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.ZincIngot) { event.player.addStat(TechnicalAchievement.ZincIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.BariumIngot) { event.player.addStat(TechnicalAchievement.BariumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.AluminiumIngot) { event.player.addStat(TechnicalAchievement.AluminiumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.TitaniumIngot) { event.player.addStat(TechnicalAchievement.TitaniumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.BerylliumIngot) { event.player.addStat(TechnicalAchievement.BerylliumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.PlatinumIngot) { event.player.addStat(TechnicalAchievement.PlatinumIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.IronIngot) { event.player.addStat(TechnicalAchievement.IronIngot, 1); return; } else if(event.smelting.getItem() == TechnicalItem.RedstoneIngot) { event.player.addStat(TechnicalAchievement.RedstoneIngot, 1); return; } }
@SubscribeEvent public void itemSmelting(ItemSmeltedEvent eventSmelted) { if(eventSmelted.smelting.getItem() == RoadStuffItems.itemBitumen) // Need to find how to get metadata here eventSmelted.player.triggerAchievement(RoadStuffAchievements.smeltBitumen); }
@SubscribeEvent public void onSmelted(ItemSmeltedEvent smelt) { if(smelt.smelting.getItem() == Item.getItemFromBlock(CCMain.CompactGlass)) smelt.player.addStat(CCMain.achievements.compactGlassAchieve, 1); }
protected void onCrafting(ItemStack par1ItemStack) { par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); if (!this.thePlayer.worldObj.isRemote) { int i = this.field_75228_b; float f = GelExtractorRecipes.smelting().getExperience(par1ItemStack); int j; if (f == 0.0F) { i = 0; } else if (f < 1.0F) { j = MathHelper.floor_float((float)i * f); if (j < MathHelper.ceiling_float_int((float)i * f) && (float)Math.random() < (float)i * f - (float)j) { ++j; } i = j; } while (i > 0) { j = EntityXPOrb.getXPSplit(i); i -= j; this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, j)); } } this.field_75228_b = 0; ItemSmeltedEvent itemSmelted = new ItemSmeltedEvent(thePlayer, par1ItemStack); soul_forest.craftHandler.onSmelting(itemSmelted); if (par1ItemStack.equals(SoulItems.GelPotFilled.get())) { // this.thePlayer.addStat(InitAchievements.firstGem, 1); } }