mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-28 04:17:38 +00:00
Java 8. Java 8. Does whatever Java 8 can.
Default methods, everywhere. Arrow types, switch on strings. Lambdas! Here comes Java 8.
This commit is contained in:
@@ -16,6 +16,7 @@ import javax.annotation.Nullable;
|
||||
* @see ILuaContext#executeMainThreadTask(ILuaTask)
|
||||
* @see ILuaContext#issueMainThreadTask(ILuaTask)
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ILuaTask
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@ import javax.annotation.Nullable;
|
||||
*
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerMediaProvider(IMediaProvider)
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IMediaProvider
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -91,7 +91,9 @@ public interface IPeripheral
|
||||
* computers can be attached to a peripheral at once.
|
||||
* @see #detach
|
||||
*/
|
||||
void attach( @Nonnull IComputerAccess computer );
|
||||
default void attach( @Nonnull IComputerAccess computer )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Is called when a computer is detaching from the peripheral.
|
||||
@@ -108,7 +110,9 @@ public interface IPeripheral
|
||||
* computers can be attached to a peripheral at once.
|
||||
* @see #detach
|
||||
*/
|
||||
void detach( @Nonnull IComputerAccess computer );
|
||||
default void detach( @Nonnull IComputerAccess computer )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether this peripheral is equivalent to another one.
|
||||
|
||||
@@ -18,6 +18,7 @@ import javax.annotation.Nullable;
|
||||
*
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerPeripheralProvider(IPeripheralProvider)
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IPeripheralProvider
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,9 @@ public interface IPocketUpgrade
|
||||
* @param peripheral The peripheral for this upgrade.
|
||||
* @see #createPeripheral(IPocketAccess)
|
||||
*/
|
||||
void update( @Nonnull IPocketAccess access, @Nullable IPeripheral peripheral );
|
||||
default void update( @Nonnull IPocketAccess access, @Nullable IPeripheral peripheral )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the pocket computer is right clicked.
|
||||
@@ -87,5 +89,8 @@ public interface IPocketUpgrade
|
||||
* access the GUI.
|
||||
* @see #createPeripheral(IPocketAccess)
|
||||
*/
|
||||
boolean onRightClick( @Nonnull World world, @Nonnull IPocketAccess access, @Nullable IPeripheral peripheral );
|
||||
default boolean onRightClick( @Nonnull World world, @Nonnull IPocketAccess access, @Nullable IPeripheral peripheral )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import javax.annotation.Nonnull;
|
||||
*
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerBundledRedstoneProvider(IBundledRedstoneProvider)
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IBundledRedstoneProvider
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,7 @@ import javax.annotation.Nonnull;
|
||||
*
|
||||
* @see ITurtleAccess#executeCommand(ILuaContext, ITurtleCommand)
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ITurtleCommand
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -136,5 +136,7 @@ public interface ITurtleUpgrade
|
||||
* @param turtle Access to the turtle that the upgrade resides on.
|
||||
* @param side Which side of the turtle (left or right) the upgrade resides on.
|
||||
*/
|
||||
void update( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side );
|
||||
default void update( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user