@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onBrew(BrewEvent event) { /* WORLD BLACKLIST CHECK */ if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; if (event instanceof FakeBrewEvent) return; Location location = event.getBlock().getLocation(); if (Alchemy.brewingStandMap.containsKey(location)) { Alchemy.brewingStandMap.get(location).finishImmediately(); event.setCancelled(true); } }
@EventHandler public void onBrew(final BrewEvent event) { final String playerID = locations.remove(event.getBlock().getLocation()); if (playerID == null) return; if (checkPotion(event.getContents().getItem(i))) alreadyExistingTemp++;
@EventHandler public void onBrew(BrewEvent e){ Block block = e.getBlock(); if(isEnabled(block.getWorld()) && block.getType().equals(Material.BREWING_STAND)) //Just in case... ((BrewingStand) block.getState()).setFuelLevel(20); }
@Override public void run() { // unfinaling it for modifications boolean brewed = false; int alreadyExistingFinal = alreadyExisting; for (int i = 0; i < 3; i++) { // if there were any potions before, don't count them to // prevent cheating if (checkPotion(event.getContents().getItem(i))) { if (alreadyExistingFinal <= 0 && checkConditions(playerID)) { data.brew(); } alreadyExistingFinal--; brewed = true; } } // check if the objective has been completed if (data.getAmount() >= amount) { completeObjective(playerID); } else if (brewed && notify && data.getAmount() % notifyInterval == 0) { Config.sendMessage(playerID, "potions_to_brew", new String[] { String.valueOf(amount - data.getAmount()) }); } } }.runTask(BetonQuest.getInstance());