net.minecraft.item.ItemConvertible Java Examples

The following examples show how to use net.minecraft.item.ItemConvertible. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MixinSheepEntity.java    From patchwork-api with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public List<ItemStack> onSheared(ItemStack item, IWorld world, BlockPos pos, int fortune) {
	List<ItemStack> drops = new java.util.ArrayList<>();

	if (!this.world.isClient) {
		this.setSheared(true);

		int count = 1 + this.random.nextInt(3);
		ItemConvertible wool = DROPS.get(this.getColor());

		for (int i = 0; i < count; i++) {
			drops.add(new ItemStack(wool));
		}
	}

	this.playSound(SoundEvents.ENTITY_SHEEP_SHEAR, 1.0F, 1.0F);
	return drops;
}
 
Example #2
Source File: RecipeInfo.java    From multiconnect with MIT License 5 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(String group, ItemStack output, ItemConvertible[]... inputs) {
    DefaultedList<Ingredient> ingredients = DefaultedList.of();
    for (ItemConvertible[] input : inputs) {
        ingredients.add(Ingredient.ofItems(input));
    }
    return new RecipeInfo<>(id -> new ShapelessRecipe(id, group, output, ingredients), RecipeSerializer.SHAPELESS, output);
}
 
Example #3
Source File: WItem.java    From LibGui with MIT License 5 votes vote down vote up
/**
 * Gets the render stacks ({@link Item#getStackForRender()}) of each item in a tag.
 */
private static List<ItemStack> getRenderStacks(Tag<? extends ItemConvertible> tag) {
	ImmutableList.Builder<ItemStack> builder = ImmutableList.builder();

	for (ItemConvertible item : tag.values()) {
		builder.add(new ItemStack(item));
	}

	return builder.build();
}
 
Example #4
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(String group, int count, ItemConvertible output, ItemConvertible[]... inputs) {
    return shapeless(group, new ItemStack(output, count), inputs);
}
 
Example #5
Source File: Achievements_1_11_2.java    From multiconnect with MIT License 4 votes vote down vote up
private static Advancement create(String name, int x, int y, ItemConvertible icon, Advancement parent, boolean special) {
    return create(name, x, y, new ItemStack(icon), parent, special);
}
 
Example #6
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static <T extends Recipe<?>> RecipeInfo<T> of(Function<Identifier, Recipe<?>> creator, RecipeSerializer<T> recipeType, ItemConvertible output) {
    return of(creator, recipeType, new ItemStack(output));
}
 
Example #7
Source File: WItem.java    From LibGui with MIT License 4 votes vote down vote up
public WItem(Tag<? extends ItemConvertible> tag) {
	this(getRenderStacks(tag));
}
 
Example #8
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(int count, ItemConvertible output, ItemConvertible[]... inputs) {
    return shapeless("", count, output, inputs);
}
 
Example #9
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(ItemConvertible output, ItemConvertible[]... inputs) {
    return shapeless("", output, inputs);
}
 
Example #10
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(ItemStack output, ItemConvertible[]... inputs) {
    return shapeless("", output, inputs);
}
 
Example #11
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(int count, ItemConvertible output, ItemConvertible... inputs) {
    return shapeless("", count, output, inputs);
}
 
Example #12
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(ItemConvertible output, ItemConvertible... inputs) {
    return shapeless("", output, inputs);
}
 
Example #13
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(ItemStack output, ItemConvertible... inputs) {
    return shapeless("", output, inputs);
}
 
Example #14
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static <T extends Recipe<?>> RecipeInfo<T> of(Function<Identifier, Recipe<?>> creator, RecipeSerializer<T> recipeType, ItemConvertible output, int count) {
    return of(creator, recipeType, new ItemStack(output, count));
}
 
Example #15
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(String group, ItemConvertible output, ItemConvertible[]... inputs) {
    return shapeless(group, new ItemStack(output), inputs);
}
 
Example #16
Source File: Achievements_1_11_2.java    From multiconnect with MIT License 4 votes vote down vote up
private static Advancement create(String name, int x, int y, ItemConvertible icon, Advancement parent) {
    return create(name, x, y, icon, parent, false);
}
 
Example #17
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(String group, int count, ItemConvertible output, ItemConvertible... inputs) {
    return shapeless(group, new ItemStack(output, count), inputs);
}
 
Example #18
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(String group, ItemConvertible output, ItemConvertible... inputs) {
    return shapeless(group, new ItemStack(output), inputs);
}
 
Example #19
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapelessRecipe> shapeless(String group, ItemStack output, ItemConvertible... inputs) {
    ItemConvertible[][] newInputs = new ItemConvertible[inputs.length][1];
    for (int i = 0; i < inputs.length; i++)
        newInputs[i] = new ItemConvertible[] {inputs[i]};
    return shapeless(group, output, newInputs);
}
 
Example #20
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapedRecipe> shaped(String group, int count, ItemConvertible output, Object... args) {
    return shaped(group, new ItemStack(output, count), args);
}
 
Example #21
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapedRecipe> shaped(String group, ItemConvertible output, Object... args) {
    return shaped(group, new ItemStack(output), args);
}
 
Example #22
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapedRecipe> shaped(int count, ItemConvertible output, Object... args) {
    return shaped("", count, output, args);
}
 
Example #23
Source File: RecipeInfo.java    From multiconnect with MIT License 4 votes vote down vote up
public static RecipeInfo<ShapedRecipe> shaped(ItemConvertible output, Object... args) {
    return shaped("", output, args);
}