mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-08 21:14:41 -04:00
Replace useless nullability comments with jetbrains annotation
This commit is contained in:
parent
58bef3f2cf
commit
fb4de1f172
4 changed files with 16 additions and 8 deletions
fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/event/player
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/impl/item
fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/entity
|
@ -25,6 +25,8 @@ import net.minecraft.world.World;
|
|||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.fabricmc.fabric.api.event.EventFactory;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class PlayerBlockBreakEvents {
|
||||
private PlayerBlockBreakEvents() { }
|
||||
|
||||
|
@ -90,7 +92,7 @@ public final class PlayerBlockBreakEvents {
|
|||
* @param blockEntity the block entity <strong>before</strong> the block is broken, can be {@code null}
|
||||
* @return {@code false} to cancel block breaking action, or {@code true} to pass to next listener
|
||||
*/
|
||||
boolean beforeBlockBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, /* Nullable */ BlockEntity blockEntity);
|
||||
boolean beforeBlockBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
|
@ -104,7 +106,7 @@ public final class PlayerBlockBreakEvents {
|
|||
* @param state the block state <strong>before</strong> the block was broken
|
||||
* @param blockEntity the block entity of the broken block, can be {@code null}
|
||||
*/
|
||||
void afterBlockBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, /* Nullable */ BlockEntity blockEntity);
|
||||
void afterBlockBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
|
@ -118,6 +120,6 @@ public final class PlayerBlockBreakEvents {
|
|||
* @param state the block state of the block that was going to be broken
|
||||
* @param blockEntity the block entity of the block that was going to be broken, can be {@code null}
|
||||
*/
|
||||
void onBlockBreakCanceled(World world, PlayerEntity player, BlockPos pos, BlockState state, /* Nullable */ BlockEntity blockEntity);
|
||||
void onBlockBreakCanceled(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ import net.minecraft.item.Item;
|
|||
import net.fabricmc.fabric.api.item.v1.CustomDamageHandler;
|
||||
import net.fabricmc.fabric.api.item.v1.EquipmentSlotProvider;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class FabricItemInternals {
|
||||
private static final WeakHashMap<Item.Settings, ExtraData> extraData = new WeakHashMap<>();
|
||||
|
||||
|
@ -43,8 +45,8 @@ public final class FabricItemInternals {
|
|||
}
|
||||
|
||||
public static final class ExtraData {
|
||||
private /* @Nullable */ EquipmentSlotProvider equipmentSlotProvider;
|
||||
private /* @Nullable */ CustomDamageHandler customDamageHandler;
|
||||
private @Nullable EquipmentSlotProvider equipmentSlotProvider;
|
||||
private @Nullable CustomDamageHandler customDamageHandler;
|
||||
|
||||
public void equipmentSlot(EquipmentSlotProvider equipmentSlotProvider) {
|
||||
this.equipmentSlotProvider = equipmentSlotProvider;
|
||||
|
|
|
@ -19,9 +19,11 @@ package net.fabricmc.fabric.impl.item;
|
|||
import net.fabricmc.fabric.api.item.v1.CustomDamageHandler;
|
||||
import net.fabricmc.fabric.api.item.v1.EquipmentSlotProvider;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface ItemExtensions {
|
||||
/* @Nullable */ EquipmentSlotProvider fabric_getEquipmentSlotProvider();
|
||||
@Nullable EquipmentSlotProvider fabric_getEquipmentSlotProvider();
|
||||
void fabric_setEquipmentSlotProvider(EquipmentSlotProvider equipmentSlotProvider);
|
||||
/* @Nullable */ CustomDamageHandler fabric_getCustomDamageHandler();
|
||||
@Nullable CustomDamageHandler fabric_getCustomDamageHandler();
|
||||
void fabric_setCustomDamageHandler(CustomDamageHandler handler);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ import net.minecraft.world.World;
|
|||
|
||||
import net.fabricmc.fabric.impl.object.builder.FabricEntityType;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Extended version of {@link EntityType.Builder} with added registration for
|
||||
* server->client entity tracking values.
|
||||
|
@ -272,7 +274,7 @@ public class FabricEntityTypeBuilder<T extends Entity> {
|
|||
* @param <T> Entity class.
|
||||
*/
|
||||
public static class Living<T extends LivingEntity> extends FabricEntityTypeBuilder<T> {
|
||||
/* @Nullable */
|
||||
@Nullable
|
||||
private Supplier<DefaultAttributeContainer.Builder> defaultAttributeBuilder;
|
||||
|
||||
protected Living(SpawnGroup spawnGroup, EntityType.EntityFactory<T> function) {
|
||||
|
|
Loading…
Add table
Reference in a new issue