Skip to content

Commit

Permalink
BlueberryItem#getName is now @NotNull
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Dec 16, 2021
1 parent 159c1ca commit 100b975
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

import com.google.common.base.Preconditions;
import net.blueberrymc.common.bml.BlueberryMod;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public abstract class BlueberryItem extends Item {
private final BlueberryMod mod;
Expand All @@ -21,8 +18,4 @@ public BlueberryItem(@NotNull("mod") BlueberryMod mod, @NotNull("properties") Pr
public final BlueberryMod getMod() {
return mod;
}

@Nullable
@Override
public abstract Component getName(@NotNull ItemStack itemStack);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.function.Function;

public class SimpleBlueberryItem extends BlueberryItem {
private final Function<ItemStack, Component> toNameFunction;

public SimpleBlueberryItem(@NotNull("mod") BlueberryMod mod, @NotNull Properties properties, @NotNull("toNameFunction") Function<ItemStack, Component> toNameFunction) {
public SimpleBlueberryItem(@NotNull BlueberryMod mod, @NotNull Properties properties, @NotNull Function<@NotNull ItemStack, @NotNull Component> toNameFunction) {
super(mod, properties);
this.toNameFunction = toNameFunction;
}

@Nullable
@NotNull
@Override
public Component getName(@NotNull ItemStack itemStack) {
return toNameFunction.apply(itemStack);
Expand Down

0 comments on commit 100b975

Please sign in to comment.