1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Refactoring and documentation

This commit is contained in:
TheBusyBiscuit 2021-04-27 16:59:39 +02:00
parent 29c568fdbf
commit 57df9e8df9
13 changed files with 227 additions and 58 deletions

View File

@ -37,6 +37,7 @@
#### Changes
* Renamed "Solar Panel" to "Photovoltaic Cell" to avoid confusions with solar generators
* Photovoltaic Cells can no longer be placed
* (API) Refactored "Machine Process" API
* (API) Removed deprecated "SlimefunBlockHandler"
* Removed Automated Crafting Chamber

View File

@ -0,0 +1,29 @@
package io.github.thebusybiscuit.slimefun4.core.attributes;
import javax.annotation.Nonnull;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineOperation;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineProcessor;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
/**
* This {@link ItemAttribute} marks a {@link SlimefunItem} as a {@link MachineProcessHolder}.
* A {@link MachineProcessHolder} can hold a {@link MachineProcessor} which is responsible for
* handling any {@link MachineOperation}.
*
* @author TheBusyBiscuit
*
* @param <T>
* The type of {@link MachineOperation} the {@link MachineProcessor} should hold.
*/
public interface MachineProcessHolder<T extends MachineOperation> extends ItemAttribute {
/**
* This method returns our {@link MachineProcessor} instance.
*
* @return Our {@link MachineProcessor}
*/
@Nonnull
MachineProcessor<T> getMachineProcessor();
}

View File

@ -1,18 +0,0 @@
package io.github.thebusybiscuit.slimefun4.core.attributes;
import javax.annotation.Nonnull;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineOperation;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineProcessor;
public interface ProcessHolder<T extends MachineOperation> extends ItemAttribute {
/**
* This method returns our {@link MachineProcessor} instance.
*
* @return Our {@link MachineProcessor}
*/
@Nonnull
MachineProcessor<T> getMachineProcessor();
}

View File

