mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 11:29:23 +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
|
||||
* 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.
|
||||
|
|
|
@ -74,7 +74,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
|||
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);
|
||||
|
@ -126,7 +126,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
|||
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);
|
||||
|
@ -160,7 +160,7 @@ public class DefaultFarmerBehavior implements IFarmerBehavior {
|
|||
return 0;
|
||||
}
|
||||
|
||||
private SpecialPlantable getPlantableFromStack(ItemStack stack) {
|
||||
private SpecialPlantable getSpecialPlantable(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
if (item instanceof SpecialPlantable plantable) {
|
||||
return plantable;
|
||||
|
|
Loading…
Reference in a new issue