Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.19.3 #50

Merged
merged 9 commits into from
Dec 10, 2022
Prev Previous commit
Next Next commit
Implement the ItemLike onto ItemProviderEntry
  • Loading branch information
ApexModder committed Dec 9, 2022
commit 79841218732d60faa4d7e67bbc374d79288577ab
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,30 @@
import net.minecraft.world.level.ItemLike;
import net.minecraftforge.registries.RegistryObject;

public class ItemProviderEntry<T extends ItemLike> extends RegistryEntry<T> {
public class ItemProviderEntry<T extends ItemLike> extends RegistryEntry<T> implements ItemLike {

public ItemProviderEntry(AbstractRegistrate<?> owner, RegistryObject<T> delegate) {
super(owner, delegate);
}

public ItemStack asStack() {
return new ItemStack(get());
return new ItemStack(this);
}

public ItemStack asStack(int count) {
return new ItemStack(get(), count);
return new ItemStack(this, count);
}

public boolean isIn(ItemStack stack) {
return is(stack.getItem());
}

public boolean is(Item item) {
return get().asItem() == item;
return asItem() == item;
}

@Override
public Item asItem() {
return get().asItem();
}
}