Compare commits

...

2 Commits

2 changed files with 11 additions and 3 deletions

View File

@ -31,7 +31,7 @@ public class AutoFarmer { // Really just a namespace and needed to separate thin
new AutoFarmerCropType(Blocks.POTATOES, Items.POTATO, GROWTH_PATTERN.BASIC, Blocks.FARMLAND),
new AutoFarmerCropType(Blocks.CARROTS, Items.CARROT, GROWTH_PATTERN.BASIC, Blocks.FARMLAND),
new AutoFarmerCropType(Blocks.NETHER_WART, Items.NETHER_WART, GROWTH_PATTERN.BASIC, Blocks.SOUL_SAND),
new AutoFarmerCropType(Blocks.SUGAR_CANE, null, GROWTH_PATTERN.LEAVE_BASE, null)
new AutoFarmerCropType(Blocks.SUGAR_CANE, Items.SUGAR_CANE, GROWTH_PATTERN.LEAVE_BASE, null)
};
@ -199,7 +199,11 @@ public class AutoFarmer { // Really just a namespace and needed to separate thin
if (cropType.growth_pattern == GROWTH_PATTERN.LEAVE_BASE && block.isOf(cropType.crop_type) &&
options.crops_enabled[i].get()) {
if (options.seeds_enabled[i].get()) {
return isSecondBlock(client.world, pos, cropType.crop_type) ? ACTION_TYPE.BREAK : ACTION_TYPE.NONE;
} else {
return isBottomBlock(client.world, pos, cropType.crop_type) ? ACTION_TYPE.BREAK : ACTION_TYPE.NONE;
}
}
if (cropType.seed_type != null && cropType.planted_on != null && block.isOf(cropType.planted_on) &&
@ -271,6 +275,10 @@ public class AutoFarmer { // Really just a namespace and needed to separate thin
!world.getBlockState(pos.down().down()).isOf(crop_type);
}
private static boolean isBottomBlock(ClientWorld world, BlockPos pos, Block crop_type) {
return world.getBlockState(pos).isOf(crop_type) && !world.getBlockState(pos.down()).isOf(crop_type);
}
private static void sendStopPackets(MinecraftClient client) {
if (client.world == null || client.player == null)
return;

View File

@ -16,7 +16,7 @@ public class FlyHack {
private static int tickCounter = ticksToFirst;
public static void tick(MinecraftClient client) {
if (client.player == null || client.world == null || client.player.isCreative())
if (client.player == null || client.world == null || client.player.isCreative() || client.player.isSpectator())
return;
client.player.getAbilities().allowFlying = options.flyHackEnabled.get();