Skip to content

Commit

Permalink
Fixed drill dyeing recipes, Closes #1459
Browse files Browse the repository at this point in the history
  • Loading branch information
Flanks255 committed Dec 7, 2024
1 parent db9095e commit 690aa4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.3.12+mc1.21.1
* Fixed the Drill dye recipes not functioning.
* Fixed the name of the first drill speed augment.
* Fixed the farmer not funneling seeds back to the seed slots.

# 1.3.11+mc1.21.1
* Fixed Farmer not playing well with non-vanilla farmland.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static boolean tryPlant(BlockState toPlant, Level world, BlockPos pos) {
public FarmerResult tryPlantSeed(ItemStack seed, Level world, BlockPos pos, IFarmer farmer) {
int use = 350;
if (farmer.getEnergy() >= use * 2) {
var plantable = getPlantableFromStack(seed); //TODO: Should figure out what else to call in here (Farmland stuff etc)
var plantable = getSpecialPlantable(seed); //TODO: Should figure out what else to call in here (Farmland stuff etc)
if (plantable != null && plantable.canPlacePlantAtPosition(seed, world, pos, Direction.DOWN)) {
plantable.spawnPlantAtPosition(seed, world, pos, Direction.DOWN);
farmer.extractEnergy(use);
Expand Down Expand Up @@ -126,7 +126,7 @@ private FarmerResult doFarmerStuff(BlockState state, ServerLevel serverLevel, Bl
if (drops.isEmpty())
return FarmerResult.FAIL;
for (ItemStack stack : drops) {
if (this.getPlantableFromStack(stack) != null) {
if (this.getSpecialPlantable(stack) != null || isPlantable(stack)) {
seeds.add(stack);
} else {
other.add(stack);
Expand Down Expand Up @@ -160,7 +160,7 @@ public int getPriority() {
return 0;
}

private SpecialPlantable getPlantableFromStack(ItemStack stack) {
private SpecialPlantable getSpecialPlantable(ItemStack stack) {
Item item = stack.getItem();
if (item instanceof SpecialPlantable plantable) {
return plantable;
Expand Down

0 comments on commit 690aa4b

Please sign in to comment.