Tall grass (the actual obtainable items) are now edible

This commit is contained in:
Sollace 2019-01-31 16:34:08 +02:00
parent ad327c6831
commit fd3edb01c4
5 changed files with 22 additions and 1 deletions

View file

@ -134,6 +134,22 @@ public class UItems {
).setFoodDelegate(new ItemEdible(new BushToxicityDeterminent()))
.setTranslationKey("doublePlant");
public static final Item tall_grass = new UItemFoodDelegate(Blocks.TALLGRASS, stack -> {
switch (stack.getMetadata()) {
case 0: return "shrub";
case 1: return "grass";
case 2: return "fern";
default: return "";
}
}).setFoodDelegate(new ItemEdible(stack -> {
switch (stack.getMetadata()) {
default:
case 0: return Toxicity.SAFE;
case 1: return Toxicity.SAFE;
case 2: return Toxicity.SEVERE;
}
}));
public static final Item yellow_flower = new UItemFoodDelegate(Blocks.YELLOW_FLOWER, stack ->
BlockFlower.EnumFlowerType.getType(BlockFlower.EnumFlowerColor.YELLOW, stack.getMetadata()).getTranslationKey()
).setFoodDelegate(new ItemEdible(new FlowerToxicityDeterminent(BlockFlower.EnumFlowerColor.YELLOW)))
@ -174,6 +190,7 @@ public class UItems {
RegistryLockSpinner.open(Item.REGISTRY, Items.class, r -> r
.replace(Items.APPLE, apple)
.replace(Items.STICK, stick)
.replace(Item.getItemFromBlock(Blocks.TALLGRASS), tall_grass)
.replace(Item.getItemFromBlock(Blocks.DOUBLE_PLANT), double_plant)
.replace(Item.getItemFromBlock(Blocks.YELLOW_FLOWER), yellow_flower)
.replace(Item.getItemFromBlock(Blocks.RED_FLOWER), red_flower));

View file

@ -13,6 +13,7 @@
],
"F": [
{ "item": "minecraft:double_plant", "data": 0 },
{ "item": "minecraft:tallgrass", "data": 1 },
{ "item": "unicopia:alfalfa_leaves" },
{ "item": "minecraft:red_flower", "data": 3 },
{ "item": "minecraft:red_flower", "data": 4 },

View file

@ -14,6 +14,7 @@
"F": [
{ "item": "minecraft:double_plant", "data": 0 },
{ "item": "minecraft:double_plant", "data": 1 },
{ "item": "minecraft:tallgrass", "data": 1 },
{ "item": "minecraft:double_plant", "data": 5 },
{ "item": "unicopia:alfalfa_leaves" },
{ "item": "minecraft:red_flower", "data": 1 },

View file

@ -14,6 +14,7 @@
"F": [
{ "item": "minecraft:double_plant", "data": 0 },
{ "item": "minecraft:double_plant", "data": 1 },
{ "item": "minecraft:tallgrass", "data": 1 },
{ "item": "minecraft:double_plant", "data": 3 },
{ "item": "minecraft:double_plant", "data": 4 },
{ "item": "minecraft:double_plant", "data": 5 },

View file

@ -17,7 +17,8 @@
{ "item": "unicopia:corrupted_gem" },
{ "item": "minecraft:double_plant", "data": 0 },
{ "item": "minecraft:double_plant", "data": 1 },
{ "item": "minecraft:double_plant", "data": 3 },
{ "item": "minecraft:tallgrass", "data": 1 },
{ "item": "minecraft:tallgrass", "data": 2 },
{ "item": "minecraft:double_plant", "data": 4 },
{ "item": "minecraft:double_plant", "data": 5 },
{ "item": "unicopia:alfalfa_leaves" },