Harvest torchflowers only at the flower stage.
Torchflower_crop max age is an immature middle stage; wait for the torchflower block and replant as crop age 0. Co-authored-by: Cursor <cursoragent@cursor.com>
@@ -1,4 +1,4 @@
1
# CopperFarmer 0.1.10
1
# CopperFarmer 0.1.11
2
2
3
3
First-version Paper 26.2 / Java 25 plugin for autonomous Copper Farmer Golems.
4
4
@@ -1,4 +1,4 @@1
# CopperFarmer 0.1.101
# CopperFarmer 0.1.112
2
3
First-version Paper 26.2 / Java 25 plugin for autonomous Copper Farmer Golems.3
First-version Paper 26.2 / Java 25 plugin for autonomous Copper Farmer Golems.4
4
@@ -1,4 +1,4 @@
1
# CopperFarmer 0.1.10 smoke test
1
# CopperFarmer 0.1.11 smoke test
2
2
3
3
Use this checklist on a Paper 26.2 server before treating 0.1.0 as production-ready.
4
4
@@ -37,7 +37,7 @@ Test at least one full harvest/replant/deposit cycle for:
37
37
- [ ] Nether Wart
38
38
- [ ] Cocoa
39
39
- [ ] Sweet Berry Bushes
40
- [ ] Torchflowers
40
- [ ] Torchflowers (only the flower block is harvested; age-1 crop is left alone)
41
41
- [ ] Melon (fruit breaks; attached stem survives)
42
42
- [ ] Pumpkin (fruit breaks; attached stem survives)
43
43
@@ -1,4 +1,4 @@1
# CopperFarmer 0.1.10 smoke test1
# CopperFarmer 0.1.11 smoke test2
2
3
Use this checklist on a Paper 26.2 server before treating 0.1.0 as production-ready.3
Use this checklist on a Paper 26.2 server before treating 0.1.0 as production-ready.4
4
@@ -37,7 +37,7 @@ Test at least one full harvest/replant/deposit cycle for:37
- [ ] Nether Wart37
- [ ] Nether Wart38
- [ ] Cocoa38
- [ ] Cocoa39
- [ ] Sweet Berry Bushes39
- [ ] Sweet Berry Bushes40
- [ ] Torchflowers40
- [ ] Torchflowers (only the flower block is harvested; age-1 crop is left alone)41
- [ ] Melon (fruit breaks; attached stem survives)41
- [ ] Melon (fruit breaks; attached stem survives)42
- [ ] Pumpkin (fruit breaks; attached stem survives)42
- [ ] Pumpkin (fruit breaks; attached stem survives)43
43
@@ -3,7 +3,7 @@ plugins {
3
3
}
4
4
5
5
group = "nl.timfalken"
6
version = "0.1.10"
6
version = "0.1.11"
7
7
8
8
repositories {
9
9
mavenCentral()
@@ -3,7 +3,7 @@ plugins {3
}3
}4
4
5
group = "nl.timfalken"5
group = "nl.timfalken"6
version = "0.1.10"6
version = "0.1.11"7
7
8
repositories {8
repositories {9
mavenCentral()9
mavenCentral()@@ -48,7 +48,7 @@ public final class CopperFarmerPlugin extends JavaPlugin {
48
48
long interval = Math.max(1L, getConfig().getLong("brain-tick-interval", 5L));
49
49
brainTask = getServer().getScheduler().runTaskTimer(this, () -> manager.tick(interval), interval, interval);
50
50
51
getLogger().info("CopperFarmer 0.1.10 enabled for Paper 26.2.");
51
getLogger().info("CopperFarmer 0.1.11 enabled for Paper 26.2.");
52
52
}
53
53
54
54
@Override
@@ -48,7 +48,7 @@ public final class CopperFarmerPlugin extends JavaPlugin {48
long interval = Math.max(1L, getConfig().getLong("brain-tick-interval", 5L));48
long interval = Math.max(1L, getConfig().getLong("brain-tick-interval", 5L));49
brainTask = getServer().getScheduler().runTaskTimer(this, () -> manager.tick(interval), interval, interval);49
brainTask = getServer().getScheduler().runTaskTimer(this, () -> manager.tick(interval), interval, interval);50
50
51
getLogger().info("CopperFarmer 0.1.10 enabled for Paper 26.2.");51
getLogger().info("CopperFarmer 0.1.11 enabled for Paper 26.2.");52
}52
}53
53
54
@Override54
@Override@@ -43,7 +43,8 @@ final class CropRegistry {
43
43
register(Material.NETHER_WART, Material.NETHER_WART, PlantSupport.SOUL_SAND, false);
44
44
register(Material.COCOA, Material.COCOA_BEANS, PlantSupport.JUNGLE_LOG_SIDE, false);
45
45
register(Material.SWEET_BERRY_BUSH, Material.SWEET_BERRIES, PlantSupport.NONE, false);
46
register(Material.TORCHFLOWER_CROP, Material.TORCHFLOWER_SEEDS, PlantSupport.FARMLAND, false);
46
// Torchflower_crop ages 0–1 are immature; the final stage is the torchflower flower block.
47
register(Material.TORCHFLOWER, Material.TORCHFLOWER_SEEDS, PlantSupport.FARMLAND, false);
47
48
register(Material.MELON, Material.MELON_SEEDS, PlantSupport.NONE, true);
48
49
register(Material.PUMPKIN, Material.PUMPKIN_SEEDS, PlantSupport.NONE, true);
49
50
}
@@ -76,6 +77,9 @@ final class CropRegistry {
76
77
: Material.ATTACHED_PUMPKIN_STEM);
77
78
}
78
79
80
// Fully grown torchflowers are the flower block, not an Ageable crop stage.
81
if (block.getType() == Material.TORCHFLOWER) return true;
82
79
83
if (block.getBlockData() instanceof Ageable ageable) {
80
84
return ageable.getAge() >= ageable.getMaximumAge();
81
85
}
@@ -100,17 +104,25 @@ final class CropRegistry {
100
104
cocoa.setAge(0);
101
105
return cocoa;
102
106
}
107
if (crop.block() == Material.TORCHFLOWER) return torchflowerCropData();
103
108
BlockData data = crop.block().createBlockData();
104
109
if (data instanceof Ageable ageable) ageable.setAge(0);
105
110
return data;
106
111
}
107
112
108
113
BlockData replantData(BlockData harvested) {
114
if (harvested.getMaterial() == Material.TORCHFLOWER) return torchflowerCropData();
109
115
BlockData data = harvested.clone();
110
116
if (data instanceof Ageable ageable) ageable.setAge(0);
111
117
return data;
112
118
}
113
119
120
private static BlockData torchflowerCropData() {
121
BlockData data = Material.TORCHFLOWER_CROP.createBlockData();
122
if (data instanceof Ageable ageable) ageable.setAge(0);
123
return data;
124
}
125
114
126
boolean isCocoaSupport(Material material) {
115
127
return material == Material.JUNGLE_LOG
116
128
|| material == Material.JUNGLE_WOOD
@@ -43,7 +43,8 @@ final class CropRegistry {43
register(Material.NETHER_WART, Material.NETHER_WART, PlantSupport.SOUL_SAND, false);43
register(Material.NETHER_WART, Material.NETHER_WART, PlantSupport.SOUL_SAND, false);44
register(Material.COCOA, Material.COCOA_BEANS, PlantSupport.JUNGLE_LOG_SIDE, false);44
register(Material.COCOA, Material.COCOA_BEANS, PlantSupport.JUNGLE_LOG_SIDE, false);45
register(Material.SWEET_BERRY_BUSH, Material.SWEET_BERRIES, PlantSupport.NONE, false);45
register(Material.SWEET_BERRY_BUSH, Material.SWEET_BERRIES, PlantSupport.NONE, false);46
register(Material.TORCHFLOWER_CROP, Material.TORCHFLOWER_SEEDS, PlantSupport.FARMLAND, false);46
// Torchflower_crop ages 0–1 are immature; the final stage is the torchflower flower block.47
register(Material.TORCHFLOWER, Material.TORCHFLOWER_SEEDS, PlantSupport.FARMLAND, false);47
register(Material.MELON, Material.MELON_SEEDS, PlantSupport.NONE, true);48
register(Material.MELON, Material.MELON_SEEDS, PlantSupport.NONE, true);48
register(Material.PUMPKIN, Material.PUMPKIN_SEEDS, PlantSupport.NONE, true);49
register(Material.PUMPKIN, Material.PUMPKIN_SEEDS, PlantSupport.NONE, true);49
}50
}@@ -76,6 +77,9 @@ final class CropRegistry {76
: Material.ATTACHED_PUMPKIN_STEM);77
: Material.ATTACHED_PUMPKIN_STEM);77
}78
}78
79
80
// Fully grown torchflowers are the flower block, not an Ageable crop stage.81
if (block.getType() == Material.TORCHFLOWER) return true;82
79
if (block.getBlockData() instanceof Ageable ageable) {83
if (block.getBlockData() instanceof Ageable ageable) {80
return ageable.getAge() >= ageable.getMaximumAge();84
return ageable.getAge() >= ageable.getMaximumAge();81
}85
}@@ -100,17 +104,25 @@ final class CropRegistry {100
cocoa.setAge(0);104
cocoa.setAge(0);101
return cocoa;105
return cocoa;102
}106
}107
if (crop.block() == Material.TORCHFLOWER) return torchflowerCropData();103
BlockData data = crop.block().createBlockData();108
BlockData data = crop.block().createBlockData();104
if (data instanceof Ageable ageable) ageable.setAge(0);109
if (data instanceof Ageable ageable) ageable.setAge(0);105
return data;110
return data;106
}111
}107
112
108
BlockData replantData(BlockData harvested) {113
BlockData replantData(BlockData harvested) {114
if (harvested.getMaterial() == Material.TORCHFLOWER) return torchflowerCropData();109
BlockData data = harvested.clone();115
BlockData data = harvested.clone();110
if (data instanceof Ageable ageable) ageable.setAge(0);116
if (data instanceof Ageable ageable) ageable.setAge(0);111
return data;117
return data;112
}118
}113
119
120
private static BlockData torchflowerCropData() {121
BlockData data = Material.TORCHFLOWER_CROP.createBlockData();122
if (data instanceof Ageable ageable) ageable.setAge(0);123
return data;124
}125
114
boolean isCocoaSupport(Material material) {126
boolean isCocoaSupport(Material material) {115
return material == Material.JUNGLE_LOG127
return material == Material.JUNGLE_LOG116
|| material == Material.JUNGLE_WOOD128
|| material == Material.JUNGLE_WOOD@@ -1,5 +1,5 @@
1
1
name: CopperFarmer
2
version: 0.1.10
2
version: 0.1.11
3
3
main: nl.timfalken.copperfarmer.CopperFarmerPlugin
4
4
api-version: '26.2'
5
5
author: Tim Falken
@@ -1,5 +1,5 @@1
name: CopperFarmer1
name: CopperFarmer2
version: 0.1.102
version: 0.1.113
main: nl.timfalken.copperfarmer.CopperFarmerPlugin3
main: nl.timfalken.copperfarmer.CopperFarmerPlugin4
api-version: '26.2'4
api-version: '26.2'5
author: Tim Falken5
author: Tim Falken