Skip to content

Commit 3c5751c

Browse files
committed
added way to get crops from grass
1 parent c374531 commit 3c5751c

File tree

7 files changed

+171
-4
lines changed

7 files changed

+171
-4
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
88
loader_version=0.10.0+build.208
99

1010
# Mod Properties
11-
mod_version = 0.0.1
11+
mod_version = v0.0.2-alpha
1212
maven_group = org.awty.gmc.minecraft.cooking
1313
archives_base_name = advanced-cooking-mod
1414

src/main/java/org/awty/gmc/minecraft/cooking/blocks/crops/AbstractCropBlock.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
import net.minecraft.state.StateManager;
77
import net.minecraft.state.property.IntProperty;
88
import net.minecraft.state.property.Properties;
9-
import net.minecraft.state.property.Property;
109
import net.minecraft.util.math.BlockPos;
1110
import net.minecraft.util.shape.VoxelShape;
1211
import net.minecraft.world.BlockView;
1312

14-
public class AbstractCropBlock extends net.minecraft.block.CropBlock {
13+
public abstract class AbstractCropBlock extends net.minecraft.block.CropBlock {
1514

1615
private static final VoxelShape[] AGE_TO_SHAPE = new VoxelShape[]{
1716
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D),
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"rolls": 1,
6+
"entries": [
7+
{
8+
"type": "minecraft:item",
9+
"name": "cooking:tomato"
10+
},
11+
{
12+
"type": "minecraft:item",
13+
"name": "cooking:rice"
14+
},
15+
{
16+
"type": "minecraft:item",
17+
"name": "cooking:onion"
18+
},
19+
{
20+
"type": "minecraft:item",
21+
"name": "cooking:bean"
22+
}
23+
]
24+
}
25+
]
26+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"rolls": 1,
6+
"entries": [
7+
{
8+
"type": "minecraft:alternatives",
9+
"children": [
10+
{
11+
"type": "minecraft:item",
12+
"conditions": [
13+
{
14+
"condition": "minecraft:match_tool",
15+
"predicate": {
16+
"item": "minecraft:shears"
17+
}
18+
}
19+
],
20+
"name": "minecraft:grass"
21+
},
22+
{
23+
"type": "minecraft:item",
24+
"conditions": [
25+
{
26+
"condition": "minecraft:random_chance",
27+
"chance": 0.125
28+
}
29+
],
30+
"functions": [
31+
{
32+
"function": "minecraft:apply_bonus",
33+
"enchantment": "minecraft:fortune",
34+
"formula": "minecraft:uniform_bonus_count",
35+
"parameters": {
36+
"bonusMultiplier": 2
37+
}
38+
},
39+
{
40+
"function": "minecraft:explosion_decay"
41+
}
42+
],
43+
"name": "minecraft:wheat_seeds"
44+
},
45+
{
46+
"type": "minecraft:loot_table",
47+
"conditions": [
48+
{
49+
"condition": "minecraft:random_chance",
50+
"chance": 0.25
51+
}
52+
],
53+
"functions": [
54+
{
55+
"function": "minecraft:apply_bonus",
56+
"enchantment": "minecraft:fortune",
57+
"formula": "minecraft:uniform_bonus_count",
58+
"parameters": {
59+
"bonusMultiplier": 2
60+
}
61+
},
62+
{
63+
"function": "minecraft:explosion_decay"
64+
}
65+
],
66+
"name": "cooking:blocks/crops_from_grass"
67+
}
68+
]
69+
}
70+
]
71+
}
72+
]
73+
}

src/main/resources/data/minecraft/loot_tables/blocks/grass.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,29 @@
4141
}
4242
],
4343
"name": "minecraft:wheat_seeds"
44+
},
45+
{
46+
"type": "minecraft:loot_table",
47+
"conditions": [
48+
{
49+
"condition": "minecraft:random_chance",
50+
"chance": 0.25
51+
}
52+
],
53+
"functions": [
54+
{
55+
"function": "minecraft:apply_bonus",
56+
"enchantment": "minecraft:fortune",
57+
"formula": "minecraft:uniform_bonus_count",
58+
"parameters": {
59+
"bonusMultiplier": 2
60+
}
61+
},
62+
{
63+
"function": "minecraft:explosion_decay"
64+
}
65+
],
66+
"name": "cooking:blocks/crops_from_grass"
4467
}
4568
]
4669
}

src/main/resources/data/minecraft/loot_tables/blocks/tall_grass.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,29 @@
3737
}
3838
],
3939
"name": "minecraft:wheat_seeds"
40+
},
41+
{
42+
"type": "minecraft:loot_table",
43+
"conditions": [
44+
{
45+
"condition": "minecraft:random_chance",
46+
"chance": 0.25
47+
}
48+
],
49+
"functions": [
50+
{
51+
"function": "minecraft:apply_bonus",
52+
"enchantment": "minecraft:fortune",
53+
"formula": "minecraft:uniform_bonus_count",
54+
"parameters": {
55+
"bonusMultiplier": 2
56+
}
57+
},
58+
{
59+
"function": "minecraft:explosion_decay"
60+
}
61+
],
62+
"name": "cooking:blocks/crops_from_grass"
4063
}
4164
]
4265
}
@@ -99,6 +122,29 @@
99122
}
100123
],
101124
"name": "minecraft:wheat_seeds"
125+
},
126+
{
127+
"type": "minecraft:loot_table",
128+
"conditions": [
129+
{
130+
"condition": "minecraft:random_chance",
131+
"chance": 0.25
132+
}
133+
],
134+
"functions": [
135+
{
136+
"function": "minecraft:apply_bonus",
137+
"enchantment": "minecraft:fortune",
138+
"formula": "minecraft:uniform_bonus_count",
139+
"parameters": {
140+
"bonusMultiplier": 2
141+
}
142+
},
143+
{
144+
"function": "minecraft:explosion_decay"
145+
}
146+
],
147+
"name": "cooking:blocks/crops_from_grass"
102148
}
103149
]
104150
}

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schemaVersion": 1,
33
"id": "cooking",
4-
"version": "0.0.1",
4+
"version": "0.0.2-alpha",
55

66
"name": "Advanced Cooking",
77
"description": "An advanced cooking mod.",

0 commit comments

Comments
 (0)