@ -1,17 +1,58 @@
package io.github.thebusybiscuit.slimefun4.core.machines;
import io.github.thebusybiscuit.slimefun4.core.attributes.MachineProcessHolder;
/**
* This represents a {@link MachineOperation} which is handled
* by a {@link MachineProcessor}.
*
* @author TheBusyBiscuit
*
* @see MachineProcessor
* @see MachineProcessHolder
*
*/
public interface MachineOperation {
void addProgress(int num);
/**
* This method adds the given amount of ticks to the progress.
*
* @param ticks
* The amount of ticks to add to the progress
*/
void addProgress(int ticks);
/**
* This returns the amount of progress that has been made.
* It's basically the amount of elapsed ticks since the {@link MachineOperation}
* has started.
*
* @return The amount of elapsed ticks
*/
int getProgress();
/**
* This returns the amount of total ticks this {@link MachineOperation} takes to complete.
*
* @return The amount of total ticks required.
*/
int getTotalTicks();
/**
* This returns the amount of remaining ticks until the {@link MachineOperation}
* finishes.
*
* @return The amount of remaining ticks.
*/
default int getRemainingTicks() {
return getTotalTicks() - getProgress();
}
/**
* This returns whether this {@link MachineOperation} has finished.
*
* @return Whether this has finished or not.
*/
default boolean isFinished() {
return getRemainingTicks() <= 0;
}

View File

@ -14,9 +14,22 @@ import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition;
import io.github.thebusybiscuit.slimefun4.core.attributes.MachineProcessHolder;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
/**
* A {@link MachineProcessor} manages different {@link MachineOperation}s and handles
* their progress.
*
* @author TheBusyBiscuit
*
* @param <T>
* The type of {@link MachineOperation} this processor can hold.
*
* @see MachineOperation
* @see MachineProcessHolder
*/
public class MachineProcessor<T extends MachineOperation> {
private final ReadWriteLock lock = new ReentrantReadWriteLock();
@ -45,21 +58,56 @@ public class MachineProcessor<T extends MachineOperation> {
this.progressBar = progressBar;
}
public boolean addOperation(@Nonnull Location loc, @Nonnull T operation) {
/**
* This method will start a {@link MachineOperation} at the given {@link Location}.
*
* @param loc
* The {@link Location} at which our machine is located.
* @param operation
* The {@link MachineOperation} to start
*
* @return Whether the {@link MachineOperation} was successfully started. This will return false if another
* {@link MachineOperation} has already been started at that {@link Location}.
*/
public boolean startOperation(@Nonnull Location loc, @Nonnull T operation) {
Validate.notNull(loc, "The location must not be null");
Validate.notNull(operation, "The machine operation cannot be null");
return addOperation(new BlockPosition(loc), operation);
return startOperation(new BlockPosition(loc), operation);
}
public boolean addOperation(@Nonnull Block b, @Nonnull T operation) {
/**
* This method will start a {@link MachineOperation} at the given {@link Block}.
*
* @param b
* The {@link Block} at which our machine is located.
* @param operation
* The {@link MachineOperation} to start
*
* @return Whether the {@link MachineOperation} was successfully started. This will return false if another
* {@link MachineOperation} has already been started at that {@link Block}.
*/
public boolean startOperation(@Nonnull Block b, @Nonnull T operation) {
Validate.notNull(b, "The Block must not be null");
Validate.notNull(operation, "The machine operation cannot be null");
return addOperation(new BlockPosition(b), operation);
return startOperation(new BlockPosition(b), operation);
}
private boolean addOperation(@Nonnull BlockPosition pos, @Nonnull T operation) {
/**
* This method will actually start the {@link MachineOperation}.
* We don't need to validate any of these inputs as that is already
* covered in our public methods.
*
* @param pos
* The {@link BlockPosition} of our machine
* @param operation
* The {@link MachineOperation} to start
*
* @return Whether the {@link MachineOperation} was successfully started. This will return false if another
* {@link MachineOperation} has already been started at that {@link BlockPosition}.
*/
private boolean startOperation(@Nonnull BlockPosition pos, @Nonnull T operation) {
lock.writeLock().lock();
try {
@ -69,6 +117,14 @@ public class MachineProcessor<T extends MachineOperation> {
}
}
/**
* This returns the current {@link MachineOperation} at that given {@link Location}.
*
* @param loc
* The {@link Location} at which our machine is located.
*
* @return The current {@link MachineOperation} or null.
*/
@Nullable
public T getOperation(@Nonnull Location loc) {
Validate.notNull(loc, "The location cannot be null");
@ -76,6 +132,14 @@ public class MachineProcessor<T extends MachineOperation> {
return getOperation(new BlockPosition(loc));
}
/**
* This returns the current {@link MachineOperation} at that given {@link Block}.
*
* @param b
* The {@link Block} at which our machine is located.
*
* @return The current {@link MachineOperation} or null.
*/
@Nullable
public T getOperation(@Nonnull Block b) {
Validate.notNull(b, "The Block cannot be null");
@ -83,6 +147,17 @@ public class MachineProcessor<T extends MachineOperation> {
return getOperation(new BlockPosition(b));
}
/**
* This returns the current {@link MachineOperation} at that given {@link BlockPosition}.
* We don't need to validate our input here as that is already
* covered in our public methods.
*
* @param pos
* The {@link BlockPosition} at which our machine is located.
*
* @return The current {@link MachineOperation} or null.
*/
@Nullable
private T getOperation(@Nonnull BlockPosition pos) {
lock.readLock().lock();
@ -93,19 +168,48 @@ public class MachineProcessor<T extends MachineOperation> {
}
}
public boolean removeOperation(@Nonnull Location loc) {
/**
* This will end the {@link MachineOperation} at the given {@link Location}.
*
* @param loc
* The {@link Location} at which our machine is located.
*
* @return Whether the {@link MachineOperation} was successfully ended. This will return false if there was no
* {@link MachineOperation} to begin with.
*/
public boolean endOperation(@Nonnull Location loc) {
Validate.notNull(loc, "The location should not be null");
return removeOperation(new BlockPosition(loc));
return endOperation(new BlockPosition(loc));
}
public boolean removeOperation(@Nonnull Block b) {
/**
* This will end the {@link MachineOperation} at the given {@link Block}.
*
* @param b
* The {@link Block} at which our machine is located.
*
* @return Whether the {@link MachineOperation} was successfully ended. This will return false if there was no
* {@link MachineOperation} to begin with.
*/
public boolean endOperation(@Nonnull Block b) {
Validate.notNull(b, "The Block should not be null");
return removeOperation(new BlockPosition(b));
return endOperation(new BlockPosition(b));
}
private boolean removeOperation(@Nonnull BlockPosition pos) {
/**
* This will end the {@link MachineOperation} at the given {@link BlockPosition}.
* We don't need to validate our input here as that is already
* covered in our public methods.
*
* @param pos
* The {@link BlockPosition} at which our machine is located.
*
* @return Whether the {@link MachineOperation} was successfully ended. This will return false if there was no
* {@link MachineOperation} to begin with.
*/
private boolean endOperation(@Nonnull BlockPosition pos) {
lock.writeLock().lock();
try {
@ -116,11 +220,15 @@ public class MachineProcessor<T extends MachineOperation> {
}
public void updateProgressBar(@Nonnull BlockMenu inv, int slot, @Nonnull T operation) {
Validate.notNull(inv, "The inventory must not be null.");
Validate.notNull(operation, "The MachineOperation must not be null.");
if (getProgressBar() == null) {
// No progress bar
// No progress bar, no need to update anything.
return;
}
// Update the progress bar in our inventory (if anyone is watching)
int remainingTicks = operation.getRemainingTicks();
int totalTicks = operation.getTotalTicks();
ChestMenuUtils.updateProgressbar(inv, slot, remainingTicks, totalTicks, getProgressBar());

View File

@ -23,15 +23,15 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction;
import io.github.thebusybiscuit.slimefun4.api.events.ReactorExplodeEvent;
import io.github.thebusybiscuit.slimefun4.core.attributes.HologramOwner;
import io.github.thebusybiscuit.slimefun4.core.attributes.ProcessHolder;
import io.github.thebusybiscuit.slimefun4.core.attributes.MachineProcessHolder;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.core.machines.FuelOperation;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineProcessor;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.implementation.items.cargo.ReactorAccessPort;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider;
import io.github.thebusybiscuit.slimefun4.implementation.operations.FuelOperation;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
@ -59,7 +59,7 @@ import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
* @see NetherStarReactor
*
*/
public abstract class Reactor extends AbstractEnergyProvider implements HologramOwner, ProcessHolder<FuelOperation> {
public abstract class Reactor extends AbstractEnergyProvider implements HologramOwner, MachineProcessHolder<FuelOperation> {
private static final String MODE = "reactor-mode";
private static final int INFO_SLOT = 49;
@ -133,7 +133,7 @@ public abstract class Reactor extends AbstractEnergyProvider implements Hologram
inv.dropItems(b.getLocation(), getOutputSlots());
}
processor.removeOperation(b);
processor.endOperation(b);
removeHologram(b);
}
};
@ -349,7 +349,7 @@ public abstract class Reactor extends AbstractEnergyProvider implements Hologram
});
explosionsQueue.remove(l);
processor.removeOperation(l);
processor.endOperation(l);
}
return explosion;
@ -388,7 +388,7 @@ public abstract class Reactor extends AbstractEnergyProvider implements Hologram
// Bukkit.getPluginManager().callEvent(new AsyncReactorProcessCompleteEvent(l, Reactor.this, getProcessing(l)));
processor.removeOperation(l);
processor.endOperation(l);
}
private void burnNextFuel(Location l, BlockMenu inv, BlockMenu accessPort) {
@ -404,7 +404,7 @@ public abstract class Reactor extends AbstractEnergyProvider implements Hologram
inv.consumeItem(entry.getKey(), entry.getValue());
}
processor.addOperation(l, new FuelOperation(fuel));
processor.startOperation(l, new FuelOperation(fuel));
}
}

View File

@ -19,15 +19,15 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent;
import io.github.thebusybiscuit.slimefun4.core.attributes.HologramOwner;
import io.github.thebusybiscuit.slimefun4.core.attributes.ProcessHolder;
import io.github.thebusybiscuit.slimefun4.core.attributes.MachineProcessHolder;
import io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineProcessor;
import io.github.thebusybiscuit.slimefun4.core.machines.MiningOperation;
import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.implementation.operations.MiningOperation;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
@ -48,7 +48,7 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
*
* @see GEOResource
*/
public class GEOMiner extends SlimefunItem implements RecipeDisplayItem, EnergyNetComponent, InventoryBlock, HologramOwner, ProcessHolder<MiningOperation> {
public class GEOMiner extends SlimefunItem implements RecipeDisplayItem, EnergyNetComponent, InventoryBlock, HologramOwner, MachineProcessHolder<MiningOperation> {
private static final int[] BORDER = { 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 35, 36, 44, 45, 53 };
private static final int[] OUTPUT_BORDER = { 19, 20, 21, 22, 23, 24, 25, 28, 34, 37, 43, 46, 47, 48, 49, 50, 51, 52 };
@ -97,7 +97,7 @@ public class GEOMiner extends SlimefunItem implements RecipeDisplayItem, EnergyN
inv.dropItems(b.getLocation(), OUTPUT_SLOTS);
}
processor.removeOperation(b);
processor.endOperation(b);
}
};
}
@ -205,7 +205,7 @@ public class GEOMiner extends SlimefunItem implements RecipeDisplayItem, EnergyN
inv.replaceExistingItem(4, new CustomItem(Material.BLACK_STAINED_GLASS_PANE, " "));
inv.pushItem(operation.getResult(), OUTPUT_SLOTS);
processor.removeOperation(b);
processor.endOperation(b);
}
} else if (!BlockStorage.hasChunkInfo(b.getWorld(), b.getX() >> 4, b.getZ() >> 4)) {
updateHologram(b, "&4GEO-Scan required!");
@ -230,7 +230,7 @@ public class GEOMiner extends SlimefunItem implements RecipeDisplayItem, EnergyN
return;
}
processor.addOperation(b, new MiningOperation(resource.getItem().clone(), PROCESSING_TIME));
processor.startOperation(b, new MiningOperation(resource.getItem().clone(), PROCESSING_TIME));
SlimefunPlugin.getGPSNetwork().getResourceManager().setSupplies(resource, b.getWorld(), b.getX() >> 4, b.getZ() >> 4, supplies - 1);
updateHologram(b, "&7Mining: &r" + resource.getName());
return;

View File

@ -1,10 +1,11 @@
package io.github.thebusybiscuit.slimefun4.core.machines;
package io.github.thebusybiscuit.slimefun4.implementation.operations;
import javax.annotation.Nonnull;
import org.apache.commons.lang.Validate;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineOperation;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe;
public class CraftingOperation implements MachineOperation {

View File

@ -1,4 +1,4 @@
package io.github.thebusybiscuit.slimefun4.core.machines;
package io.github.thebusybiscuit.slimefun4.implementation.operations;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@ -6,6 +6,7 @@ import javax.annotation.Nullable;
import org.apache.commons.lang.Validate;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineOperation;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel;
public class FuelOperation implements MachineOperation {

View File

@ -1,10 +1,12 @@
package io.github.thebusybiscuit.slimefun4.core.machines;
package io.github.thebusybiscuit.slimefun4.implementation.operations;
import javax.annotation.Nonnull;
import org.apache.commons.lang.Validate;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineOperation;
public class MiningOperation implements MachineOperation {
private final ItemStack result;

View File

@ -0,0 +1,4 @@
/**
* This package contains implementations of {@link io.github.thebusybiscuit.slimefun4.core.machines.MachineOperation}.
*/
package io.github.thebusybiscuit.slimefun4.implementation.operations;

View File

@ -22,12 +22,12 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
import io.github.thebusybiscuit.slimefun4.api.items.ItemState;
import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent;
import io.github.thebusybiscuit.slimefun4.core.attributes.ProcessHolder;
import io.github.thebusybiscuit.slimefun4.core.attributes.MachineProcessHolder;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.core.machines.CraftingOperation;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineProcessor;
import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType;
import io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.implementation.operations.CraftingOperation;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
@ -44,7 +44,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
public abstract class AContainer extends SlimefunItem implements InventoryBlock, EnergyNetComponent, ProcessHolder<CraftingOperation> {
public abstract class AContainer extends SlimefunItem implements InventoryBlock, EnergyNetComponent, MachineProcessHolder<CraftingOperation> {
private static final int[] BORDER = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44 };
private static final int[] BORDER_IN = { 9, 10, 11, 12, 18, 21, 27, 28, 29, 30 };
@ -80,7 +80,7 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock,
inv.dropItems(b.getLocation(), getOutputSlots());
}
processor.removeOperation(b);
processor.endOperation(b);
}
};
@ -372,14 +372,14 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock,
// Bukkit.getPluginManager().callEvent(new AsyncMachineProcessCompleteEvent(b.getLocation(),
// AContainer.this, getProcessing(b)));
processor.removeOperation(b);
processor.endOperation(b);
}
}
} else {
MachineRecipe next = findNextRecipe(inv);
if (next != null) {
processor.addOperation(b, new CraftingOperation(next));
processor.startOperation(b, new CraftingOperation(next));
}
}
}

