mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-12-03 21:08:06 +00:00
Update to latest NullAway
This fixes several issues with @Nullable fields not being checked. This is great in principle, but a little annoying in practice as MC's @Nullable annotations are sometimes a little overly strict -- we now need to wrap a couple of things in assertNonNull checks.
This commit is contained in:
@@ -32,6 +32,8 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static dan200.computercraft.core.util.Nullability.assertNonNull;
|
||||
|
||||
public class ComputerCraftClient {
|
||||
@@ -77,7 +79,7 @@ public class ComputerCraftClient {
|
||||
if (hit.getType() != HitResult.Type.BLOCK) return ItemStack.EMPTY;
|
||||
|
||||
var pos = ((BlockHitResult) hit).getBlockPos();
|
||||
var level = Minecraft.getInstance().level;
|
||||
var level = Objects.requireNonNull(Minecraft.getInstance().level);
|
||||
var state = level.getBlockState(pos);
|
||||
if (!(state.getBlock() instanceof CableBlock cable)) return ItemStack.EMPTY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user