mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-04-16 20:11:24 +00:00
Correctly register turtle refuel handlers
And actually test them! Along with a whole load of other turtle tests. Fixes #1202
This commit is contained in:
@@ -39,7 +39,7 @@ public final class TurtleRefuelHandlers
|
||||
{
|
||||
}
|
||||
|
||||
public static void register( TurtleRefuelHandler handler )
|
||||
public static synchronized void register( TurtleRefuelHandler handler )
|
||||
{
|
||||
Objects.requireNonNull( handler, "handler cannot be null" );
|
||||
handlers.add( handler );
|
||||
|
||||
@@ -68,6 +68,7 @@ import dan200.computercraft.shared.pocket.items.ItemPocketComputer;
|
||||
import dan200.computercraft.shared.pocket.peripherals.PocketModem;
|
||||
import dan200.computercraft.shared.pocket.peripherals.PocketSpeaker;
|
||||
import dan200.computercraft.shared.pocket.recipes.PocketComputerUpgradeRecipe;
|
||||
import dan200.computercraft.shared.turtle.FurnaceRefuelHandler;
|
||||
import dan200.computercraft.shared.turtle.blocks.BlockTurtle;
|
||||
import dan200.computercraft.shared.turtle.blocks.TileTurtle;
|
||||
import dan200.computercraft.shared.turtle.inventory.ContainerTurtle;
|
||||
@@ -394,6 +395,8 @@ public final class Registry
|
||||
ComputerCraftAPI.registerGenericSource( new InventoryMethods() );
|
||||
ComputerCraftAPI.registerGenericSource( new FluidMethods() );
|
||||
ComputerCraftAPI.registerGenericSource( new EnergyMethods() );
|
||||
|
||||
ComputerCraftAPI.registerRefuelHandler( new FurnaceRefuelHandler() );
|
||||
}
|
||||
|
||||
private static void registerProviders()
|
||||
|
||||
@@ -15,12 +15,6 @@ import java.util.OptionalInt;
|
||||
|
||||
public final class FurnaceRefuelHandler implements TurtleRefuelHandler
|
||||
{
|
||||
private static final FurnaceRefuelHandler INSTANCE = new FurnaceRefuelHandler();
|
||||
|
||||
private FurnaceRefuelHandler()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionalInt refuel( @Nonnull ITurtleAccess turtle, @Nonnull ItemStack currentStack, int slot, int limit )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user