mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-13 03:30:29 +00:00
Move null checks from Preconditions to Objects
This commit is contained in:
parent
f3ce44042f
commit
34602ec4be
@ -6,13 +6,13 @@
|
||||
|
||||
package dan200.computercraft.core.apis;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import dan200.computercraft.api.lua.ILuaAPIFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Objects;
|
||||
|
||||
public final class ApiFactories
|
||||
{
|
||||
@ -25,7 +25,7 @@ public final class ApiFactories
|
||||
|
||||
public static void register( @Nonnull ILuaAPIFactory factory )
|
||||
{
|
||||
Preconditions.checkNotNull( factory, "provider cannot be null" );
|
||||
Objects.requireNonNull( factory, "provider cannot be null" );
|
||||
factories.add( factory );
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
package dan200.computercraft.core.apis;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import dan200.computercraft.api.filesystem.IMount;
|
||||
import dan200.computercraft.api.filesystem.IWritableMount;
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
@ -121,7 +120,7 @@ public abstract class ComputerAccess implements IComputerAccess
|
||||
@Override
|
||||
public void queueEvent( @Nonnull final String event, final Object[] arguments )
|
||||
{
|
||||
Preconditions.checkNotNull( event, "event cannot be null" );
|
||||
Objects.requireNonNull( event, "event cannot be null" );
|
||||
m_environment.queueEvent( event, arguments );
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
package dan200.computercraft.shared;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
import dan200.computercraft.api.redstone.IBundledRedstoneProvider;
|
||||
import dan200.computercraft.shared.common.DefaultBundledRedstoneProvider;
|
||||
@ -16,6 +15,7 @@ import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
public final class BundledRedstone
|
||||
@ -26,7 +26,7 @@ public final class BundledRedstone
|
||||
|
||||
public static void register( @Nonnull IBundledRedstoneProvider provider )
|
||||
{
|
||||
Preconditions.checkNotNull( provider, "provider cannot be null" );
|
||||
Objects.requireNonNull( provider, "provider cannot be null" );
|
||||
providers.add( provider );
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
package dan200.computercraft.shared;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
import dan200.computercraft.api.permissions.ITurtlePermissionProvider;
|
||||
import dan200.computercraft.api.turtle.event.TurtleActionEvent;
|
||||
@ -20,6 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Objects;
|
||||
|
||||
@Mod.EventBusSubscriber( modid = ComputerCraft.MOD_ID )
|
||||
public final class TurtlePermissions
|
||||
@ -32,7 +32,7 @@ public final class TurtlePermissions
|
||||
|
||||
public static void register( @Nonnull ITurtlePermissionProvider upgrade )
|
||||
{
|
||||
Preconditions.checkNotNull( upgrade, "upgrade cannot be null" );
|
||||
Objects.requireNonNull( upgrade, "upgrade cannot be null" );
|
||||
|
||||
providers.add( upgrade );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user