Package org.spout.vanilla.event.material

Examples of org.spout.vanilla.event.material.FurnaceSmeltEvent


    if (!inventory.hasIngredient()) {
      return;
    }
    ItemStack ingredient = inventory.getIngredient();
    ItemStack result = ((TimedCraftable) ingredient.getMaterial()).getResult();
    FurnaceSmeltEvent event = VanillaPlugin.getInstance().getEngine().getEventManager().callEvent(new FurnaceSmeltEvent(this, new MaterialCause(ingredient.getMaterial(), this.getBlock()), ingredient, result));
    if (!event.isCancelled()) {
      if (inventory.getOutput() == null) {
        inventory.setOutput(event.getResult());
      } else {
        result = event.getResult();
        if (inventory.getOutput().getMaterial().getId() != result.getMaterial().getId()) {
          throw new UnsupportedOperationException("Smelt result must be the same material as the output slot.");
        }
        inventory.addAmount(FurnaceInventory.OUTPUT_SLOT, result.getAmount());
      }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.event.material.FurnaceSmeltEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.