View File

@ -19,14 +19,14 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction;
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
import io.github.thebusybiscuit.slimefun4.api.items.ItemState;
import io.github.thebusybiscuit.slimefun4.core.attributes.ProcessHolder;
import io.github.thebusybiscuit.slimefun4.core.attributes.MachineProcessHolder;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.core.machines.FuelOperation;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineProcessor;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider;
import io.github.thebusybiscuit.slimefun4.implementation.operations.FuelOperation;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
@ -41,7 +41,7 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
public abstract class AGenerator extends AbstractEnergyProvider implements ProcessHolder<FuelOperation> {
public abstract class AGenerator extends AbstractEnergyProvider implements MachineProcessHolder<FuelOperation> {
private static final int[] border = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44 };
private static final int[] border_in = { 9, 10, 11, 12, 18, 21, 27, 28, 29, 30 };
@ -102,7 +102,7 @@ public abstract class AGenerator extends AbstractEnergyProvider implements Proce
inv.dropItems(b.getLocation(), getOutputSlots());
}
processor.removeOperation(b);
processor.endOperation(b);
}
};
}
@ -190,7 +190,7 @@ public abstract class AGenerator extends AbstractEnergyProvider implements Proce
// Bukkit.getPluginManager().callEvent(new AsyncGeneratorProcessCompleteEvent(l, AGenerator.this,
// getProcessing(l)));
processor.removeOperation(l);
processor.endOperation(l);
return 0;
}
} else {
@ -202,7 +202,7 @@ public abstract class AGenerator extends AbstractEnergyProvider implements Proce
inv.consumeItem(entry.getKey(), entry.getValue());
}
processor.addOperation(l, new FuelOperation(fuel));
processor.startOperation(l, new FuelOperation(fuel));
}
return 0;