mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-25 14:24:42 +00:00
Rebalance electron tubes and add ender farm
This commit is contained in:
1 parent
10fec50457
commit
287cb8cb87
36 files changed
+617
-115
No files matched your search
@@ -65,21 +65,29 @@ public abstract class FarmLogic implements IFarmLogic {
|
||||
Stack<ICrop> crops = new Stack<>();
|
||||
for (int i = 0; i < extent; i++) {
|
||||
BlockPos position = translateWithOffset(pos.up(), direction, i);
|
||||
if (world.isAirBlock(position)) {
|
||||
continue;
|
||||
}
|
||||
IBlockState blockState = world.getBlockState(position);
|
||||
for (IFarmable seed : getFarmables()) {
|
||||
ICrop crop = seed.getCropAt(world, position, blockState);
|
||||
if (crop != null) {
|
||||
crops.push(crop);
|
||||
break;
|
||||
}
|
||||
ICrop crop = getCrop(world, position);
|
||||
if(crop != null){
|
||||
crops.push(crop);
|
||||
}
|
||||
}
|
||||
return crops;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected ICrop getCrop(World world, BlockPos position){
|
||||
if (world.isAirBlock(position)) {
|
||||
return null;
|
||||
}
|
||||
IBlockState blockState = world.getBlockState(position);
|
||||
for (IFarmable seed : getFarmables()) {
|
||||
ICrop crop = seed.getCropAt(world, position, blockState);
|
||||
if (crop != null) {
|
||||
return crop;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract boolean isAcceptedWindfall(ItemStack stack);
|
||||
|
||||
protected final boolean isWaterSourceBlock(World world, BlockPos position) {
|
||||
|
||||
Reference in new issue
Block a user