mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-04-24 03:33:16 +00:00
Remove superflous Nonnull/Notnull annotations
This commit is contained in:
parent
1977556da4
commit
94f5ede75a
@ -18,7 +18,6 @@ import net.minecraft.commands.CommandBuildContext;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.synchronization.ArgumentTypeInfo;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@ -159,14 +158,14 @@ public final class ComputersArgumentType implements ArgumentType<ComputersArgume
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputersArgumentType.Template unpack(@NotNull ComputersArgumentType argumentType) {
|
||||
public ComputersArgumentType.Template unpack(ComputersArgumentType argumentType) {
|
||||
return new ComputersArgumentType.Template(this, argumentType.requireSome);
|
||||
}
|
||||
}
|
||||
|
||||
public record Template(Info info, boolean requireSome) implements ArgumentTypeInfo.Template<ComputersArgumentType> {
|
||||
@Override
|
||||
public ComputersArgumentType instantiate(@NotNull CommandBuildContext context) {
|
||||
public ComputersArgumentType instantiate(CommandBuildContext context) {
|
||||
return requireSome ? SOME : MANY;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@ import net.minecraft.commands.synchronization.ArgumentTypeInfo;
|
||||
import net.minecraft.commands.synchronization.ArgumentTypeInfos;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@ -144,7 +143,7 @@ public final class RepeatArgumentType<T, U> implements ArgumentType<List<T>> {
|
||||
) implements ArgumentTypeInfo.Template<RepeatArgumentType<?, ?>> {
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public RepeatArgumentType<?, ?> instantiate(@NotNull CommandBuildContext commandBuildContext) {
|
||||
public RepeatArgumentType<?, ?> instantiate(CommandBuildContext commandBuildContext) {
|
||||
var child = child().instantiate(commandBuildContext);
|
||||
return flatten ? RepeatArgumentType.someFlat((ArgumentType) child, some()) : RepeatArgumentType.some(child, some());
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ import io.netty.handler.ssl.SslHandler;
|
||||
import io.netty.handler.timeout.ReadTimeoutException;
|
||||
import io.netty.handler.traffic.AbstractTrafficShapingHandler;
|
||||
import io.netty.handler.traffic.GlobalTrafficShapingHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -193,7 +192,7 @@ public final class NetworkUtils {
|
||||
* @return The SSL handler.
|
||||
* @see io.netty.handler.ssl.SslHandler
|
||||
*/
|
||||
private static SslHandler makeSslHandler(SocketChannel ch, @NotNull SslContext sslContext, int timeout, String peerHost, int peerPort) {
|
||||
private static SslHandler makeSslHandler(SocketChannel ch, SslContext sslContext, int timeout, String peerHost, int peerPort) {
|
||||
var handler = sslContext.newHandler(ch.alloc(), peerHost, peerPort);
|
||||
if (timeout > 0) handler.setHandshakeTimeoutMillis(timeout);
|
||||
return handler;
|
||||
|
@ -72,7 +72,6 @@ import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.EntityHitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@ -284,7 +283,7 @@ public class PlatformHelperImpl implements PlatformHelper {
|
||||
public boolean hasToolUsage(ItemStack stack) {
|
||||
var item = stack.getItem();
|
||||
return item instanceof ShovelItem || stack.is(ItemTags.SHOVELS) ||
|
||||
item instanceof HoeItem || stack.is(ItemTags.HOES);
|
||||
item instanceof HoeItem || stack.is(ItemTags.HOES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -295,8 +294,8 @@ public class PlatformHelperImpl implements PlatformHelper {
|
||||
@Override
|
||||
public boolean interactWithEntity(ServerPlayer player, Entity entity, Vec3 hitPos) {
|
||||
return UseEntityCallback.EVENT.invoker().interact(player, entity.level, InteractionHand.MAIN_HAND, entity, new EntityHitResult(entity, hitPos)).consumesAction() ||
|
||||
entity.interactAt(player, hitPos.subtract(entity.position()), InteractionHand.MAIN_HAND).consumesAction() ||
|
||||
player.interactOn(entity, InteractionHand.MAIN_HAND).consumesAction();
|
||||
entity.interactAt(player, hitPos.subtract(entity.position()), InteractionHand.MAIN_HAND).consumesAction() ||
|
||||
player.interactOn(entity, InteractionHand.MAIN_HAND).consumesAction();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -350,7 +349,6 @@ public class PlatformHelperImpl implements PlatformHelper {
|
||||
return object;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Iterator<T> iterator() {
|
||||
return registry.iterator();
|
||||
|
Loading…
x
Reference in New Issue
Block a user