mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Merge pull request #2306 from poma123/patch-1
Made MachineProcessCompleteEvent async
This commit is contained in:
commit
4d1407563f
@ -15,7 +15,7 @@ import javax.annotation.ParametersAreNonnullByDefault;
|
||||
* @author poma123
|
||||
*
|
||||
*/
|
||||
public class MachineProcessCompleteEvent extends Event {
|
||||
public class AsyncMachineProcessCompleteEvent extends Event {
|
||||
|
||||
private static final HandlerList handlerList = new HandlerList();
|
||||
|
||||
@ -23,7 +23,9 @@ public class MachineProcessCompleteEvent extends Event {
|
||||
private final MachineRecipe machineRecipe;
|
||||
|
||||
@ParametersAreNonnullByDefault
|
||||
public MachineProcessCompleteEvent(Block block, MachineRecipe machineRecipe) {
|
||||
public AsyncMachineProcessCompleteEvent(Block block, MachineRecipe machineRecipe) {
|
||||
super(true);
|
||||
|
||||
this.block = block;
|
||||
this.machineRecipe = machineRecipe;
|
||||
}
|
||||
@ -58,4 +60,4 @@ public class MachineProcessCompleteEvent extends Event {
|
||||
public HandlerList getHandlers() {
|
||||
return handlerList;
|
||||
}
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.github.thebusybiscuit.slimefun4.api.events.MachineProcessCompleteEvent;
|
||||
import io.github.thebusybiscuit.slimefun4.api.events.AsyncMachineProcessCompleteEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@ -253,7 +253,7 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock,
|
||||
inv.pushItem(output.clone(), getOutputSlots());
|
||||
}
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new MachineProcessCompleteEvent(b, getProcessing(b)));
|
||||
Bukkit.getPluginManager().callEvent(new AsyncMachineProcessCompleteEvent(b, getProcessing(b)));
|
||||
|
||||
progress.remove(b);
|
||||
processing.remove(b);
|
||||
|
Loading…
Reference in New Issue
Block a user