mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Fixed drill dyeing recipes, Closes #1459
This commit is contained in:
parent
db9095e0f7
commit
690aa4bc17
2 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
# 1.3.12+mc1.21.1
|
# 1.3.12+mc1.21.1
|
||||||
* Fixed the Drill dye recipes not functioning.
|
* Fixed the Drill dye recipes not functioning.
|
||||||
* Fixed the name of the first drill speed augment.
|
* 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
|
# 1.3.11+mc1.21.1
|
||||||
* Fixed Farmer not playing well with non-vanilla farmland.
|
* Fixed Farmer not playing well with non-vanilla farmland.
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
||||||
public FarmerResult tryPlantSeed(ItemStack seed, Level world, BlockPos pos, IFarmer farmer) {
|
public FarmerResult tryPlantSeed(ItemStack seed, Level world, BlockPos pos, IFarmer farmer) {
|
||||||
int use = 350;
|
int use = 350;
|
||||||
if (farmer.getEnergy() >= use * 2) {
|
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)) {
|
if (plantable != null && plantable.canPlacePlantAtPosition(seed, world, pos, Direction.DOWN)) {
|
||||||
plantable.spawnPlantAtPosition(seed, world, pos, Direction.DOWN);
|
plantable.spawnPlantAtPosition(seed, world, pos, Direction.DOWN);
|
||||||
farmer.extractEnergy(use);
|
farmer.extractEnergy(use);
|
||||||
|
@ -126,7 +126,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
||||||
if (drops.isEmpty())
|
if (drops.isEmpty())
|
||||||
return FarmerResult.FAIL;
|
return FarmerResult.FAIL;
|
||||||
for (ItemStack stack : drops) {
|
for (ItemStack stack : drops) {
|
||||||
if (this.getPlantableFromStack(stack) != null) {
|
if (this.getSpecialPlantable(stack) != null || isPlantable(stack)) {
|
||||||
seeds.add(stack);
|
seeds.add(stack);
|
||||||
} else {
|
} else {
|
||||||
other.add(stack);
|
other.add(stack);
|
||||||
|
@ -160,7 +160,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SpecialPlantable getPlantableFromStack(ItemStack stack) {
|
private SpecialPlantable getSpecialPlantable(ItemStack stack) {
|
||||||
Item item = stack.getItem();
|
Item item = stack.getItem();
|
||||||
if (item instanceof SpecialPlantable plantable) {
|
if (item instanceof SpecialPlantable plantable) {
|
||||||
return plantable;
|
return plantable;
|
||||||
|
|
Loading…
Reference in a new issue