Skip to content

Commit

Permalink
Made Fish only spawn in vanilla water. Closes #242
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed May 24, 2021
1 parent cc646a4 commit 39d9863
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.teammetallurgy.aquaculture.init.AquaItems;
import com.teammetallurgy.aquaculture.misc.AquacultureSounds;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.FlowingFluidBlock;
import net.minecraft.entity.EntitySize;
import net.minecraft.entity.EntityType;
Expand All @@ -15,7 +16,6 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
Expand Down Expand Up @@ -116,6 +116,6 @@ public static boolean canSpawnHere(EntityType<? extends AbstractFishEntity> fish

private static boolean isSourceBlock(IWorld world, BlockPos pos) {
BlockState state = world.getBlockState(pos);
return state.getBlock() instanceof FlowingFluidBlock && world.getFluidState(pos).isTagged(FluidTags.WATER) && state.get(FlowingFluidBlock.LEVEL) == 0;
return state.getBlock() instanceof FlowingFluidBlock && world.getBlockState(pos).isIn(Blocks.WATER) && state.get(FlowingFluidBlock.LEVEL) == 0;
}
}
}

0 comments on commit 39d9863

Please sign in to comment.